forked from AlternC/AlternC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bro_pref.php
executable file
·150 lines (137 loc) · 5.24 KB
/
bro_pref.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<?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");
$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);
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();
include_once("head.php");
?>
<?php if (isset($error) && $error) echo "<font color=\"red\">$error</font><br />"; ?>
<h3><?php __("File browser preferences"); ?></h3>
<hr id="topbar"/>
<br />
<form action="bro_pref.php" method="post">
<?php csrf_get(); ?>
<table cellpadding="6" border="1" cellspacing="0" class='tedit'>
<tr><th><?php __("Horizontal window size"); ?></th><td><select class="inl" name="editsizex">
<?php
for($i=50;$i<=200;$i+=10) {
echo "<option";
if ($p["editsizex"]==$i) echo " selected='selected'";
echo ">$i</option>";
}
?></select></td></tr>
<tr><th><?php __("Vertical window size"); ?></th><td><select class="inl" name="editsizey">
<?php
for($i=4;$i<=80;$i+=2) {
echo "<option";
if ($p["editsizey"]==$i) echo " selected='selected'";
echo ">$i</option>";
}
?></select></td></tr>
<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";
if ($p["editor_font"]==$bro->l_editor_font[$i]) echo " selected='selected'";
echo ">"._($bro->l_editor_font[$i])."</option>";
}
?></select></td></tr>
<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";
if ($p["editor_size"]==$bro->l_editor_size[$i]) echo " selected='selected'";
echo ">"._($bro->l_editor_size[$i])."</option>";
}
?></select></td></tr>
<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";
if ($p["listmode"]==$i) echo " selected='selected'";
echo " value=\"$i\">"._($bro->l_mode[$i])."</option>";
}
?></select></td></tr>
<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";
if ($p["downfmt"]==$i) echo " selected='selected'";
echo " value=\"$i\">"._($bro->l_tgz[$i])."</option>";
}
?></select></td></tr>
<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";
if ($p["createfile"]==$i) echo " selected='selected'";
echo " value=\"$i\">"._($bro->l_createfile[$i])."</option>";
}
?></select></td></tr>
<tr><th><?php __("Show icons?"); ?></th><td><select class="inl" name="showicons">
<?php
for($i=0;$i<count($bro->l_icons);$i++) {
echo "<option";
if ($p["showicons"]==$i) echo " selected='selected'";
echo " value=\"$i\">"._($bro->l_icons[$i])."</option>";
}
?></select></td></tr>
<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";
if ($p["showtype"]==$i) echo " selected='selected'";
echo " value=\"$i\">"._($bro->l_icons[$i])."</option>";
}
?></select></td></tr>
<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";
if ($p["golastdir"]==$i) echo " selected='selected'";
echo " value=\"$i\">"._($bro->l_icons[$i])."</option>";
}
?></select></td></tr>
</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>
<?php include_once("foot.php"); ?>