forked from leonardoxc/leonardoxc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GUI_EXT_settings.php
219 lines (202 loc) · 8.14 KB
/
GUI_EXT_settings.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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
<?
//************************************************************************
// Leonardo XC Server, http://www.leonardoxc.net
//
// Copyright (c) 2004-2010 by Andreadakis Manolis
//
// This program is free software. You can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License.
//
// $Id: GUI_EXT_settings.php,v 1.5 2010/04/14 18:58:51 manolis Exp $
//
//************************************************************************
require_once dirname(__FILE__)."/EXT_config_pre.php";
require_once dirname(__FILE__)."/config.php";
require_once dirname(__FILE__)."/EXT_config.php";
require_once dirname(__FILE__)."/CL_flightData.php";
require_once dirname(__FILE__)."/FN_functions.php";
require_once dirname(__FILE__)."/FN_UTM.php";
require_once dirname(__FILE__)."/FN_waypoint.php";
require_once dirname(__FILE__)."/FN_output.php";
require_once dirname(__FILE__)."/FN_pilot.php";
require_once dirname(__FILE__)."/FN_flight.php";
$msg='';
if (isset($_REQUEST['updatePrefs'])) {// submit form
$PREFS->themeName=makeSane($_REQUEST['PREFS_themeName'],0);
$PREFS->itemsPerPage=makeSane($_REQUEST['PREFS_itemsPerPage'],1);
$PREFS->metricSystem=makeSane($_REQUEST['PREFS_metricSystem']);
$PREFS->googleMaps=makeSane($_REQUEST['PREFS_googleMaps'],1);
$PREFS->nameOrder=makeSane($_REQUEST['PREFS_nameOrder'],1);
$PREFS->useEditor=makeSane($_REQUEST['PREFS_useEditor'],1);
$PREFS->showNews=makeSane($_REQUEST['PREFS_showNews'],1);
$PREFS->language=makeSane($_REQUEST['PREFS_language']);
$_SESSION["lng"]= $PREFS->language;
$PREFS->viewCat=makeSane($_REQUEST['PREFS_viewCat'],1);
$_SESSION["cat"]= $PREFS->viewCat;
$PREFS->viewCountry=makeSane($_REQUEST['PREFS_viewCountry']);
$_SESSION["country"]= $PREFS->viewCountry;
if ( !is_dir(dirname(__FILE__)."/templates/".$PREFS->themeName) || !$PREFS->themeName )
$PREFS->themeName=$CONF_defaultThemeName;
$PREFS->setToCookie();
echo "<span class='ok'>"._Your_settings_have_been_updated." <a href='javascript:location.reload(true)'>OK</a></span>";
return;
}
?>
<div id="userPrefsMsg"></div>
<form name="userPrefs" id="userPrefs" method="POST" >
<table width="100%" border="0" bgcolor="#F4F3F1" cellpadding="3" align="left" class="box main_text" style="background-color:#F4F3F1">
<tr>
<td colspan="5" > </td>
</tr>
<tr>
<td width="284" bgcolor="#E0E2F0"><div align="right"><? echo _THEME ?></div></td>
<td width="236"><select name="PREFS_themeName">
<?
$themes=getAvailableThemes();
foreach ($themes as $tmpTheme) {
if ($tmpTheme!= $PREFS->themeName )
echo '<option value="'.$tmpTheme.'">'.$tmpTheme.'</option>';
else
echo '<option value="'.$tmpTheme.'" selected>'.$tmpTheme.'</option>';
}
?>
</select> </td>
<td width="1"> </td>
<td width="284" bgcolor="#E0E2F0"><div align="right"><? echo _SHOW_NEWS?></div></td>
<td width="236"><select name="PREFS_showNews">
<option value="1" <? echo ($PREFS->showNews==1)?"selected":"" ?>><? echo _YES ?></option>
<option value="0" <? echo ($PREFS->showNews==0)?"selected":"" ?>><? echo _NO ?></option>
</select> </td>
</tr>
<tr>
<td width="284" bgcolor="#EAEDEE"><div align="right"><? echo _LANGUAGE ?></div></td>
<td width="236"> <select name="PREFS_language">
<? foreach ($availableLanguages as $tmpLang ) {
if ($tmpLang!= $PREFS->language )
echo '<option value="'.$tmpLang.'">'.$tmpLang.'</option>';
else
echo '<option value="'.$tmpLang.'" selected>'.$tmpLang.'</option>';
}
?>
</select></td>
<td width="1"> </td>
<td width="284" bgcolor="#EAEDEE"> </td>
<td width="236"> </td>
</tr>
<tr>
<td bgcolor="#E0E2F0"><div align="right"><? echo _VIEW_CATEGORY ?></div></td>
<td>
<select name="PREFS_viewCat">
<?
if ($PREFS->viewCat==0) $is_type_sel ="selected";
else $is_type_sel ="";
echo "<option $is_type_sel value=0>"._ALL."</option>\n";
foreach ( $CONF_glider_types as $gl_id=>$gl_type) {
if ($PREFS->viewCat==$gl_id) $is_type_sel ="selected";
else $is_type_sel ="";
echo "<option $is_type_sel value=$gl_id>".$gliderCatList[$gl_id]."</option>\n";
}
?>
</select> </td>
<td> </td>
<td bgcolor="#E0E2F0"> </td>
<td> </td>
</tr>
<tr>
<td bgcolor="#EAEDEE"><div align="right"><? echo _VIEW_COUNTRY ?></div></td>
<td> <select name="PREFS_viewCountry">
<?
if (!$countriesNum) {
list($countriesCodes,$countriesNames,$countriesFlightsNum)=getCountriesList(0,0);
$countriesNum=count($countriesNames);
}
//list($countriesCodes,$countriesNames,$countriesFlightsNum)=getCountriesList();
//$countriesNum=count($countriesNames);
if (! $PREFS->viewCountry) $is_type_sel ="selected";
else $is_type_sel ="";
echo "<option $is_type_sel value=0>"._ALL."</option>\n";
$i=0;
foreach($countriesNames as $countryName) {
if ("$PREFS->viewCountry"=="$countriesCodes[$i]")
echo '<option value="'.$countriesCodes[$i++].'" selected>'.$countryName.'</option>';
else
echo '<option value="'.$countriesCodes[$i++].'">'.$countryName.'</option>';
}
?>
</select></td>
<td> </td>
<td bgcolor="#EAEDEE"> </td>
<td> </td>
</tr>
<tr>
<td bgcolor="#E0E2F0"><div align="right"><? echo _UNITS_SYSTEM ?></div></td>
<td>
<select name="PREFS_metricSystem">
<option value="1" <? echo ($PREFS->metricSystem==1)?"selected":"" ?>><? echo _METRIC_SYSTEM ?></option>
<option value="2" <? echo ($PREFS->metricSystem==2)?"selected":"" ?>><? echo _IMPERIAL_SYSTEM ?></option>
</select></td>
<td> </td>
<td bgcolor="#E0E2F0"> </td>
<td> </td>
</tr>
<tr>
<td bgcolor="#EAEDEE"><div align="right"><? echo _ITEMS_PER_PAGE ?></div></td>
<td> <input name="PREFS_itemsPerPage" type="text" value="<? echo $PREFS->itemsPerPage ?>" size="5" maxlength="120"></td>
<td> </td>
<td bgcolor="#EAEDEE"> </td>
<td> </td>
</tr>
<? if ($CONF_google_maps_track) { ?>
<tr>
<td bgcolor="#E0E2F0"><div align="right"><? echo "Google Maps"?></div></td>
<td>
<select name="PREFS_googleMaps">
<option value="1" <? echo ($PREFS->googleMaps==1)?"selected":"" ?>><? echo _YES ?></option>
<option value="0" <? echo ($PREFS->googleMaps==0)?"selected":"" ?>><? echo _NO ?></option>
</select></td>
<td> </td>
<td bgcolor="#E0E2F0"> </td>
<td> </td>
</tr>
<? } ?>
<? if ($CONF['editor']['use_wysiwyg']['global']) { ?>
<tr>
<td bgcolor="#EAEDEE"><div align="right"><? echo "Advanced Editor"?></div></td>
<td>
<select name="PREFS_useEditor">
<option value="1" <? echo ($PREFS->useEditor==1)?"selected":"" ?>><? echo _YES ?></option>
<option value="0" <? echo ($PREFS->useEditor==0)?"selected":"" ?>><? echo _NO ?></option>
</select></td>
<td> </td>
<td bgcolor="#EAEDEE"> </td>
<td> </td>
</tr>
<? } else { ?>
<input type="hidden" name="PREFS_useEditor" value=0 />
<? } ?>
<tr>
<td bgcolor="#E0E2F0"><div align="right"><? echo _PILOT_NAME ?></div></td>
<td>
<select name="PREFS_nameOrder">
<option value="1" <? echo ($PREFS->nameOrder==1)?"selected":"" ?>><? echo _First_Name.' / '._Last_Name ?></option>
<option value="2" <? echo ($PREFS->nameOrder==2)?"selected":"" ?>><? echo _Last_Name.' / '._First_Name ?></option>
</select></td>
<td> </td>
<td bgcolor="#E0E2F0"> </td>
<td> </td>
</tr>
<tr>
<td colspan="5"><div align="center"> <br />
<input type="button" name="Submit" value="<? echo _Submit_Change_Data ?>" onClick="submitUserPrefs();">
</div></td>
</tr>
<tr>
<td colspan="5" > </td>
</tr>
</table>
<input type="hidden" name="updatePrefs" value="1">
</form>
<?
// closeMain();
?>