AlternC/bureau/admin/bro_pref.php

151 lines
5.2 KiB
PHP
Raw Permalink Normal View History

<?php
/*
----------------------------------------------------------------------
LICENSE
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License (GPL)
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
To read the license please visit http://www.gnu.org/copyleft/gpl.html
----------------------------------------------------------------------
*/
/**
* Form to set the preferences of the file browser of AlternC
*
* @copyright AlternC-Team 2000-2017 https://alternc.com/
*/
require_once("../class/config.php");
2012-08-20 15:34:04 +00:00
$fields = array (
"submit" => array ("post", "string", ""),
"editsizex" => array ("post", "string", ""),
"listmode" => array ("post", "string", ""),
"editsizey" => array ("post", "string", ""),
"showicons" => array ("post", "string", ""),
"downfmt" => array ("post", "string", ""),
"createfile" => array ("post", "string", ""),
"showtype" => array ("post", "string", ""),
"editor_font" => array ("post", "string", ""),
"editor_size" => array ("post", "string", ""),
"golastdir" => array ("post", "string", ""),
);
getFields($fields);
2012-08-21 12:53:29 +00:00
if (!empty($submit)) {
$bro->SetPrefs($editsizex, $editsizey, $listmode, $showicons, $downfmt, $createfile, $showtype, $editor_font, $editor_size, $golastdir);
$msg->raise("INFO", "bro", _("Your preferences have been updated."));
include("bro_main.php");
exit;
}
$p=$bro->GetPrefs();
2009-09-08 05:29:38 +00:00
include_once("head.php");
?>
2012-08-20 15:34:04 +00:00
<?php if (isset($error) && $error) echo "<font color=\"red\">$error</font><br />"; ?>
2009-09-08 05:29:38 +00:00
<h3><?php __("File browser preferences"); ?></h3>
2010-05-02 05:34:36 +00:00
<hr id="topbar"/>
<br />
<form action="bro_pref.php" method="post">
<?php csrf_get(); ?>
2009-09-08 05:29:38 +00:00
2013-01-31 17:33:32 +00:00
<table cellpadding="6" border="1" cellspacing="0" class='tedit'>
<tr><th><?php __("Horizontal window size"); ?></th><td><select class="inl" name="editsizex">
<?php
2009-09-08 05:29:38 +00:00
for($i=50;$i<=200;$i+=10) {
echo "<option";
2013-04-19 15:31:04 +00:00
if ($p["editsizex"]==$i) echo " selected='selected'";
echo ">$i</option>";
}
?></select></td></tr>
2013-01-31 17:33:32 +00:00
<tr><th><?php __("Vertical window size"); ?></th><td><select class="inl" name="editsizey">
<?php
2009-09-08 05:29:38 +00:00
for($i=4;$i<=80;$i+=2) {
echo "<option";
2013-04-19 15:31:04 +00:00
if ($p["editsizey"]==$i) echo " selected='selected'";
echo ">$i</option>";
}
?></select></td></tr>
2013-01-31 17:33:32 +00:00
<tr><th><?php __("File editor font name"); ?></th><td><select class="inl" name="editor_font">
<?php
for($i=0;$i<count($bro->l_editor_font);$i++) {
echo "<option";
2013-04-19 15:31:04 +00:00
if ($p["editor_font"]==$bro->l_editor_font[$i]) echo " selected='selected'";
echo ">"._($bro->l_editor_font[$i])."</option>";
}
?></select></td></tr>
2013-01-31 17:33:32 +00:00
<tr><th><?php __("File editor font size"); ?></th><td><select class="inl" name="editor_size">
<?php
for($i=0;$i<count($bro->l_editor_size);$i++) {
echo "<option";
2013-04-19 15:31:04 +00:00
if ($p["editor_size"]==$bro->l_editor_size[$i]) echo " selected='selected'";
echo ">"._($bro->l_editor_size[$i])."</option>";
}
?></select></td></tr>
2013-01-31 17:33:32 +00:00
<tr><th><?php __("File list view"); ?></th><td><select class="inl" name="listmode">
<?php
for($i=0;$i<count($bro->l_mode);$i++) {
echo "<option";
2013-04-19 15:31:04 +00:00
if ($p["listmode"]==$i) echo " selected='selected'";
echo " value=\"$i\">"._($bro->l_mode[$i])."</option>";
}
?></select></td></tr>
2013-01-31 17:33:32 +00:00
<tr><th><?php __("Downloading file format"); ?></th><td><select class="inl" name="downfmt">
<?php
for($i=0;$i<count($bro->l_tgz);$i++) {
echo "<option";
2013-04-19 15:31:04 +00:00
if ($p["downfmt"]==$i) echo " selected='selected'";
echo " value=\"$i\">"._($bro->l_tgz[$i])."</option>";
}
?></select></td></tr>
2013-01-31 17:33:32 +00:00
<tr><th><?php __("What to do after creating a file"); ?></th><td><select class="inl" name="createfile">
<?php
for($i=0;$i<count($bro->l_createfile);$i++) {
echo "<option";
2013-04-19 15:31:04 +00:00
if ($p["createfile"]==$i) echo " selected='selected'";
echo " value=\"$i\">"._($bro->l_createfile[$i])."</option>";
}
?></select></td></tr>
2013-01-31 17:33:32 +00:00
<tr><th><?php __("Show icons?"); ?></th><td><select class="inl" name="showicons">
<?php
for($i=0;$i<count($bro->l_icons);$i++) {
echo "<option";
2013-04-19 15:31:04 +00:00
if ($p["showicons"]==$i) echo " selected='selected'";
echo " value=\"$i\">"._($bro->l_icons[$i])."</option>";
}
?></select></td></tr>
2013-01-31 17:33:32 +00:00
<tr><th><?php __("Show file types?"); ?></th><td><select class="inl" name="showtype">
<?php
for($i=0;$i<count($bro->l_icons);$i++) {
echo "<option";
2013-04-19 15:31:04 +00:00
if ($p["showtype"]==$i) echo " selected='selected'";
echo " value=\"$i\">"._($bro->l_icons[$i])."</option>";
}
?></select></td></tr>
2013-01-31 17:33:32 +00:00
<tr><th><?php __("Remember last visited directory?"); ?></th><td><select class="inl" name="golastdir">
<?php
for($i=0;$i<count($bro->l_icons);$i++) {
echo "<option";
2013-04-19 15:31:04 +00:00
if ($p["golastdir"]==$i) echo " selected='selected'";
echo " value=\"$i\">"._($bro->l_icons[$i])."</option>";
}
?></select></td></tr>
2013-01-31 17:33:32 +00:00
</table>
<br/>
<input type="submit" name="submit" class="inb" value="<?php __("Change my settings"); ?>" />
<input type="button" class="inb" name="cancel" value="<?php __("Cancel"); ?>" onclick="document.location='bro_main.php'"/>
</form>
2010-05-02 05:34:36 +00:00
<?php include_once("foot.php"); ?>