1
|
<?php
|
2
|
|
3
|
/****************************************************************************
|
4
|
* SVN Version information:
|
5
|
*
|
6
|
* $Id: preferences_form.php 1217 2009-12-16 21:05:52Z MaGnaL $
|
7
|
*
|
8
|
*****************************************************************************
|
9
|
*
|
10
|
*****************************************************************************
|
11
|
* WebsiteBaker
|
12
|
*
|
13
|
* WebsiteBaker Project <http://www.websitebaker2.org/>
|
14
|
* Copyright (C) 2009, Website Baker Org. e.V.
|
15
|
* http://start.websitebaker2.org/impressum-datenschutz.php
|
16
|
* Copyright (C) 2004-2009, Ryan Djurovich
|
17
|
*
|
18
|
* About WebsiteBaker
|
19
|
*
|
20
|
* Website Baker is a PHP-based Content Management System (CMS)
|
21
|
* designed with one goal in mind: to enable its users to produce websites
|
22
|
* with ease.
|
23
|
*
|
24
|
*****************************************************************************
|
25
|
*
|
26
|
*****************************************************************************
|
27
|
* WebsiteBaker Extra Information (where needed)
|
28
|
*
|
29
|
* @author : Ryan Djurovich, stefan, Matthias Gallas, Manuel Lang
|
30
|
* @platform : WebsiteBaker 2.8
|
31
|
*
|
32
|
*****************************************************************************
|
33
|
*
|
34
|
*****************************************************************************
|
35
|
* LICENSE INFORMATION
|
36
|
*
|
37
|
* WebsiteBaker is free software; you can redistribute it and/or
|
38
|
* modify it under the terms of the GNU General Public License
|
39
|
* as published by the Free Software Foundation; either version 2
|
40
|
* of the License, or (at your option) any later version.
|
41
|
*
|
42
|
* WebsiteBaker is distributed in the hope that it will be useful,
|
43
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
44
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
45
|
* See the GNU General Public License for more details.
|
46
|
*
|
47
|
* You should have received a copy of the GNU General Public License
|
48
|
* along with this program; if not, write to the Free Software
|
49
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
50
|
*****************************************************************************/
|
51
|
|
52
|
if(!defined('WB_URL')) die(header('Location: ../../index.php'));
|
53
|
|
54
|
?>
|
55
|
|
56
|
<h2> <?php print $HEADING['MY_SETTINGS']; ?></h2>
|
57
|
|
58
|
<form name="user" action="<?php print WB_URL.'/account/preferences.php'; ?>" method="post" style="margin-bottom: 5px;">
|
59
|
<input type="hidden" name="user_id" value="{USER_ID}" />
|
60
|
|
61
|
<table cellpadding="5" cellspacing="0" border="0" width="97%">
|
62
|
<tr>
|
63
|
<td width="140"><?php print $TEXT['DISPLAY_NAME']; ?>:</td>
|
64
|
<td class="value_input">
|
65
|
<input type="text" name="display_name" style="width: 380px;" maxlength="255" value="<?php print $wb->get_display_name(); ?>" />
|
66
|
</td>
|
67
|
</tr>
|
68
|
<tr>
|
69
|
<td><?php print $TEXT['LANGUAGE']; ?>:</td>
|
70
|
<td>
|
71
|
<select name="language" style="width: 380px;">
|
72
|
<?php
|
73
|
/**
|
74
|
*
|
75
|
* Getting the languages from the database. (addons)
|
76
|
* It's a little bit corious, but the language-shortform is
|
77
|
* storred in the field "directory" ...
|
78
|
*
|
79
|
*/
|
80
|
$query = "SELECT directory, name from ".TABLE_PREFIX."addons where type='language' order by 'name'";
|
81
|
$result = $database->query($query);
|
82
|
if ($result) {
|
83
|
$options_html = "";
|
84
|
while($data = $result->fetchRow()) {
|
85
|
$sel = ($data['directory'] == LANGUAGE) ? " selected=\"selected\" " : "";
|
86
|
$options_html .= "<option value=\"".$data['directory']."\" ".$sel.">".$data['name']." (".$data['directory'].")</option>\n";
|
87
|
}
|
88
|
echo $options_html;
|
89
|
}
|
90
|
?>
|
91
|
</select>
|
92
|
</td>
|
93
|
</tr>
|
94
|
<tr>
|
95
|
<td><?php print $TEXT['TIMEZONE']; ?>:</td>
|
96
|
<td>
|
97
|
<select name="timezone" style="width: 380px;">
|
98
|
<option value="-20"><?php print $TEXT['PLEASE_SELECT']; ?>...</option>
|
99
|
<?php
|
100
|
// Insert default timezone values
|
101
|
require_once(ADMIN_PATH.'/interface/timezones.php');
|
102
|
$test_time = $wb->get_timezone();
|
103
|
$options_html = "";
|
104
|
foreach($TIMEZONES as $hour_offset => $title) {
|
105
|
$sel = ($test_time == $hour_offset*60*60) ? " selected=\"selected\" " : "";
|
106
|
$options_html .= "<option value=\"".$hour_offset."\" ".$sel.">".$title."</option>\n";
|
107
|
}
|
108
|
print $options_html;
|
109
|
?>
|
110
|
|
111
|
</select>
|
112
|
</td>
|
113
|
</tr>
|
114
|
<tr>
|
115
|
<td><?php print $TEXT['DATE_FORMAT']; ?>:</td>
|
116
|
<td>
|
117
|
<select name="date_format" style="width: 98%;">
|
118
|
<option value=""><?php print $TEXT['PLEASE_SELECT']; ?>...</option>
|
119
|
<?php
|
120
|
// Insert date format list
|
121
|
$user_time = true;
|
122
|
require_once(ADMIN_PATH.'/interface/date_formats.php');
|
123
|
foreach($DATE_FORMATS AS $format => $title) {
|
124
|
$format = str_replace('|', ' ', $format); // Add's white-spaces (not able to be stored in array key)
|
125
|
if($format != 'system_default') {
|
126
|
$value = $format;
|
127
|
} else {
|
128
|
$value = '';
|
129
|
}
|
130
|
if(DATE_FORMAT == $format AND !isset($_SESSION['USE_DEFAULT_DATE_FORMAT'])) {
|
131
|
$selected = ' selected="selected"';
|
132
|
} elseif($format == 'system_default' AND isset($_SESSION['USE_DEFAULT_DATE_FORMAT'])) {
|
133
|
$selected = ' selected="selected"';
|
134
|
} else {
|
135
|
$selected = '';
|
136
|
}
|
137
|
print '<option value="'.$value.'"'.$selected.'>'.$title.'</option>'."\n";
|
138
|
}
|
139
|
?>
|
140
|
</select>
|
141
|
</td>
|
142
|
</tr>
|
143
|
<tr>
|
144
|
<td><?php print $TEXT['TIME_FORMAT']; ?>:</td>
|
145
|
<td>
|
146
|
<select name="time_format" style="width: 98%;">
|
147
|
<option value=""><?php print $TEXT['PLEASE_SELECT']; ?>...</option>
|
148
|
<?php
|
149
|
// Insert time format list
|
150
|
$user_time = true;
|
151
|
require_once(ADMIN_PATH.'/interface/time_formats.php');
|
152
|
foreach($TIME_FORMATS AS $format => $title)
|
153
|
{
|
154
|
$format = str_replace('|', ' ', $format); // Add's white-spaces (not able to be stored in array key)
|
155
|
$value = ($format != 'system_default') ? $format : '';
|
156
|
|
157
|
$selected = ((TIME_FORMAT == $format AND ! isset($_SESSION['USE_DEFAULT_TIME_FORMAT']))
|
158
|
OR ($format == 'system_default' AND isset($_SESSION['USE_DEFAULT_TIME_FORMAT'])))
|
159
|
? ' selected="selected"' : '';
|
160
|
|
161
|
print '<option value="'.$value.'"'.$selected.'>'.$title.'</option>';
|
162
|
}
|
163
|
?>
|
164
|
</select>
|
165
|
</td>
|
166
|
</tr>
|
167
|
<tr>
|
168
|
<td> </td>
|
169
|
<td>
|
170
|
<input type="submit" name="submit" value="<?php print $TEXT['SAVE']; ?>" />
|
171
|
<input type="reset" name="reset" value="<?php print $TEXT['RESET']; ?>" />
|
172
|
</td>
|
173
|
</tr>
|
174
|
</table>
|
175
|
|
176
|
</form>
|
177
|
|
178
|
<h2> <?php print $HEADING['MY_EMAIL']; ?></h2>
|
179
|
|
180
|
<form name="email" action="<?php print WB_URL.'/account/preferences.php'; ?>" method="post" style="margin-bottom: 5px;">
|
181
|
<input type="hidden" name="user_id" value="{USER_ID}" />
|
182
|
|
183
|
<table cellpadding="5" cellspacing="0" border="0" width="97%">
|
184
|
<tr>
|
185
|
<td width="140"><?php print $TEXT['CURRENT_PASSWORD']; ?>:</td>
|
186
|
<td>
|
187
|
<input type="password" name="current_password" style="width: 380px;" />
|
188
|
</td>
|
189
|
</tr>
|
190
|
<tr>
|
191
|
<td><?php print $TEXT['EMAIL']; ?>:</td>
|
192
|
<td class="value_input">
|
193
|
<input type="text" name="email" style="width: 380px;" maxlength="255" value="<?php print $wb->get_email(); ?>" />
|
194
|
</td>
|
195
|
</tr>
|
196
|
<tr>
|
197
|
<td> </td>
|
198
|
<td>
|
199
|
<input type="submit" name="submit" value="<?php print $TEXT['SAVE']; ?>" />
|
200
|
<input type="reset" name="reset" value="<?php print $TEXT['RESET']; ?>" />
|
201
|
</td>
|
202
|
</tr>
|
203
|
</table>
|
204
|
|
205
|
</form>
|
206
|
|
207
|
|
208
|
<h2> <?php print $HEADING['MY_PASSWORD']; ?></h2>
|
209
|
|
210
|
<form name="user" action="<?php print WB_URL.'/account/preferences.php'; ?>" method="post">
|
211
|
<input type="hidden" name="user_id" value="{USER_ID}" />
|
212
|
|
213
|
<table cellpadding="5" cellspacing="0" border="0" width="97%">
|
214
|
<tr>
|
215
|
<td width="140"><?php print $TEXT['CURRENT_PASSWORD']; ?>:</td>
|
216
|
<td>
|
217
|
<input type="password" name="current_password" style="width: 380px;" />
|
218
|
</td>
|
219
|
</tr>
|
220
|
<tr>
|
221
|
<td><?php print $TEXT['NEW_PASSWORD']; ?>:</td>
|
222
|
<td>
|
223
|
<input type="password" name="new_password" style="width: 380px;" />
|
224
|
</td>
|
225
|
</tr>
|
226
|
<tr>
|
227
|
<td><?php print $TEXT['RETYPE_NEW_PASSWORD']; ?>:</td>
|
228
|
<td>
|
229
|
<input type="password" name="new_password2" style="width: 380px;" />
|
230
|
</td>
|
231
|
</tr>
|
232
|
<tr>
|
233
|
<td> </td>
|
234
|
<td>
|
235
|
<input type="submit" name="submit" value="<?php print $TEXT['SAVE']; ?>" />
|
236
|
<input type="reset" name="reset" value="<?php print $TEXT['RESET']; ?>" />
|
237
|
</td>
|
238
|
</tr>
|
239
|
</table>
|
240
|
|
241
|
</form>
|