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 1420 2011-01-26 17:43:56Z Luisehahne $
14
 * @filesource		$HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/account/preferences_form.php $
15
 * @lastmodified    $Date: 2011-01-26 18:43:56 +0100 (Wed, 26 Jan 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
$ftan = $wb->getFTAN();
23
?>
24

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

    
27
<form name="user" action="<?php print WB_URL.'/account/preferences.php'; ?>" method="post" style="margin-bottom: 5px;">
28
<input type="hidden" name="user_id" value="{USER_ID}" />
29
<?php echo $ftan; ?>
30
<table cellpadding="5" cellspacing="0" border="0" width="97%">
31
<tr>
32
	<td width="140"><?php print $TEXT['DISPLAY_NAME']; ?>:</td>
33
	<td class="value_input">
34
		<input type="text" name="display_name" style="width: 380px;" maxlength="255" value="<?php print $wb->get_display_name(); ?>" />
35
	</td>
36
</tr>
37
<tr>
38
	<td><?php print $TEXT['LANGUAGE']; ?>:</td>
39
	<td>
40
		<select name="language" style="width: 380px;">
41
		<?php
42
		/**
43
		 *
44
		 *	Getting the languages from the database. (addons)
45
		 *	It's a little bit corious, but the language-shortform is
46
		 *	storred in the field "directory" ...
47
		 *
48
		 */
49
		$query = "SELECT directory, name from ".TABLE_PREFIX."addons where type='language' order by 'name'";
50
		$result = $database->query($query);
51
		if ($result) {
52
			$options_html = "";
53
			while($data = $result->fetchRow()) {
54
				$sel = ($data['directory'] == LANGUAGE) ? " selected=\"selected\" " : "";
55
				$options_html .= "<option value=\"".$data['directory']."\" ".$sel.">".$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
<?php echo $ftan; ?>
152
<table cellpadding="5" cellspacing="0" border="0" width="97%">
153
<tr>
154
	<td width="140"><?php print $TEXT['CURRENT_PASSWORD']; ?>:</td>
155
	<td>
156
		<input type="password" name="current_password" style="width: 380px;" />
157
	</td>
158
</tr>
159
<tr>
160
	<td><?php print $TEXT['EMAIL']; ?>:</td>
161
	<td class="value_input">
162
		<input type="text" name="email" style="width: 380px;" maxlength="255" value="<?php print $wb->get_email(); ?>" />
163
	</td>
164
</tr>
165
<tr>
166
	<td>&nbsp;</td>
167
	<td>
168
		<input type="submit" name="submit" value="<?php print $TEXT['SAVE']; ?>" />
169
		<input type="reset" name="reset" value="<?php print $TEXT['RESET']; ?>" />
170
	</td>
171
</tr>
172
</table>
173

    
174
</form>
175

    
176

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

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

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