Alternc  latest
Alternc logiel libre pour l'hébergement
bro_pref.php
Go to the documentation of this file.
1 <?php
2 /*
3  ----------------------------------------------------------------------
4  LICENSE
5 
6  This program is free software; you can redistribute it and/or
7  modify it under the terms of the GNU General Public License (GPL)
8  as published by the Free Software Foundation; either version 2
9  of the License, or (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  To read the license please visit http://www.gnu.org/copyleft/gpl.html
17  ----------------------------------------------------------------------
18 */
19 
20 /**
21  * Form to set the preferences of the file browser of AlternC
22  *
23  * @copyright AlternC-Team 2000-2017 https://alternc.com/
24  */
25 
26 require_once("../class/config.php");
27 
28 $fields = array (
29  "submit" => array ("post", "string", ""),
30  "editsizex" => array ("post", "string", ""),
31  "listmode" => array ("post", "string", ""),
32  "editsizey" => array ("post", "string", ""),
33  "showicons" => array ("post", "string", ""),
34  "downfmt" => array ("post", "string", ""),
35  "createfile" => array ("post", "string", ""),
36  "showtype" => array ("post", "string", ""),
37  "editor_font" => array ("post", "string", ""),
38  "editor_size" => array ("post", "string", ""),
39  "golastdir" => array ("post", "string", ""),
40 );
42 
43 if (!empty($submit)) {
44  $bro->SetPrefs($editsizex, $editsizey, $listmode, $showicons, $downfmt, $createfile, $showtype, $editor_font, $editor_size, $golastdir);
45  $msg->raise("INFO", "bro", _("Your preferences have been updated."));
46  include("bro_main.php");
47  exit;
48 }
49 $p=$bro->GetPrefs();
50 
51 include_once("head.php");
52 
53 ?>
54 <?php if (isset($error) && $error) echo "<font color=\"red\">$error</font><br />"; ?>
55 <h3><?php __("File browser preferences"); ?></h3>
56 <hr id="topbar"/>
57 <br />
58 <form action="bro_pref.php" method="post">
59  <?php csrf_get(); ?>
60 
61 <table cellpadding="6" border="1" cellspacing="0" class='tedit'>
62 <tr><th><?php __("Horizontal window size"); ?></th><td><select class="inl" name="editsizex">
63 <?php
64 for($i=50;$i<=200;$i+=10) {
65  echo "<option";
66  if ($p["editsizex"]==$i) echo " selected='selected'";
67  echo ">$i</option>";
68 }
69 ?></select></td></tr>
70 <tr><th><?php __("Vertical window size"); ?></th><td><select class="inl" name="editsizey">
71 <?php
72 for($i=4;$i<=80;$i+=2) {
73  echo "<option";
74  if ($p["editsizey"]==$i) echo " selected='selected'";
75  echo ">$i</option>";
76 }
77 ?></select></td></tr>
78 <tr><th><?php __("File editor font name"); ?></th><td><select class="inl" name="editor_font">
79 <?php
80 for($i=0;$i<count($bro->l_editor_font);$i++) {
81  echo "<option";
82  if ($p["editor_font"]==$bro->l_editor_font[$i]) echo " selected='selected'";
83  echo ">"._($bro->l_editor_font[$i])."</option>";
84 }
85 ?></select></td></tr>
86 <tr><th><?php __("File editor font size"); ?></th><td><select class="inl" name="editor_size">
87 <?php
88 for($i=0;$i<count($bro->l_editor_size);$i++) {
89  echo "<option";
90  if ($p["editor_size"]==$bro->l_editor_size[$i]) echo " selected='selected'";
91  echo ">"._($bro->l_editor_size[$i])."</option>";
92 }
93 ?></select></td></tr>
94 <tr><th><?php __("File list view"); ?></th><td><select class="inl" name="listmode">
95 <?php
96 for($i=0;$i<count($bro->l_mode);$i++) {
97  echo "<option";
98  if ($p["listmode"]==$i) echo " selected='selected'";
99  echo " value=\"$i\">"._($bro->l_mode[$i])."</option>";
100 }
101 ?></select></td></tr>
102 <tr><th><?php __("Downloading file format"); ?></th><td><select class="inl" name="downfmt">
103 <?php
104 for($i=0;$i<count($bro->l_tgz);$i++) {
105  echo "<option";
106  if ($p["downfmt"]==$i) echo " selected='selected'";
107  echo " value=\"$i\">"._($bro->l_tgz[$i])."</option>";
108 }
109 ?></select></td></tr>
110 <tr><th><?php __("What to do after creating a file"); ?></th><td><select class="inl" name="createfile">
111 <?php
112 for($i=0;$i<count($bro->l_createfile);$i++) {
113  echo "<option";
114  if ($p["createfile"]==$i) echo " selected='selected'";
115  echo " value=\"$i\">"._($bro->l_createfile[$i])."</option>";
116 }
117 ?></select></td></tr>
118 <tr><th><?php __("Show icons?"); ?></th><td><select class="inl" name="showicons">
119 <?php
120 for($i=0;$i<count($bro->l_icons);$i++) {
121  echo "<option";
122  if ($p["showicons"]==$i) echo " selected='selected'";
123  echo " value=\"$i\">"._($bro->l_icons[$i])."</option>";
124 }
125 ?></select></td></tr>
126 <tr><th><?php __("Show file types?"); ?></th><td><select class="inl" name="showtype">
127 <?php
128 for($i=0;$i<count($bro->l_icons);$i++) {
129  echo "<option";
130  if ($p["showtype"]==$i) echo " selected='selected'";
131  echo " value=\"$i\">"._($bro->l_icons[$i])."</option>";
132 }
133 ?></select></td></tr>
134 <tr><th><?php __("Remember last visited directory?"); ?></th><td><select class="inl" name="golastdir">
135 <?php
136 for($i=0;$i<count($bro->l_icons);$i++) {
137  echo "<option";
138  if ($p["golastdir"]==$i) echo " selected='selected'";
139  echo " value=\"$i\">"._($bro->l_icons[$i])."</option>";
140 }
141 ?></select></td></tr>
142 </table>
143 <br/>
144 
145  <input type="submit" name="submit" class="inb" value="<?php __("Change my settings"); ?>" />
146  <input type="button" class="inb" name="cancel" value="<?php __("Cancel"); ?>" onclick="document.location='bro_main.php'"/>
147 
148 
149 </form>
150 <?php include_once("foot.php"); ?>
exit
Definition: adm_doadd.php:70
$msg
Definition: bootstrap.php:75
if(!empty($submit)) $p
Definition: bro_pref.php:49
$fields
Form to set the preferences of the file browser of AlternC.
Definition: bro_pref.php:28
__($str)
Definition: functions.php:404
getFields($fields, $requestOnly=false)
Get the Fields of the posted form from $_REQUEST or POST or GET and check their type.
Definition: functions.php:688
csrf_get($return=false)
Give a new CSRF uniq token for a form the session must be up since the CSRF is linked to the session ...
Definition: functions.php:1159
$bro
Definition: bootstrap.php:151
$i
$error
Definition: ssl_delete.php:45