Index: branches/2.8.x/CHANGELOG
===================================================================
--- branches/2.8.x/CHANGELOG	(revision 1507)
+++ branches/2.8.x/CHANGELOG	(revision 1508)
@@ -12,6 +12,8 @@
 
 =============================== FEATURES FREEZE ================================
 ----------------------------------- Fixes 2.8.2 --------------------------------
+07 Sep-2011 Build 1508 Dietmar Woellbrink (Luisehahne)
+# fixed print_error exit in frontend account
 06 Sep-2011 Build 1507 Dietmar Woellbrink (Luisehahne)
 # fixed field_remove
 26 Aug-2011 Build 1506 Werner v.d.Decken(DarkViper)
Index: branches/2.8.x/wb/admin/interface/version.php
===================================================================
--- branches/2.8.x/wb/admin/interface/version.php	(revision 1507)
+++ branches/2.8.x/wb/admin/interface/version.php	(revision 1508)
@@ -52,4 +52,4 @@
 
 // check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled)
 if(!defined('VERSION')) define('VERSION', '2.8.2');
-if(!defined('REVISION')) define('REVISION', '1507');
+if(!defined('REVISION')) define('REVISION', '1508');
Index: branches/2.8.x/wb/account/login_form.php
===================================================================
--- branches/2.8.x/wb/account/login_form.php	(revision 1507)
+++ branches/2.8.x/wb/account/login_form.php	(revision 1508)
@@ -21,7 +21,7 @@
 
 $username_fieldname = 'username';
 $password_fieldname = 'password';
-	
+
 if(defined('SMART_LOGIN') AND SMART_LOGIN == 'enabled') {
 	// Generate username field name
 	$username_fieldname = 'username_';
@@ -34,7 +34,16 @@
 		$password_fieldname .= $temp[$i];
 	}
 }
+
+$page_id = !empty($_SESSION['PAGE_ID']) ? $_SESSION['PAGE_ID'] : 0;
+$_SESSION['PAGE_LINK'] = get_page_link( $page_id );
+if(!file_exists($_SESSION['PAGE_LINK'])) {$_SESSION['PAGE_LINK'] = WB_URL.'/'; }
+$thisApp->redirect_url = $_SESSION['HTTP_REFERER'] = page_link($_SESSION['PAGE_LINK']);
+
 ?>
+<div style="margin: 1em auto;">
+	<button type="button" value="cancel" onClick="javascript: window.location = '<?php print $_SESSION['HTTP_REFERER'] ?>';"><?php print $TEXT['CANCEL'] ?></button>
+</div>
 <h1>&nbsp;Login</h1>
 &nbsp;<?php echo $thisApp->message; ?>
 <br />
@@ -43,7 +52,7 @@
 <form action="<?php echo WB_URL.'/account/login.php'; ?>" method="post">
 <p style="display:none;"><input type="hidden" name="username_fieldname" value="<?php echo $username_fieldname; ?>" /></p>
 <p style="display:none;"><input type="hidden" name="password_fieldname" value="<?php echo $password_fieldname; ?>" /></p>
-<p style="display:none;"><input type="hidden" name="url" value="<?php echo $thisApp->redirect_url;?>" /></p>
+<p style="display:none;"><input type="hidden" name="redirect" value="<?php echo $thisApp->redirect_url;?>" /></p>
 
 <table cellpadding="5" cellspacing="0" border="0" width="90%">
 <tr>
Index: branches/2.8.x/wb/account/preferences.php
===================================================================
--- branches/2.8.x/wb/account/preferences.php	(revision 1507)
+++ branches/2.8.x/wb/account/preferences.php	(revision 1508)
@@ -28,7 +28,7 @@
 	}
 }
 
-require_once(WB_PATH.'/framework/class.wb.php');
+require_once(WB_PATH.'/framework/class.frontend.php');
 $wb_inst = new wb();
 if ($wb_inst->is_authenticated()==false) {
 	header('Location: '.WB_URL.'/account/login.php');
@@ -35,29 +35,23 @@
 	exit(0);
 }
 
+$page_id = !empty($_SESSION['PAGE_ID']) ? $_SESSION['PAGE_ID'] : 0;
+
 // Required page details
-$page_id = 0;
+/* */
+// $page_id = 0;
 $page_description = '';
 $page_keywords = '';
-define('PAGE_ID', 0);
+define('PAGE_ID', $page_id);
 define('ROOT_PARENT', 0);
 define('PARENT', 0);
 define('LEVEL', 0);
+
 define('PAGE_TITLE', $MENU['PREFERENCES']);
 define('MENU_TITLE', $MENU['PREFERENCES']);
 define('MODULE', '');
 define('VISIBILITY', 'public');
 
-// Set the page content include file
-if(isset($_POST['current_password']) AND isset($_POST['new_password'])) {
-	define('PAGE_CONTENT', WB_PATH.'/account/password.php');
-} elseif(isset($_POST['current_password']) AND isset($_POST['email'])) {
-	define('PAGE_CONTENT', WB_PATH.'/account/email.php');
-} elseif(isset($_POST['display_name'])) {
-	define('PAGE_CONTENT', WB_PATH.'/account/details.php');
-} else {
-	define('PAGE_CONTENT', WB_PATH.'/account/preferences_form.php');
-}
-
+define('PAGE_CONTENT', WB_PATH.'/account/preferences_form.php');
 // Include the index (wrapper) file
 require(WB_PATH.'/index.php');
Index: branches/2.8.x/wb/account/password.php
===================================================================
--- branches/2.8.x/wb/account/password.php	(revision 1507)
+++ branches/2.8.x/wb/account/password.php	(revision 1508)
@@ -19,46 +19,33 @@
 // Must include code to stop this file being access directly
 if(defined('WB_PATH') == false) { die("Cannot access this file directly"); }
 
-// Get the values entered
-$current_password = $_POST['current_password'];
-$new_password = $_POST['new_password'];
-$new_password2 = $_POST['new_password2'];
-
-// Create a javascript back link
-$js_back = WB_URL.'/account/preferences.php';
-/*
-if (!$wb->checkFTAN())
-{
-	$wb->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'], $js_back, false);
-	exit();
-}
-*/
+// Get entered values
+	$current_password = $wb->get_post('current_password');
+	$new_password = $wb->get_post('new_password');
+	$new_password2 = $wb->get_post('new_password2');
 // Get existing password
-// $database = new database();
-$query = "SELECT user_id FROM ".TABLE_PREFIX."users WHERE user_id = '".$wb->get_user_id()."' AND password = '".md5($current_password)."'";
-$results = $database->query($query);
-
+	$sql = "SELECT `user_id` FROM `".TABLE_PREFIX."users` WHERE `user_id` = ".$wb->get_user_id()." AND `password` = '".md5($current_password)."'";
+	$rowset = $database->query($sql);
 // Validate values
-if($results->numRows() == 0) {
-	$wb->print_error($MESSAGE['PREFERENCES']['CURRENT_PASSWORD_INCORRECT'], $js_back, false);
-}
-
-if(strlen($new_password) < 3) {
-	$wb->print_error($MESSAGE['USERS']['PASSWORD_TOO_SHORT'], $js_back, false);
-}
-if($new_password != $new_password2) {
-	$wb->print_error($MESSAGE['USERS']['PASSWORD_MISMATCH'], $js_back, false);
-}
-
+	if($rowset->numRows() == 0) {
+		$error[] = $MESSAGE['PREFERENCES']['CURRENT_PASSWORD_INCORRECT'];
+	}else {
+		if(strlen($new_password) < 3) {
+			$error[] = $MESSAGE['USERS']['PASSWORD_TOO_SHORT'];
+		}else {
+			if($new_password != $new_password2) {
+				$error[] = $MESSAGE['USERS']['PASSWORD_MISMATCH'];
+			}else {
 // MD5 the password
-$md5_password = md5($new_password);
-
+				$md5_password = md5($new_password);
 // Update the database
-// $database = new database();
-$query = "UPDATE ".TABLE_PREFIX."users SET password = '$md5_password' WHERE user_id = '".$wb->get_user_id()."'";
-$database->query($query);
-if($database->is_error()) {
-	$wb->print_error($database->get_error, $js_back, false);
-} else {
-	$wb->print_success($MESSAGE['PREFERENCES']['PASSWORD_CHANGED']);
-}
+				$sql = "UPDATE `".TABLE_PREFIX."users` SET `password` = '".$md5_password."' WHERE `user_id` = ".$wb->get_user_id();
+				$database->query($sql);
+				if($database->is_error()) {
+					$error[] = $database->get_error();
+				} else {
+					$success[] = $MESSAGE['PREFERENCES']['PASSWORD_CHANGED'];
+				}
+			}
+		}
+	}
Index: branches/2.8.x/wb/account/signup.php
===================================================================
--- branches/2.8.x/wb/account/signup.php	(revision 1507)
+++ branches/2.8.x/wb/account/signup.php	(revision 1508)
@@ -46,12 +46,15 @@
 	$load_language = false;
 }
 
+require_once(WB_PATH.'/framework/class.frontend.php');
+$wb_inst = new wb();
+$page_id = !empty($_SESSION['PAGE_ID']) ? $_SESSION['PAGE_ID'] : 0;
 
 // Required page details
-$page_id = 0;
+// $page_id = 0;
 $page_description = '';
 $page_keywords = '';
-define('PAGE_ID', 0);
+define('PAGE_ID', $page_id);
 define('ROOT_PARENT', 0);
 define('PARENT', 0);
 define('LEVEL', 0);
@@ -72,5 +75,3 @@
 
 // Include the index (wrapper) file
 require(WB_PATH.'/index.php');
-
-?>
\ No newline at end of file
Index: branches/2.8.x/wb/account/login.php
===================================================================
--- branches/2.8.x/wb/account/login.php	(revision 1507)
+++ branches/2.8.x/wb/account/login.php	(revision 1508)
@@ -29,11 +29,15 @@
 	}
 }
 
+require_once(WB_PATH.'/framework/class.frontend.php');
+$wb_inst = new wb();
+$page_id = !empty($_SESSION['PAGE_ID']) ? $_SESSION['PAGE_ID'] : 0;
+
 // Required page details
-$page_id = 0;
+// $page_id = 0;
 $page_description = '';
 $page_keywords = '';
-define('PAGE_ID', 0);
+define('PAGE_ID', $page_id);
 define('ROOT_PARENT', 0);
 define('PARENT', 0);
 define('LEVEL', 0);
@@ -76,4 +80,3 @@
 
 // Include the index (wrapper) file
 require(WB_PATH.'/index.php');
-
Index: branches/2.8.x/wb/account/languages/EN.php
===================================================================
--- branches/2.8.x/wb/account/languages/EN.php	(nonexistent)
+++ branches/2.8.x/wb/account/languages/EN.php	(revision 1508)
@@ -0,0 +1,34 @@
+<?php
+/**
+  Module developed for the Open Source Content Management System Website Baker (http://websitebaker.org)
+  Copyright (C) 2008, ISTeam, Werner von der Decken
+  Contact me: wkl(at)isteam.de, http://isteam.de
+
+  This module is free software. You can redistribute it and/or modify it
+  under the terms of the GNU General Public License  - version 2 or later,
+  as published by the Free Software Foundation: http://www.gnu.org/licenses/gpl.html.
+
+  This module is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+ -----------------------------------------------------------------------------------------
+  ENGLISH LANGUAGE FILE FOR THE PREFERENCES MODULE
+ -----------------------------------------------------------------------------------------
+	UPDATE HISTORY:
+	Werner von der Decken; 17.05.2008
+	 + initial release of the English language file
+ -----------------------------------------------------------------------------------------
+**/
+// array for all language dependen text outputs in the front- and backend
+// Note: stick to the naming convention: $MOD_MODULE_DIRECTORY
+$MOD_PREFERENCE = array(
+	'PLEASE_SELECT' => 'please select',
+	'DETAILS_SAVED'	=> 'details successfully saved',
+	'SAVE_SETTINGS' => 'save details',
+	'SAVE_EMAIL'    => 'save email',
+	'SAVE_PASSWORD' => 'save password',
+);
+
+?>
\ No newline at end of file

Property changes on: branches/2.8.x/wb/account/languages/EN.php
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Date Revision Id HeadURL
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: branches/2.8.x/wb/account/languages/DE.php
===================================================================
--- branches/2.8.x/wb/account/languages/DE.php	(nonexistent)
+++ branches/2.8.x/wb/account/languages/DE.php	(revision 1508)
@@ -0,0 +1,34 @@
+<?php
+/**
+  Module developed for the Open Source Content Management System Website Baker (http://websitebaker.org)
+  Copyright (C) 2008, ISTeam, Werner von der Decken
+  Contact me: wkl(at)isteam.de, http://isteam.de
+
+  This module is free software. You can redistribute it and/or modify it
+  under the terms of the GNU General Public License  - version 2 or later,
+  as published by the Free Software Foundation: http://www.gnu.org/licenses/gpl.html.
+
+  This module is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+ -----------------------------------------------------------------------------------------
+  DEUTSCHE SPRACHDATEI FÜR DAS PREFERENCES MODUL
+ -----------------------------------------------------------------------------------------
+	UPDATE HISTORY:
+	Werner von der Decken; 17.05.2008
+	 + erstes release der Deutschen Sprachdatei
+ -----------------------------------------------------------------------------------------
+**/
+
+// Array für alle sprachabhängigen Textausgaben im Front- und Backend
+// Hinweis: Verwende nachfolgende Namenskonvention für die Sprachausgabe des Moduls: $MOD_MODULE_DIRECTORY
+$MOD_PREFERENCE = array(
+	'PLEASE_SELECT' => 'bitte w&auml;hlen',
+	'DETAILS_SAVED'	=> 'allgemeine Einstellungen ge&auml;ndert',
+	'SAVE_SETTINGS' => 'Einstellungen speichern',
+	'SAVE_EMAIL' => 'Email speichern',
+	'SAVE_PASSWORD' => 'Passwort speichern',
+);
+?>
\ No newline at end of file

Property changes on: branches/2.8.x/wb/account/languages/DE.php
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Date Revision Id HeadURL
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: branches/2.8.x/wb/account/languages
===================================================================
--- branches/2.8.x/wb/account/languages	(nonexistent)
+++ branches/2.8.x/wb/account/languages	(revision 1508)

Property changes on: branches/2.8.x/wb/account/languages
___________________________________________________________________
Added: bugtraq:number
## -0,0 +1 ##
+true
\ No newline at end of property
Index: branches/2.8.x/wb/account/preferences_form.php
===================================================================
--- branches/2.8.x/wb/account/preferences_form.php	(revision 1507)
+++ branches/2.8.x/wb/account/preferences_form.php	(revision 1508)
@@ -16,193 +16,187 @@
  *
  */
 
-// Must include code to stop this file being access directly
-if(defined('WB_PATH') == false) { die("Cannot access this file directly"); }
+// prevent this file from being accesses directly
+if(defined('WB_PATH') == false) {	exit("Cannot access this file directly"); }
 
-?>
+	if($wb->is_authenticated() === false) {
+// User needs to login first
+		header("Location: ".WB_URL."/account/login.php?redirect=".$wb->link);
+		exit(0);
+	}
 
-<h2>&nbsp;<?php print $HEADING['MY_SETTINGS']; ?></h2>
+$_SESSION['PAGE_LINK'] = get_page_link( $_SESSION['PAGE_ID'] );
+$_SESSION['HTTP_REFERER'] = page_link($_SESSION['PAGE_LINK']);
 
-<form name="user" action="<?php print WB_URL.'/account/preferences.php'; ?>" method="post" style="margin-bottom: 5px;">
-<input type="hidden" name="user_id" value="{USER_ID}" />
-<table cellpadding="5" cellspacing="0" border="0" width="97%">
-<tr>
-	<td width="140"><?php print $TEXT['DISPLAY_NAME']; ?>:</td>
-	<td class="value_input">
-		<input type="text" name="display_name" style="width: 380px;" maxlength="255" value="<?php print $wb->get_display_name(); ?>" />
-	</td>
-</tr>
-<tr>
-	<td><?php print $TEXT['LANGUAGE']; ?>:</td>
-	<td>
-		<select name="language" style="width: 380px;">
-		<?php
-		/**
-		 *
-		 *	Getting the languages from the database. (addons)
-		 *	It's a little bit corious, but the language-shortform is
-		 *	storred in the field "directory" ...
-		 *
-		 */
-		$query  = 'SELECT * FROM `'.TABLE_PREFIX.'addons` ';
-		$query .= 'WHERE `type` = \'language\' ORDER BY `directory`';
-		$result = $database->query($query);
-		if ($result) {
-			$options_html = "";
-			while($data = $result->fetchRow()) {
-				$sel = ($data['directory'] == LANGUAGE) ? " selected=\"selected\" " : "";
-				// $options_html .= "<option value=\"".$data['directory']."\" ".$sel.">".$data['name']." (".$data['directory'].")</option>\n";
-				$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";
-			}
-			echo $options_html;
-		}
-		?>
-		</select>
-	</td>
-</tr>
-<tr>
-	<td><?php print $TEXT['TIMEZONE']; ?>:</td>
-	<td>
-		<select name="timezone" style="width: 380px;">
-			<option value="-20"><?php print $TEXT['PLEASE_SELECT']; ?>...</option>
-			<?php
-				// Insert default timezone values
-				require_once(ADMIN_PATH.'/interface/timezones.php');
-				$test_time = $wb->get_timezone();
-				$options_html = "";
-				foreach($TIMEZONES as $hour_offset => $title) {
-					$sel = ($test_time == $hour_offset*60*60) ? " selected=\"selected\" " : ""; 
-					$options_html .= "<option value=\"".$hour_offset."\" ".$sel.">".$title."</option>\n";
-				}
-				print $options_html;
-?>
+// load module default language file (EN)
+	require_once(WB_PATH .'/account/languages/EN.php');
+// check for user defined language file, load it and override EN-Settings with
+	if(file_exists(WB_PATH .'/account/languages/' .LANGUAGE .'.php')) {
+		require_once(WB_PATH .'/account/languages/' .LANGUAGE .'.php');
+	}
+	require_once(WB_PATH.'/framework/functions-utf8.php');
+	echo '<style type="text/css">';
+	include(WB_PATH .'/account/frontend.css');
+	echo "\n</style>\n";
+	$user_time = true;
+	require(ADMIN_PATH.'/interface/timezones.php');
+	require(ADMIN_PATH.'/interface/date_formats.php');
+	require(ADMIN_PATH.'/interface/time_formats.php');
+	$error = array();
+	$success = array();
+	$template = new Template(WB_PATH .'/account','remove');
 
-		</select>
-	</td>
-</tr>
-<tr>
-	<td><?php print $TEXT['DATE_FORMAT']; ?>:</td>
-	<td>
-		<select name="date_format" style="width: 98%;">
-			<option value=""><?php print $TEXT['PLEASE_SELECT']; ?>...</option>
-			<?php
-			// Insert date format list
-			$user_time = true;
-			require_once(ADMIN_PATH.'/interface/date_formats.php');
-			foreach($DATE_FORMATS AS $format => $title) {
-				$format = str_replace('|', ' ', $format); // Add's white-spaces (not able to be stored in array key)
-				if($format != 'system_default') {
-					$value = $format;
-				} else {
-					$value = '';
-				}
-				if(DATE_FORMAT == $format AND !isset($_SESSION['USE_DEFAULT_DATE_FORMAT'])) {
-					$selected = ' selected="selected"';
-				} elseif($format == 'system_default' AND isset($_SESSION['USE_DEFAULT_DATE_FORMAT'])) {
-					$selected = ' selected="selected"';
-				} else {
-					$selected = '';
-				}
-				print '<option value="'.$value.'"'.$selected.'>'.$title.'</option>'."\n";
-			}
-			?>
-		</select>
-	</td>
-</tr>
-<tr>
-	<td><?php print $TEXT['TIME_FORMAT']; ?>:</td>
-	<td>
-		<select name="time_format" style="width: 98%;">
-			<option value=""><?php print $TEXT['PLEASE_SELECT']; ?>...</option>
-			<?php
-			// Insert time format list
-			$user_time = true;
-			require_once(ADMIN_PATH.'/interface/time_formats.php');
-			foreach($TIME_FORMATS AS $format => $title)
-            {
-				$format = str_replace('|', ' ', $format); // Add's white-spaces (not able to be stored in array key)
-                $value = ($format != 'system_default') ? $format : '';
+	switch($wb->get_post('action')):
+		case 'details':
+			require_once(WB_PATH .'/account/details.php');
+			break;
+		case 'email':
+			require_once(WB_PATH .'/account/email.php');
 
-                $selected = ((TIME_FORMAT == $format AND ! isset($_SESSION['USE_DEFAULT_TIME_FORMAT']))
-                    OR ($format == 'system_default' AND isset($_SESSION['USE_DEFAULT_TIME_FORMAT'])))
-                	? ' selected="selected"' : '';
+			break;
+		case 'password':
+			require_once(WB_PATH .'/account/password.php');
+			break;
+		default:
+			// do nothing
+	endswitch; // switch
 
-				print '<option value="'.$value.'"'.$selected.'>'.$title.'</option>';
+// show template
+	$template->set_file('page', 'template.html');
+	$template->set_block('page', 'main_block', 'main');
+// get existing values from database
+	$sql = "SELECT display_name,email FROM ".TABLE_PREFIX."users WHERE user_id = '".$wb->get_user_id()."'";
+	$rowset = $database->query($sql);
+	if($database->is_error()) $error[] = $database->get_error();
+	$row = $rowset->fetchRow();
+// insert values into form
+	$template->set_var('DISPLAY_NAME', $row['display_name']);
+	$template->set_var('EMAIL', $row['email']);
+
+// Insert language values
+	$template->set_block('main_block', 'language_list_block', 'language_list');
+	$sql = "SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'language' order by name";
+	$rowset = $database->query($sql);
+	if($rowset->numRows() > 0) {
+		while($row = $rowset->fetchRow()) {
+			$l_codes[$row['name']] = $row['directory'];
+			$l_names[$row['name']] = entities_to_7bit($row['name']); // sorting-problem workaround
+		}
+		asort($l_names);
+		foreach($l_names as $l_name=>$v) {
+			// Insert code and name
+			$template->set_var(array( 'CODE' => $l_codes[$l_name], 'NAME' => $l_name ));
+		// Check if it is selected
+			if(LANGUAGE == $l_codes[$l_name]) {
+				$template->set_var('SELECTED', ' selected="selected"');
+			} else {
+				$template->set_var('SELECTED', '');
 			}
-			?>
-		</select>
-	</td>
-</tr>
-<tr>
-	<td>&nbsp;</td>
-	<td>
-		<input type="submit" name="submit" value="<?php print $TEXT['SAVE']; ?>" />
-		<input type="reset" name="reset" value="<?php print $TEXT['RESET']; ?>" />
-	</td>
-</tr>
-</table>
+			$template->parse('language_list', 'language_list_block', true);
+		}
+	}
 
-</form>
+// Insert default timezone values
+	$template->set_block('main_block', 'timezone_list_block', 'timezone_list');
+	foreach($TIMEZONES AS $hour_offset => $title) {
+		$template->set_var('VALUE', $hour_offset);
+		$template->set_var('NAME', $title);
+		if($wb->get_timezone() == $hour_offset*3600) {
+			$template->set_var('SELECTED', 'selected="selected"');
+		} else {
+			$template->set_var('SELECTED', '');
+		}
+		$template->parse('timezone_list', 'timezone_list_block', true);
+	}
 
-<h2>&nbsp;<?php print $HEADING['MY_EMAIL']; ?></h2>
+// Insert date format list
+	$template->set_block('main_block', 'date_format_list_block', 'date_format_list');
+	foreach($DATE_FORMATS AS $format => $title) {
+		$format = str_replace('|', ' ', $format); // Add's white-spaces (not able to be stored in array key)
+		if($format != 'system_default') {
+			$template->set_var('VALUE', $format);
+		} else {
+			$template->set_var('VALUE', '');
+		}
+		$template->set_var('NAME', $title);
+		if(DATE_FORMAT == $format AND !isset($_SESSION['USE_DEFAULT_DATE_FORMAT'])) {
+			$template->set_var('SELECTED', 'selected="selected"');
+		} elseif($format == 'system_default' AND isset($_SESSION['USE_DEFAULT_DATE_FORMAT'])) {
+			$template->set_var('SELECTED', 'selected="selected"');
+		} else {
+			$template->set_var('SELECTED', '');
+		}
+		$template->parse('date_format_list', 'date_format_list_block', true);
+	}
 
-<form name="email" action="<?php print WB_URL.'/account/preferences.php'; ?>" method="post" style="margin-bottom: 5px;">
-<input type="hidden" name="user_id" value="{USER_ID}" />
-<table cellpadding="5" cellspacing="0" border="0" width="97%">
-<tr>
-	<td width="140"><?php print $TEXT['CURRENT_PASSWORD']; ?>:</td>
-	<td>
-		<input type="password" name="current_password" style="width: 380px;" />
-	</td>
-</tr>
-<tr>
-	<td><?php print $TEXT['EMAIL']; ?>:</td>
-	<td class="value_input">
-		<input type="text" name="email" style="width: 380px;" maxlength="255" value="<?php print $wb->get_email(); ?>" />
-	</td>
-</tr>
-<tr>
-	<td>&nbsp;</td>
-	<td>
-		<input type="submit" name="submit" value="<?php print $TEXT['SAVE']; ?>" />
-		<input type="reset" name="reset" value="<?php print $TEXT['RESET']; ?>" />
-	</td>
-</tr>
-</table>
+// Insert time format list
+	$template->set_block('main_block', 'time_format_list_block', 'time_format_list');
+	foreach($TIME_FORMATS AS $format => $title) {
+		$format = str_replace('|', ' ', $format); // Add's white-spaces (not able to be stored in array key)
+		if($format != 'system_default') {
+			$template->set_var('VALUE', $format);
+		} else {
+			$template->set_var('VALUE', '');
+		}
+		$template->set_var('NAME', $title);
+		if(TIME_FORMAT == $format AND !isset($_SESSION['USE_DEFAULT_TIME_FORMAT'])) {
+			$template->set_var('SELECTED', 'selected="selected"');
+		} elseif($format == 'system_default' AND isset($_SESSION['USE_DEFAULT_TIME_FORMAT'])) {
+			$template->set_var('SELECTED', 'selected="selected"');
+		} else {
+			$template->set_var('SELECTED', '');
+		}
+		$template->parse('time_format_list', 'time_format_list_block', true);
+	}
+// Insert language headings
+	$template->set_var(array(
+								'HEADING_MY_SETTINGS' => $HEADING['MY_SETTINGS'],
+								'HEADING_MY_EMAIL'    => $HEADING['MY_EMAIL'],
+								'HEADING_MY_PASSWORD' => $HEADING['MY_PASSWORD']
+								)
+						);
+// Insert language text and messages
+	$template->set_var(array(
+								'HTTP_REFERER' => $_SESSION['HTTP_REFERER'],
+								'TEXT_SAVE'	=> $TEXT['SAVE'],
+								'TEXT_RESET' => $TEXT['RESET'],
+								'TEXT_CANCEL' => $TEXT['CANCEL'],
+								'TEXT_DISPLAY_NAME'	=> $TEXT['DISPLAY_NAME'],
+								'TEXT_EMAIL' => $TEXT['EMAIL'],
+								'TEXT_LANGUAGE' => $TEXT['LANGUAGE'],
+								'TEXT_TIMEZONE' => $TEXT['TIMEZONE'],
+								'TEXT_DATE_FORMAT' => $TEXT['DATE_FORMAT'],
+								'TEXT_TIME_FORMAT' => $TEXT['TIME_FORMAT'],
+								'TEXT_CURRENT_PASSWORD' => $TEXT['CURRENT_PASSWORD'],
+								'TEXT_NEW_PASSWORD' => $TEXT['NEW_PASSWORD'],
+								'TEXT_RETYPE_NEW_PASSWORD' => $TEXT['RETYPE_NEW_PASSWORD']
+								)
+						);
 
-</form>
+// Insert module releated language text and messages
+	$template->set_var(array(
+								'MOD_PREFERENCE_PLEASE_SELECT'	=> $MOD_PREFERENCE['PLEASE_SELECT'],
+								'MOD_PREFERENCE_SAVE_SETTINGS'	=> $MOD_PREFERENCE['SAVE_SETTINGS'],
+								'MOD_PREFERENCE_SAVE_EMAIL'			=> $MOD_PREFERENCE['SAVE_EMAIL'],
+								'MOD_PREFERENCE_SAVE_PASSWORD'	=> $MOD_PREFERENCE['SAVE_PASSWORD'],
+								)
+						);
+// Insert error and/or success messages
+	$template->set_block('main_block', 'error_block', 'error_list');
+	if(sizeof($error)>0){
+		foreach($error AS $value){
+			$template->set_var('ERROR_VALUE', $value);
+			$template->parse('error_list', 'error_block', true);
+		}
+	}
 
-
-<h2>&nbsp;<?php print $HEADING['MY_PASSWORD']; ?></h2>
-
-<form name="user" action="<?php print WB_URL.'/account/preferences.php'; ?>" method="post">
-<input type="hidden" name="user_id" value="{USER_ID}" />
-<table cellpadding="5" cellspacing="0" border="0" width="97%">
-<tr>
-	<td width="140"><?php print $TEXT['CURRENT_PASSWORD']; ?>:</td>
-	<td>
-		<input type="password" name="current_password" style="width: 380px;" />
-	</td>
-</tr>
-<tr>
-	<td><?php print $TEXT['NEW_PASSWORD']; ?>:</td>
-	<td>
-		<input type="password" name="new_password" style="width: 380px;" />
-	</td>
-</tr>
-<tr>
-	<td><?php print $TEXT['RETYPE_NEW_PASSWORD']; ?>:</td>
-	<td>
-		<input type="password" name="new_password2" style="width: 380px;" />
-	</td>
-</tr>
-<tr>
-	<td>&nbsp;</td>
-	<td>
-		<input type="submit" name="submit" value="<?php print $TEXT['SAVE']; ?>" />
-		<input type="reset" name="reset" value="<?php print $TEXT['RESET']; ?>" />
-	</td>
-</tr>
-</table>
-
-</form>
\ No newline at end of file
+	$template->set_block('main_block', 'success_block', 'success_list');
+	if(sizeof($success)!=0){
+		foreach($success AS $value){
+			$template->set_var('SUCCESS_VALUE', $value);
+			$template->parse('success_list', 'success_block', true);
+		}
+	}
+// Parse template for preferences form
+	$template->parse('main', 'main_block', false);
+	$template->pparse('output', 'page');
Index: branches/2.8.x/wb/account/signup2.php
===================================================================
--- branches/2.8.x/wb/account/signup2.php	(revision 1507)
+++ branches/2.8.x/wb/account/signup2.php	(revision 1508)
@@ -19,9 +19,12 @@
 // Must include code to stop this file being access directly
 if(defined('WB_PATH') == false) { die("Cannot access this file directly"); }
 
-require_once(WB_PATH.'/framework/class.wb.php');
+// require_once(WB_PATH.'/framework/class.wb.php');
 $wb = new wb('Start', 'start', false, false);
 
+$_SESSION['PAGE_LINK'] = get_page_link( $_SESSION['PAGE_ID'] );
+$_SESSION['HTTP_REFERER'] = page_link($_SESSION['PAGE_LINK']);
+
 // Create new database object
 // $database = new database();
 
Index: branches/2.8.x/wb/account/signup_form.php
===================================================================
--- branches/2.8.x/wb/account/signup_form.php	(revision 1507)
+++ branches/2.8.x/wb/account/signup_form.php	(revision 1508)
@@ -21,8 +21,13 @@
 
 require_once(WB_PATH.'/include/captcha/captcha.php');
 
+$_SESSION['PAGE_LINK'] = get_page_link( $_SESSION['PAGE_ID'] );
+$_SESSION['HTTP_REFERER'] = page_link($_SESSION['PAGE_LINK']);
+
 ?>
-
+<div style="margin: 1em auto;">
+	<button type="button" value="cancel" onClick="javascript: window.location = '<?php print $_SESSION['HTTP_REFERER'] ?>';"><?php print $TEXT['CANCEL'] ?></button>
+</div>
 <h1>&nbsp;<?php echo $TEXT['SIGNUP']; ?></h1>
 
 <form name="user" action="<?php echo WB_URL.'/account/signup.php'; ?>" method="post">
Index: branches/2.8.x/wb/account/template.html
===================================================================
--- branches/2.8.x/wb/account/template.html	(nonexistent)
+++ branches/2.8.x/wb/account/template.html	(revision 1508)
@@ -0,0 +1,138 @@
+<!-- begin settings_modify.html -->
+<!-- BEGIN main_block -->
+<!-- BEGIN success_block -->
+<p class="mod_preferences_success">
+	{SUCCESS_VALUE}
+</p>
+<!-- END success_block -->
+<!-- BEGIN error_block -->
+<p class="mod_preferences_error">
+	{ERROR_VALUE}
+</p>
+<!-- END error_block -->
+<div style="margin: 1em auto;">
+	<button type="button" value="cancel" onClick="javascript: window.location = '{HTTP_REFERER}';">{TEXT_CANCEL}</button>
+</div>
+<hr />
+<form name="details" action="" method="post">
+	<h3>{HEADING_MY_SETTINGS}</h3>
+	<table cellpadding="5" cellspacing="0" border="0" width="100%">
+		<tr>
+			<td width="160">{TEXT_DISPLAY_NAME}:</td>
+			<td>
+				<input type="text" name="display_name" value="{DISPLAY_NAME}" style="width: 98%;" readonly="readonly" />
+			</td>
+		</tr>
+		<tr>
+			<td>{TEXT_LANGUAGE}:</td>
+			<td>
+				<select name="language" style="width: 98%;">
+<!-- BEGIN language_list_block -->
+					<option value="{CODE}"{SELECTED}>{NAME} ({CODE})</option>
+<!-- END language_list_block -->
+				</select>
+			</td>
+		</tr>
+		<tr>
+			<td>{TEXT_TIMEZONE}:</td>
+			<td>
+				<select name="timezone" style="width: 98%;">
+					<option value="-20">{MOD_PREFERENCE_PLEASE_SELECT}</option>
+<!-- BEGIN timezone_list_block -->
+					<option value="{VALUE}" {SELECTED}>{NAME}</option>
+<!-- END timezone_list_block -->
+				</select>
+			</td>
+		</tr>
+		<tr>
+			<td>{TEXT_DATE_FORMAT}:</td>
+			<td>
+				<select name="date_format" style="width: 98%;">
+					<option value="">{MOD_PREFERENCE_PLEASE_SELECT}</option>
+<!-- BEGIN date_format_list_block -->
+					<option value="{VALUE}" {SELECTED}>{NAME}</option>
+<!-- END date_format_list_block -->
+				</select>
+			</td>
+		</tr>
+		<tr>
+			<td>{TEXT_TIME_FORMAT}:</td>
+			<td>
+				<select name="time_format" style="width: 98%;">
+					<option value="">{MOD_PREFERENCE_PLEASE_SELECT}</option>
+<!-- BEGIN time_format_list_block -->
+					<option value="{VALUE}" {SELECTED}>{NAME}</option>
+<!-- END time_format_list_block -->
+				</select>
+			</td>
+		</tr>
+		<tr>
+			<td>&nbsp;</td>
+			<td>
+				<button type="reset" name="reset" value="reset">{TEXT_RESET}</button>
+				<button type="submit" name="action" value="details">{MOD_PREFERENCE_SAVE_SETTINGS}</button>
+			</td>
+		</tr>
+	</table>
+</form>
+<hr />
+<form name="email" action="" method="post">
+	<h3>{HEADING_MY_EMAIL}</h3>
+	<table cellpadding="5" cellspacing="0" border="0" width="100%">
+		<tr>
+			<td>{TEXT_EMAIL}:</td>
+			<td>
+				<input type="text" name="email" value="{EMAIL}" style="width: 98%;" />
+			</td>
+		</tr>
+		<tr>
+			<td width="160">{TEXT_CURRENT_PASSWORD}:</td>
+			<td>
+				<input type="password" name="current_password" style="width: 98%;" />
+			</td>
+		</tr>
+		<tr>
+			<td>&nbsp;</td>
+			<td>
+				<button type="reset" name="reset" value="reset">{TEXT_RESET}</button>
+				<button type="submit" name="action" value="email">{MOD_PREFERENCE_SAVE_EMAIL}</button>
+			</td>
+		</tr>
+	</table>
+</form>
+<hr />
+<form name="password" action="" method="post">
+	<h3>{HEADING_MY_PASSWORD}</h3>
+	<table cellpadding="5" cellspacing="0" border="0" width="100%">
+		<tr>
+			<td width="160">{TEXT_CURRENT_PASSWORD}:</td>
+			<td>
+				<input type="password" name="current_password" style="width: 98%;" />
+			</td>
+		</tr>
+		<tr>
+			<td width="160">{TEXT_NEW_PASSWORD}:</td>
+			<td>
+				<input type="password" name="new_password" style="width: 98%;" />
+			</td>
+		</tr>
+		<tr>
+			<td width="160">{TEXT_RETYPE_NEW_PASSWORD}:</td>
+			<td>
+				<input type="password" name="new_password2" style="width: 98%;" />
+			</td>
+		</tr>
+		<tr>
+			<td>&nbsp;</td>
+			<td>
+				<button type="reset" name="reset" value="reset">{TEXT_RESET}</button>
+				<button type="submit" name="action" value="password">{MOD_PREFERENCE_SAVE_PASSWORD}</button>
+			</td>
+		</tr>
+	</table>
+</form>
+<div style="margin: 1em auto;">
+	<button type="button" value="cancel" onClick="javascript: window.location = '{HTTP_REFERER}';">{TEXT_CANCEL}</button>
+</div>
+<!-- END main_block -->
+<!-- end settings_modify.html -->

Property changes on: branches/2.8.x/wb/account/template.html
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Date Revision
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/html
\ No newline at end of property
