Project

General

Profile

1
<?php
2
/*
3
*
4
*                       About WebsiteBaker
5
*
6
* Website Baker is a PHP-based Content Management System (CMS)
7
* designed with one goal in mind: to enable its users to produce websites
8
* with ease.
9
*
10
*                       LICENSE INFORMATION
11
*
12
* WebsiteBaker is free software; you can redistribute it and/or
13
* modify it under the terms of the GNU General Public License
14
* as published by the Free Software Foundation; either version 2
15
* of the License, or (at your option) any later version.
16
*
17
* WebsiteBaker is distributed in the hope that it will be useful,
18
* but WITHOUT ANY WARRANTY; without even the implied warranty of
19
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20
* See the GNU General Public License for more details.
21
*
22
* You should have received a copy of the GNU General Public License
23
* along with this program; if not, write to the Free Software
24
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
25
*
26
*                   WebsiteBaker Extra Information
27
*
28
*
29
*/
30
/**
31
 *
32
 * @category        frontend
33
 * @package         account
34
 * @author          Ryan Djurovich
35
 * @copyright       2004-2009, Ryan Djurovich
36
 * @copyright       2009-2010, Website Baker Org. e.V.
37
 * @filesource		$HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/account/preferences_form.php $
38
 * @author          Ryan Djurovich
39
 * @copyright       2004-2009, Ryan Djurovich
40
 *
41
 * @author          WebsiteBaker Project
42
 * @link			http://www.websitebaker2.org/
43
 * @copyright       2009-2010, Website Baker Org. e.V.
44
 * @link			http://start.websitebaker2.org/impressum-datenschutz.php
45
 * @license         http://www.gnu.org/licenses/gpl.html
46
 * @version         $Id: preferences_form.php 1262 2010-01-21 08:24:34Z Luisehahne $ 
47
 * @platform        WebsiteBaker 2.8.x
48
 * @requirements    PHP 4.3.4 and higher
49
 * @lastmodified    $Date: 2010-01-21 09:24:34 +0100 (Thu, 21 Jan 2010) $
50
 *
51
 */
52

    
53
if(!defined('WB_URL')) die(header('Location: ../../index.php'));
54

    
55
?>
56

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

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

    
62
<table cellpadding="5" cellspacing="0" border="0" width="97%">
63
<tr>
64
	<td width="140"><?php print $TEXT['DISPLAY_NAME']; ?>:</td>
65
	<td class="value_input">
66
		<input type="text" name="display_name" style="width: 380px;" maxlength="255" value="<?php print $wb->get_display_name(); ?>" />
67
	</td>
68
</tr>
69
<tr>
70
	<td><?php print $TEXT['LANGUAGE']; ?>:</td>
71
	<td>
72
		<select name="language" style="width: 380px;">
73
		<?php
74
		/**
75
		 *
76
		 *	Getting the languages from the database. (addons)
77
		 *	It's a little bit corious, but the language-shortform is
78
		 *	storred in the field "directory" ...
79
		 *
80
		 */
81
		$query = "SELECT directory, name from ".TABLE_PREFIX."addons where type='language' order by 'name'";
82
		$result = $database->query($query);
83
		if ($result) {
84
			$options_html = "";
85
			while($data = $result->fetchRow()) {
86
				$sel = ($data['directory'] == LANGUAGE) ? " selected=\"selected\" " : "";
87
				$options_html .= "<option value=\"".$data['directory']."\" ".$sel.">".$data['name']." (".$data['directory'].")</option>\n";
88
			}
89
			echo $options_html;
90
		}
91
		?>
92
		</select>
93
	</td>
94
</tr>
95
<tr>
96
	<td><?php print $TEXT['TIMEZONE']; ?>:</td>
97
	<td>
98
		<select name="timezone" style="width: 380px;">
99
			<option value="-20"><?php print $TEXT['PLEASE_SELECT']; ?>...</option>
100
			<?php
101
				// Insert default timezone values
102
				require_once(ADMIN_PATH.'/interface/timezones.php');
103
				$test_time = $wb->get_timezone();
104
				$options_html = "";
105
				foreach($TIMEZONES as $hour_offset => $title) {
106
					$sel = ($test_time == $hour_offset*60*60) ? " selected=\"selected\" " : ""; 
107
					$options_html .= "<option value=\"".$hour_offset."\" ".$sel.">".$title."</option>\n";
108
				}
109
				print $options_html;
110
?>
111

    
112
		</select>
113
	</td>
114
</tr>
115
<tr>
116
	<td><?php print $TEXT['DATE_FORMAT']; ?>:</td>
117
	<td>
118
		<select name="date_format" style="width: 98%;">
119
			<option value=""><?php print $TEXT['PLEASE_SELECT']; ?>...</option>
120
			<?php
121
			// Insert date format list
122
			$user_time = true;
123
			require_once(ADMIN_PATH.'/interface/date_formats.php');
124
			foreach($DATE_FORMATS AS $format => $title) {
125
				$format = str_replace('|', ' ', $format); // Add's white-spaces (not able to be stored in array key)
126
				if($format != 'system_default') {
127
					$value = $format;
128
				} else {
129
					$value = '';
130
				}
131
				if(DATE_FORMAT == $format AND !isset($_SESSION['USE_DEFAULT_DATE_FORMAT'])) {
132
					$selected = ' selected="selected"';
133
				} elseif($format == 'system_default' AND isset($_SESSION['USE_DEFAULT_DATE_FORMAT'])) {
134
					$selected = ' selected="selected"';
135
				} else {
136
					$selected = '';
137
				}
138
				print '<option value="'.$value.'"'.$selected.'>'.$title.'</option>'."\n";
139
			}
140
			?>
141
		</select>
142
	</td>
143
</tr>
144
<tr>
145
	<td><?php print $TEXT['TIME_FORMAT']; ?>:</td>
146
	<td>
147
		<select name="time_format" style="width: 98%;">
148
			<option value=""><?php print $TEXT['PLEASE_SELECT']; ?>...</option>
149
			<?php
150
			// Insert time format list
151
			$user_time = true;
152
			require_once(ADMIN_PATH.'/interface/time_formats.php');
153
			foreach($TIME_FORMATS AS $format => $title)
154
            {
155
				$format = str_replace('|', ' ', $format); // Add's white-spaces (not able to be stored in array key)
156
                $value = ($format != 'system_default') ? $format : '';
157

    
158
                $selected = ((TIME_FORMAT == $format AND ! isset($_SESSION['USE_DEFAULT_TIME_FORMAT']))
159
                    OR ($format == 'system_default' AND isset($_SESSION['USE_DEFAULT_TIME_FORMAT'])))
160
                	? ' selected="selected"' : '';
161

    
162
				print '<option value="'.$value.'"'.$selected.'>'.$title.'</option>';
163
			}
164
			?>
165
		</select>
166
	</td>
167
</tr>
168
<tr>
169
	<td>&nbsp;</td>
170
	<td>
171
		<input type="submit" name="submit" value="<?php print $TEXT['SAVE']; ?>" />
172
		<input type="reset" name="reset" value="<?php print $TEXT['RESET']; ?>" />
173
	</td>
174
</tr>
175
</table>
176

    
177
</form>
178

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

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

    
184
<table cellpadding="5" cellspacing="0" border="0" width="97%">
185
<tr>
186
	<td width="140"><?php print $TEXT['CURRENT_PASSWORD']; ?>:</td>
187
	<td>
188
		<input type="password" name="current_password" style="width: 380px;" />
189
	</td>
190
</tr>
191
<tr>
192
	<td><?php print $TEXT['EMAIL']; ?>:</td>
193
	<td class="value_input">
194
		<input type="text" name="email" style="width: 380px;" maxlength="255" value="<?php print $wb->get_email(); ?>" />
195
	</td>
196
</tr>
197
<tr>
198
	<td>&nbsp;</td>
199
	<td>
200
		<input type="submit" name="submit" value="<?php print $TEXT['SAVE']; ?>" />
201
		<input type="reset" name="reset" value="<?php print $TEXT['RESET']; ?>" />
202
	</td>
203
</tr>
204
</table>
205

    
206
</form>
207

    
208

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

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

    
214
<table cellpadding="5" cellspacing="0" border="0" width="97%">
215
<tr>
216
	<td width="140"><?php print $TEXT['CURRENT_PASSWORD']; ?>:</td>
217
	<td>
218
		<input type="password" name="current_password" style="width: 380px;" />
219
	</td>
220
</tr>
221
<tr>
222
	<td><?php print $TEXT['NEW_PASSWORD']; ?>:</td>
223
	<td>
224
		<input type="password" name="new_password" style="width: 380px;" />
225
	</td>
226
</tr>
227
<tr>
228
	<td><?php print $TEXT['RETYPE_NEW_PASSWORD']; ?>:</td>
229
	<td>
230
		<input type="password" name="new_password2" style="width: 380px;" />
231
	</td>
232
</tr>
233
<tr>
234
	<td>&nbsp;</td>
235
	<td>
236
		<input type="submit" name="submit" value="<?php print $TEXT['SAVE']; ?>" />
237
		<input type="reset" name="reset" value="<?php print $TEXT['RESET']; ?>" />
238
	</td>
239
</tr>
240
</table>
241

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