Project

General

Profile

1
<?php
2
/**
3
 *
4
 * @category        frontend
5
 * @package         account
6
 * @author          WebsiteBaker Project
7
 * @copyright       2004-2009, Ryan Djurovich
8
 * @copyright       2009-2011, Website Baker Org. e.V.
9
 * @link			http://www.websitebaker2.org/
10
 * @license         http://www.gnu.org/licenses/gpl.html
11
 * @platform        WebsiteBaker 2.8.x
12
 * @requirements    PHP 5.2.2 and higher
13
 * @version         $Id: preferences_form.php 1473 2011-07-09 00:40:50Z Luisehahne $
14
 * @filesource		$HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/account/preferences_form.php $
15
 * @lastmodified    $Date: 2011-07-09 02:40:50 +0200 (Sat, 09 Jul 2011) $
16
 *
17
 */
18

    
19
// Must include code to stop this file being access directly
20
if(defined('WB_PATH') == false) { die("Cannot access this file directly"); }
21

    
22
?>
23

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

    
26
<form name="user" action="<?php print WB_URL.'/account/preferences.php'; ?>" method="post" style="margin-bottom: 5px;">
27
<input type="hidden" name="user_id" value="{USER_ID}" />
28
<table cellpadding="5" cellspacing="0" border="0" width="97%">
29
<tr>
30
	<td width="140"><?php print $TEXT['DISPLAY_NAME']; ?>:</td>
31
	<td class="value_input">
32
		<input type="text" name="display_name" style="width: 380px;" maxlength="255" value="<?php print $wb->get_display_name(); ?>" />
33
	</td>
34
</tr>
35
<tr>
36
	<td><?php print $TEXT['LANGUAGE']; ?>:</td>
37
	<td>
38
		<select name="language" style="width: 380px;">
39
		<?php
40
		/**
41
		 *
42
		 *	Getting the languages from the database. (addons)
43
		 *	It's a little bit corious, but the language-shortform is
44
		 *	storred in the field "directory" ...
45
		 *
46
		 */
47
		$query  = 'SELECT * FROM `'.TABLE_PREFIX.'addons` ';
48
		$query .= 'WHERE `type` = \'language\' ORDER BY `directory`';
49
		$result = $database->query($query);
50
		if ($result) {
51
			$options_html = "";
52
			while($data = $result->fetchRow()) {
53
				$sel = ($data['directory'] == LANGUAGE) ? " selected=\"selected\" " : "";
54
				// $options_html .= "<option value=\"".$data['directory']."\" ".$sel.">".$data['name']." (".$data['directory'].")</option>\n";
55
				$options_html .= "<option value=\"".$data['directory']."\" ".$sel." style=\"background: url(".THEME_URL.'/images/flags/'.strtolower($data['directory']).".png) no-repeat center left; padding-left: 20px;\">".$data['name']." (".$data['directory'].")</option>\n";
56
			}
57
			echo $options_html;
58
		}
59
		?>
60
		</select>
61
	</td>
62
</tr>
63
<tr>
64
	<td><?php print $TEXT['TIMEZONE']; ?>:</td>
65
	<td>
66
		<select name="timezone" style="width: 380px;">
67
			<option value="-20"><?php print $TEXT['PLEASE_SELECT']; ?>...</option>
68
			<?php
69
				// Insert default timezone values
70
				require_once(ADMIN_PATH.'/interface/timezones.php');
71
				$test_time = $wb->get_timezone();
72
				$options_html = "";
73
				foreach($TIMEZONES as $hour_offset => $title) {
74
					$sel = ($test_time == $hour_offset*60*60) ? " selected=\"selected\" " : ""; 
75
					$options_html .= "<option value=\"".$hour_offset."\" ".$sel.">".$title."</option>\n";
76
				}
77
				print $options_html;
78
?>
79

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

    
126
                $selected = ((TIME_FORMAT == $format AND ! isset($_SESSION['USE_DEFAULT_TIME_FORMAT']))
127
                    OR ($format == 'system_default' AND isset($_SESSION['USE_DEFAULT_TIME_FORMAT'])))
128
                	? ' selected="selected"' : '';
129

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

    
145
</form>
146

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

    
149
<form name="email" action="<?php print WB_URL.'/account/preferences.php'; ?>" method="post" style="margin-bottom: 5px;">
150
<input type="hidden" name="user_id" value="{USER_ID}" />
151
<table cellpadding="5" cellspacing="0" border="0" width="97%">
152
<tr>
153
	<td width="140"><?php print $TEXT['CURRENT_PASSWORD']; ?>:</td>
154
	<td>
155
		<input type="password" name="current_password" style="width: 380px;" />
156
	</td>
157
</tr>
158
<tr>
159
	<td><?php print $TEXT['EMAIL']; ?>:</td>
160
	<td class="value_input">
161
		<input type="text" name="email" style="width: 380px;" maxlength="255" value="<?php print $wb->get_email(); ?>" />
162
	</td>
163
</tr>
164
<tr>
165
	<td>&nbsp;</td>
166
	<td>
167
		<input type="submit" name="submit" value="<?php print $TEXT['SAVE']; ?>" />
168
		<input type="reset" name="reset" value="<?php print $TEXT['RESET']; ?>" />
169
	</td>
170
</tr>
171
</table>
172

    
173
</form>
174

    
175

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

    
178
<form name="user" action="<?php print WB_URL.'/account/preferences.php'; ?>" method="post">
179
<input type="hidden" name="user_id" value="{USER_ID}" />
180
<table cellpadding="5" cellspacing="0" border="0" width="97%">
181
<tr>
182
	<td width="140"><?php print $TEXT['CURRENT_PASSWORD']; ?>:</td>
183
	<td>
184
		<input type="password" name="current_password" style="width: 380px;" />
185
	</td>
186
</tr>
187
<tr>
188
	<td><?php print $TEXT['NEW_PASSWORD']; ?>:</td>
189
	<td>
190
		<input type="password" name="new_password" style="width: 380px;" />
191
	</td>
192
</tr>
193
<tr>
194
	<td><?php print $TEXT['RETYPE_NEW_PASSWORD']; ?>:</td>
195
	<td>
196
		<input type="password" name="new_password2" style="width: 380px;" />
197
	</td>
198
</tr>
199
<tr>
200
	<td>&nbsp;</td>
201
	<td>
202
		<input type="submit" name="submit" value="<?php print $TEXT['SAVE']; ?>" />
203
		<input type="reset" name="reset" value="<?php print $TEXT['RESET']; ?>" />
204
	</td>
205
</tr>
206
</table>
207

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