Project

General

Profile

1
<?php
2

    
3
// $Id: preferences_form.php 1190 2009-11-26 17:17:44Z Luisehahne $
4

    
5
/*
6

    
7
 Website Baker Project <http://www.websitebaker.org/>
8
 Copyright (C) 2004-2009, 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')) die(header('Location: ../../index.php'));
27

    
28
?>
29

    
30
<h2>&nbsp;<?php print $HEADING['MY_SETTINGS']; ?></h2>
31

    
32
<form name="user" action="<?php print WB_URL.'/account/preferences.php'; ?>" method="post" style="margin-bottom: 5px;">
33
<input type="hidden" name="user_id" value="{USER_ID}" />
34

    
35
<table cellpadding="5" cellspacing="0" border="0" width="97%">
36
<tr>
37
	<td width="140"><?php print $TEXT['DISPLAY_NAME']; ?>:</td>
38
	<td class="value_input">
39
		<input type="text" name="display_name" style="width: 380px;" maxlength="255" value="<?php print $wb->get_display_name(); ?>" />
40
	</td>
41
</tr>
42
<tr>
43
	<td><?php print $TEXT['LANGUAGE']; ?>:</td>
44
	<td>
45
		<select name="language" style="width: 380px;">
46
		<?php
47
		/**
48
		 *
49
		 *	Getting the languages from the database. (addons)
50
		 *	It's a little bit corious, but the language-shortform is
51
		 *	storred in the field "directory" ...
52
		 *
53
		 */
54
		$query = "SELECT directory, name from ".TABLE_PREFIX."addons where type='language' order by 'name'";
55
		$result = $database->query($query);
56
		if ($result) {
57
			$options_html = "";
58
			while($data = $result->fetchRow()) {
59
				$sel = ($data['directory'] == LANGUAGE) ? " selected=\"selected\" " : "";
60
				$options_html .= "<option value=\"".$data['directory']."\" ".$sel.">".$data['name']." (".$data['directory'].")</option>\n";
61
			}
62
			echo $options_html;
63
		}
64
		?>
65
		</select>
66
	</td>
67
</tr>
68
<tr>
69
	<td><?php print $TEXT['TIMEZONE']; ?>:</td>
70
	<td>
71
		<select name="timezone" style="width: 380px;">
72
			<option value="-20"><?php print $TEXT['PLEASE_SELECT']; ?>...</option>
73
			<?php
74
				// Insert default timezone values
75
				require_once(ADMIN_PATH.'/interface/timezones.php');
76
				$test_time = $wb->get_timezone();
77
				$options_html = "";
78
				foreach($TIMEZONES as $hour_offset => $title) {
79
					$sel = ($test_time == $hour_offset*60*60) ? " selected=\"selected\" " : ""; 
80
					$options_html .= "<option value=\"".$hour_offset."\" ".$sel.">".$title."</option>\n";
81
				}
82
				print $options_html;
83
?>
84

    
85
		</select>
86
	</td>
87
</tr>
88
<tr>
89
	<td><?php print $TEXT['DATE_FORMAT']; ?>:</td>
90
	<td>
91
		<select name="date_format" style="width: 98%;">
92
			<option value="">Please select...</option>
93
			<?php
94
			// Insert date format list
95
			$user_time = true;
96
			require_once(ADMIN_PATH.'/interface/date_formats.php');
97
			foreach($DATE_FORMATS AS $format => $title) {
98
				$format = str_replace('|', ' ', $format); // Add's white-spaces (not able to be stored in array key)
99
				if($format != 'system_default') {
100
					$value = $format;
101
				} else {
102
					$value = '';
103
				}
104
				if(DATE_FORMAT == $format AND !isset($_SESSION['USE_DEFAULT_DATE_FORMAT'])) {
105
					$selected = ' selected="selected"';
106
				} elseif($format == 'system_default' AND isset($_SESSION['USE_DEFAULT_DATE_FORMAT'])) {
107
					$selected = ' selected="selected"';
108
				} else {
109
					$selected = '';
110
				}
111
				print '<option value="'.$value.'"'.$selected.'>'.$title.'</option>'."\n";
112
			}
113
			?>
114
		</select>
115
	</td>
116
</tr>
117
<tr>
118
	<td><?php print $TEXT['TIME_FORMAT']; ?>:</td>
119
	<td>
120
		<select name="time_format" style="width: 98%;">
121
			<option value="">Please select...</option>
122
			<?php
123
			// Insert time format list
124
			$user_time = true;
125
			require_once(ADMIN_PATH.'/interface/time_formats.php');
126
			foreach($TIME_FORMATS AS $format => $title)
127
            {
128
				$format = str_replace('|', ' ', $format); // Add's white-spaces (not able to be stored in array key)
129
                $value = ($format != 'system_default') ? $format : '';
130

    
131
                $selected = ((TIME_FORMAT == $format AND ! isset($_SESSION['USE_DEFAULT_TIME_FORMAT']))
132
                    OR ($format == 'system_default' AND isset($_SESSION['USE_DEFAULT_TIME_FORMAT'])))
133
                	? ' selected="selected"' : '';
134

    
135
				print '<option value="'.$value.'"'.$selected.'>'.$title.'</option>';
136
			}
137
			?>
138
		</select>
139
	</td>
140
</tr>
141
<tr>
142
	<td>&nbsp;</td>
143
	<td>
144
		<input type="submit" name="submit" value="<?php print $TEXT['SAVE']; ?>" />
145
		<input type="reset" name="reset" value="<?php print $TEXT['RESET']; ?>" />
146
	</td>
147
</tr>
148
</table>
149

    
150
</form>
151

    
152
<h2>&nbsp;<?php print $HEADING['MY_EMAIL']; ?></h2>
153

    
154
<form name="email" action="<?php print WB_URL.'/account/preferences.php'; ?>" method="post" style="margin-bottom: 5px;">
155
<input type="hidden" name="user_id" value="{USER_ID}" />
156

    
157
<table cellpadding="5" cellspacing="0" border="0" width="97%">
158
<tr>
159
	<td width="140"><?php print $TEXT['CURRENT_PASSWORD']; ?>:</td>
160
	<td>
161
		<input type="password" name="current_password" style="width: 380px;" />
162
	</td>
163
</tr>
164
<tr>
165
	<td><?php print $TEXT['EMAIL']; ?>:</td>
166
	<td class="value_input">
167
		<input type="text" name="email" style="width: 380px;" maxlength="255" value="<?php print $wb->get_email(); ?>" />
168
	</td>
169
</tr>
170
<tr>
171
	<td>&nbsp;</td>
172
	<td>
173
		<input type="submit" name="submit" value="<?php print $TEXT['SAVE']; ?>" />
174
		<input type="reset" name="reset" value="<?php print $TEXT['RESET']; ?>" />
175
	</td>
176
</tr>
177
</table>
178

    
179
</form>
180

    
181

    
182
<h2>&nbsp;<?php print $HEADING['MY_PASSWORD']; ?></h2>
183

    
184
<form name="user" action="<?php print WB_URL.'/account/preferences.php'; ?>" method="post">
185
<input type="hidden" name="user_id" value="{USER_ID}" />
186

    
187
<table cellpadding="5" cellspacing="0" border="0" width="97%">
188
<tr>
189
	<td width="140"><?php print $TEXT['CURRENT_PASSWORD']; ?>:</td>
190
	<td>
191
		<input type="password" name="current_password" style="width: 380px;" />
192
	</td>
193
</tr>
194
<tr>
195
	<td><?php print $TEXT['NEW_PASSWORD']; ?>:</td>
196
	<td>
197
		<input type="password" name="new_password" style="width: 380px;" />
198
	</td>
199
</tr>
200
<tr>
201
	<td><?php print $TEXT['RETYPE_NEW_PASSWORD']; ?>:</td>
202
	<td>
203
		<input type="password" name="new_password2" style="width: 380px;" />
204
	</td>
205
</tr>
206
<tr>
207
	<td>&nbsp;</td>
208
	<td>
209
		<input type="submit" name="submit" value="<?php print $TEXT['SAVE']; ?>" />
210
		<input type="reset" name="reset" value="<?php print $TEXT['RESET']; ?>" />
211
	</td>
212
</tr>
213
</table>
214

    
215
</form>
(11-11/14)