Project

General

Profile

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