Project

General

Profile

« Previous | Next » 

Revision 1315

Added by Dietmar over 14 years ago

fix ticket #975 some weird /pages/ header infos

View differences:

index.php
9 9
 * @link			http://www.websitebaker2.org/
10 10
 * @license         http://www.gnu.org/licenses/gpl.html
11 11
 * @platform        WebsiteBaker 2.8.x
12
 * @requirements    PHP 4.4.9 and higher
12
 * @requirements    PHP 4.4.9 && higher
13 13
 * @version         $Id$
14 14
 * @filesource		$HeadURL$
15 15
 * @lastmodified    $Date$
......
23 23
// put all inside a function to prevent global vars
24 24
function build_page( &$admin, &$database )
25 25
{
26
	global $HEADING, $TEXT;
26 27
	include_once(WB_PATH.'/framework/functions-utf8.php');
27 28
// Create new template object, assign template file, start main-block
28 29
	$template = new Template( THEME_PATH.'/templates' );
29 30
	$template->set_file( 'page', 'preferences.htt' );
30 31
	$template->set_block( 'page', 'main_block', 'main' );
31
// read user-info from table users and assign it to template
32
// read user-info from table users && assign it to template
32 33
	$sql  = 'SELECT `display_name`, `username`, `email` FROM `'.TABLE_PREFIX.'users` ';
33 34
	$sql .= 'WHERE `user_id` = '.(int)$admin->get_user_id();
34 35
	if( $res_user = $database->query($sql) )
......
41 42
			$template->set_var('ADMIN_URL',    ADMIN_URL);
42 43
		}
43 44
	}
44
// read available languages from table addons and assign it to the template
45
// read available languages from table addons && assign it to the template
45 46
	$sql  = 'SELECT * FROM `'.TABLE_PREFIX.'addons` ';
46 47
	$sql .= 'WHERE `type` = "language" ORDER BY `directory`';
47 48
	if( $res_lang = $database->query($sql) )
......
75 76
		$format = str_replace('|', ' ', $format); // Add's white-spaces (not able to be stored in array key)
76 77
		$template->set_var( 'VALUE', ($format != 'system_default' ? $format : 'system_default') );
77 78
		$template->set_var( 'NAME',  $title );
78
		if( (DATE_FORMAT == $format AND !isset($_SESSION['USE_DEFAULT_DATE_FORMAT'])) OR
79
			('system_default' == $format AND isset($_SESSION['USE_DEFAULT_DATE_FORMAT'])) )
79
		if( (DATE_FORMAT == $format && !isset($_SESSION['USE_DEFAULT_DATE_FORMAT'])) ||
80
			('system_default' == $format && isset($_SESSION['USE_DEFAULT_DATE_FORMAT'])) )
80 81
		{
81 82
			$template->set_var('SELECTED', ' selected="selected"');
82 83
		}else {
......
90 91
	foreach( $TIME_FORMATS AS $format => $title )
91 92
	{
92 93
		$format = str_replace('|', ' ', $format); // Add's white-spaces (not able to be stored in array key)
93
		$template->set_var('VALUE', $format != 'system_default' ? $format : '' );
94
		$template->set_var('VALUE', $format != 'system_default' ? $format : 'system_default' );
94 95
		$template->set_var('NAME',  $title);
95
		if( (TIME_FORMAT == $format AND !isset($_SESSION['USE_DEFAULT_TIME_FORMAT'])) OR
96
		    ('system_default' == $format AND isset($_SESSION['USE_DEFAULT_TIME_FORMAT'])) )
96
		if( (TIME_FORMAT == $format && !isset($_SESSION['USE_DEFAULT_TIME_FORMAT'])) ||
97
		    ('system_default' == $format && isset($_SESSION['USE_DEFAULT_TIME_FORMAT'])) )
97 98
		{
98 99
			$template->set_var('SELECTED', ' selected="selected"');
99 100
		} else {
......
113 114
	$template->set_var('FTAN', $admin->getFTAN());
114 115
	$template->set_var('FORM_NAME', 'preferences_save');
115 116
// assign language vars
116
	global $HEADING, $TEXT;
117 117
	$template->set_var(array( 'HEADING_MY_SETTINGS'      => $HEADING['MY_SETTINGS'],
118 118
                              'HEADING_MY_EMAIL'         => $HEADING['MY_EMAIL'],
119 119
                              'HEADING_MY_PASSWORD'      => $HEADING['MY_PASSWORD'],

Also available in: Unified diff