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 1435 2011-03-16 23:39:07Z Luisehahne $
14
 * @filesource		$HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/account/preferences_form.php $
15
 * @lastmodified    $Date: 2011-03-17 00:39:07 +0100 (Thu, 17 Mar 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 * FROM `'.TABLE_PREFIX.'addons` ';
50
		$query .= 'WHERE `type` = \'language\' ORDER BY `directory`';
51
		$result = $database->query($query);
52
		if ($result) {
53
			$options_html = "";
54
			while($data = $result->fetchRow()) {
55
				$sel = ($data['directory'] == LANGUAGE) ? " selected=\"selected\" " : "";
56
				// $options_html .= "<option value=\"".$data['directory']."\" ".$sel.">".$data['name']." (".$data['directory'].")</option>\n";
57
				$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";
58
			}
59
			echo $options_html;
60
		}
61
		?>
62
		</select>
63
	</td>
64
</tr>
65
<tr>
66
	<td><?php print $TEXT['TIMEZONE']; ?>:</td>
67
	<td>
68
		<select name="timezone" style="width: 380px;">
69
			<option value="-20"><?php print $TEXT['PLEASE_SELECT']; ?>...</option>
70
			<?php
71
				// Insert default timezone values
72
				require_once(ADMIN_PATH.'/interface/timezones.php');
73
				$test_time = $wb->get_timezone();
74
				$options_html = "";
75
				foreach($TIMEZONES as $hour_offset => $title) {
76
					$sel = ($test_time == $hour_offset*60*60) ? " selected=\"selected\" " : ""; 
77
					$options_html .= "<option value=\"".$hour_offset."\" ".$sel.">".$title."</option>\n";
78
				}
79
				print $options_html;
80
?>
81

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

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

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

    
147
</form>
148

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

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

    
176
</form>
177

    
178

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

    
181
<form name="user" action="<?php print WB_URL.'/account/preferences.php'; ?>" method="post">
182
<input type="hidden" name="user_id" value="{USER_ID}" />
183
<?php echo $ftan; ?>
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['NEW_PASSWORD']; ?>:</td>
193
	<td>
194
		<input type="password" name="new_password" style="width: 380px;" />
195
	</td>
196
</tr>
197
<tr>
198
	<td><?php print $TEXT['RETYPE_NEW_PASSWORD']; ?>:</td>
199
	<td>
200
		<input type="password" name="new_password2" style="width: 380px;" />
201
	</td>
202
</tr>
203
<tr>
204
	<td>&nbsp;</td>
205
	<td>
206
		<input type="submit" name="submit" value="<?php print $TEXT['SAVE']; ?>" />
207
		<input type="reset" name="reset" value="<?php print $TEXT['RESET']; ?>" />
208
	</td>
209
</tr>
210
</table>
211

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