Project

General

Profile

« Previous | Next » 

Revision 1335

Added by Dietmar over 14 years ago

Fixed update search settings
Fixed bug in /modules/admin.php

View differences:

branches/2.8.x/CHANGELOG
11 11
! = Update/Change
12 12

  
13 13
------------------------------------- 2.8.1 -------------------------------------
14
27-Apr-2010 Dietmar Woellbrink (Luisehahne)
15
#	Fixed update search settings
16
#	Fixed bug in /modules/admin.php 
14 17
22-Apr-2010 Dietmar Woellbrink (Luisehahne)
15 18
#	Fixed bug in /modules/admin.php 
16 19
22-Apr-2010 Dietmar Woellbrink (Luisehahne)
branches/2.8.x/wb/admin/interface/version.php
52 52

  
53 53
// check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled)
54 54
if(!defined('VERSION')) define('VERSION', '2.8.x');
55
if(!defined('REVISION')) define('REVISION', '1334');
55
if(!defined('REVISION')) define('REVISION', '1335');
56 56

  
57 57
?>
branches/2.8.x/wb/admin/settings/save.php
20 20
if(!isset($_POST['default_language']) || $_POST['default_language'] == '') die(header('Location: index.php'));
21 21

  
22 22
// Find out if the user was view advanced options or not
23
if($_POST['advanced'] == 'yes' ? $advanced = '?advanced=yes' : $advanced = '');
23
$advanced = ($_POST['advanced'] == 'yes') ? '?advanced=yes' : '';
24 24

  
25 25
// Print admin header
26 26
require('../../config.php');
27 27
require_once(WB_PATH.'/framework/class.admin.php');
28

  
28 29
if($advanced == '')
29 30
{
30 31
	$admin = new admin('Settings', 'settings_basic');
......
53 54
if($advanced == '')
54 55
{
55 56
	// Check if should be set to 777 or left alone
56
	if(isset($_POST['world_writeable']) AND $_POST['world_writeable'] == 'true')
57
	if(isset($_POST['world_writeable']) && $_POST['world_writeable'] == 'true')
57 58
    {
58 59
		$file_mode = '0777';
59 60
		$dir_mode = '0777';
......
64 65
} else {
65 66
	// Work-out the octal value for file mode
66 67
	$u = 0;
67
	if(isset($_POST['file_u_r']) AND $_POST['file_u_r'] == 'true') {
68
	if(isset($_POST['file_u_r']) && $_POST['file_u_r'] == 'true') {
68 69
		$u = $u+4;
69 70
	}
70
	if(isset($_POST['file_u_w']) AND $_POST['file_u_w'] == 'true') {
71
	if(isset($_POST['file_u_w']) && $_POST['file_u_w'] == 'true') {
71 72
		$u = $u+2;
72 73
	}
73
	if(isset($_POST['file_u_e']) AND $_POST['file_u_e'] == 'true') {
74
	if(isset($_POST['file_u_e']) && $_POST['file_u_e'] == 'true') {
74 75
		$u = $u+1;
75 76
	}
76 77
	$g = 0;
77
	if(isset($_POST['file_g_r']) AND $_POST['file_g_r'] == 'true') {
78
	if(isset($_POST['file_g_r']) && $_POST['file_g_r'] == 'true') {
78 79
		$g = $g+4;
79 80
	}
80
	if(isset($_POST['file_g_w']) AND $_POST['file_g_w'] == 'true') {
81
	if(isset($_POST['file_g_w']) && $_POST['file_g_w'] == 'true') {
81 82
		$g = $g+2;
82 83
	}
83
	if(isset($_POST['file_g_e']) AND $_POST['file_g_e'] == 'true') {
84
	if(isset($_POST['file_g_e']) && $_POST['file_g_e'] == 'true') {
84 85
		$g = $g+1;
85 86
	}
86 87
	$o = 0;
87
	if(isset($_POST['file_o_r']) AND $_POST['file_o_r'] == 'true') {
88
	if(isset($_POST['file_o_r']) && $_POST['file_o_r'] == 'true') {
88 89
		$o = $o+4;
89 90
	}
90
	if(isset($_POST['file_o_w']) AND $_POST['file_o_w'] == 'true') {
91
	if(isset($_POST['file_o_w']) && $_POST['file_o_w'] == 'true') {
91 92
		$o = $o+2;
92 93
	}
93
	if(isset($_POST['file_o_e']) AND $_POST['file_o_e'] == 'true') {
94
	if(isset($_POST['file_o_e']) && $_POST['file_o_e'] == 'true') {
94 95
		$o = $o+1;
95 96
	}
96 97
	$file_mode = "0".$u.$g.$o;
97 98
	// Work-out the octal value for dir mode
98 99
	$u = 0;
99
	if(isset($_POST['dir_u_r']) AND $_POST['dir_u_r'] == 'true') {
100
	if(isset($_POST['dir_u_r']) && $_POST['dir_u_r'] == 'true') {
100 101
		$u = $u+4;
101 102
	}
102
	if(isset($_POST['dir_u_w']) AND $_POST['dir_u_w'] == 'true') {
103
	if(isset($_POST['dir_u_w']) && $_POST['dir_u_w'] == 'true') {
103 104
		$u = $u+2;
104 105
	}
105
	if(isset($_POST['dir_u_e']) AND $_POST['dir_u_e'] == 'true') {
106
	if(isset($_POST['dir_u_e']) && $_POST['dir_u_e'] == 'true') {
106 107
		$u = $u+1;
107 108
	}
108 109
	$g = 0;
109
	if(isset($_POST['dir_g_r']) AND $_POST['dir_g_r'] == 'true') {
110
	if(isset($_POST['dir_g_r']) && $_POST['dir_g_r'] == 'true') {
110 111
		$g = $g+4;
111 112
	}
112
	if(isset($_POST['dir_g_w']) AND $_POST['dir_g_w'] == 'true') {
113
	if(isset($_POST['dir_g_w']) && $_POST['dir_g_w'] == 'true') {
113 114
		$g = $g+2;
114 115
	}
115
	if(isset($_POST['dir_g_e']) AND $_POST['dir_g_e'] == 'true') {
116
	if(isset($_POST['dir_g_e']) && $_POST['dir_g_e'] == 'true') {
116 117
		$g = $g+1;
117 118
	}
118 119
	$o = 0;
119
	if(isset($_POST['dir_o_r']) AND $_POST['dir_o_r'] == 'true') {
120
	if(isset($_POST['dir_o_r']) && $_POST['dir_o_r'] == 'true') {
120 121
		$o = $o+4;
121 122
	}
122
	if(isset($_POST['dir_o_w']) AND $_POST['dir_o_w'] == 'true') {
123
	if(isset($_POST['dir_o_w']) && $_POST['dir_o_w'] == 'true') {
123 124
		$o = $o+2;
124 125
	}
125
	if(isset($_POST['dir_o_e']) AND $_POST['dir_o_e'] == 'true') {
126
	if(isset($_POST['dir_o_e']) && $_POST['dir_o_e'] == 'true') {
126 127
		$o = $o+1;
127 128
	}
128 129
	$dir_mode = "0".$u.$g.$o;
......
138 139
{
139 140
	$setting_name = $setting['name'];
140 141
	$value = $admin->get_post($setting_name);
141
	if ($setting_name!='wb_version')
142
    {
143
		$allow_tags_in_fields = array('website_header', 'website_footer','wbmailer_smtp_password');
144
		if(!in_array($setting_name, $allow_tags_in_fields)) {
145
			$value = strip_tags($value);
142
    if(isset($value))
143
	{
144
		if ($setting_name!='wb_version')
145
	    {
146
			$allow_tags_in_fields = array('website_header', 'website_footer','wbmailer_smtp_password');
147
			if(!in_array($setting_name, $allow_tags_in_fields)) {
148
				$value = strip_tags($value);
149
			}
150
			switch ($setting_name) {
151
				case 'default_timezone':
152
					$value=$value*60*60;
153
					break;
154
				case 'string_dir_mode':
155
					$value=$dir_mode;
156
					break;
157
				case 'string_file_mode':
158
					$value=$file_mode;
159
					break;
160
				case 'pages_directory':
161
					if(trim($value)=='/') $value='';
162
					break;
163
			}
164
			$value = $admin->add_slashes($value);
165
			$database->query("UPDATE ".TABLE_PREFIX."settings SET value = '$value' WHERE name = '$setting_name'");
146 166
		}
147
		switch ($setting_name) {
148
			case 'default_timezone':
149
				$value=$value*60*60;
150
				break;
151
			case 'string_dir_mode':
152
				$value=$dir_mode;
153
				break;
154
			case 'string_file_mode':
155
				$value=$file_mode;
156
				break;
157
			case 'pages_directory':
158
				if(trim($value)=='/') $value='';
159
				break;
160
		}
161
		$value = $admin->add_slashes($value);
162
		$database->query("UPDATE ".TABLE_PREFIX."settings SET value = '$value' WHERE name = '$setting_name'");
163 167
	}
164 168
}
165 169

  
166 170
// Query current search settings in the db, then loop through them and update the db with the new value
167
$query = "SELECT name, value FROM ".TABLE_PREFIX."search WHERE extra = ''";
168
$results = $database->query($query);
169
while($search_setting = $results->fetchRow())
171
$sql  = 'SELECT `name`, `value` FROM `'.TABLE_PREFIX.'search` ';
172
$sql .= 'WHERE `extra` = ""';
173
$res_search = $database->query($sql);
174

  
175
if($database->is_error()) {
176
	$admin->print_error($database->is_error(), ADMIN_URL.'/settings/index.php'.$advanced);
177
}
178

  
179
while($search_setting = $res_search->fetchRow())
170 180
{
171 181
	$old_value = $search_setting['value'];
172 182
	$setting_name = $search_setting['name'];
173 183
	$post_name = 'search_'.$search_setting['name'];
184

  
174 185
    // hold old value if post is empty
175 186
    // check search template
176
    $value = ( ($admin->get_post($post_name) == '') AND ($setting_name != 'template') ) ? $old_value : $admin->get_post($post_name);
177

  
178
	$value = $admin->add_slashes($value);
179
	$database->query("UPDATE ".TABLE_PREFIX."search SET value = '$value' WHERE name = '$setting_name'");
187
    $value = ( ($admin->get_post($post_name) == '') && ($setting_name != 'template') ) ? $old_value : $admin->get_post($post_name);
188
    // $value =  ( ($admin->get_post($post_name) == '') && ($setting_name == 'template') ) ? DEFAULT_TEMPLATE : $admin->get_post($post_name);
189
    if(isset($value))
190
	{
191
		$value = $admin->add_slashes($value);
192
        $sql  = 'UPDATE `'.TABLE_PREFIX.'search` ';
193
        $sql .= 'SET `value` = "'.$value.'" ';
194
        $sql .= 'WHERE `name` = "'.$setting_name.'" ';
195
        $sql .= 'AND `extra` = ""';
196
		if($database->query($sql)) {
197
			$sql_info = mysql_info($database->db_handle);
198
		}
199
		if($database->is_error()) {
200
			$admin->print_error($database->get_error, ADMIN_URL.'/settings/index.php'.$advanced);
201
		}
202
    }
180 203
}
181 204

  
182 205
// Check if there was an error updating the db
183 206
if($database->is_error()) {
184 207
	$admin->print_error($database->get_error, ADMIN_URL.'/settings/index.php'.$advanced);
185
	$admin->print_footer();
186
	exit();
208
} else {
209
	$admin->print_success($MESSAGE['SETTINGS']['SAVED'], ADMIN_URL.'/settings/index.php'.$advanced);
187 210
}
188

  
189
$admin->print_success($MESSAGE['SETTINGS']['SAVED'], ADMIN_URL.'/settings/index.php'.$advanced);
190 211
$admin->print_footer();
191 212

  
192 213
?>
branches/2.8.x/wb/admin/settings/index.php
18 18

  
19 19
require('../../config.php');
20 20
require_once(WB_PATH.'/framework/class.admin.php');
21
if(isset($_GET['advanced']) AND $_GET['advanced'] == 'yes') {
21

  
22
if(isset($_GET['advanced']) && $_GET['advanced'] == 'yes') {
22 23
	$admin = new admin('Settings', 'settings_advanced');
23 24
} else {
24 25
	$admin = new admin('Settings', 'settings_basic');
......
30 31

  
31 32
// Create new template object
32 33
$template = new Template(THEME_PATH.'/templates');
33
$template->set_file('page', 'settings.htt');
34
$template->set_block('page', 'main_block', 'main');
34
// $template->debug = true;
35 35

  
36
$template->set_file('page',        'settings.htt');
37
$template->set_block('page',       'main_block', 'main');
38

  
39
$template->set_block('main_block', 'template_list_block',         'template_list');
40
$template->set_block('main_block', 'timezone_list_block',         'timezone_list');
41
$template->set_block('main_block', 'language_list_block',         'language_list');
42
$template->set_block('main_block', 'date_format_list_block',      'date_format_list');
43
$template->set_block('main_block', 'time_format_list_block',      'time_format_list');
44
$template->set_block('main_block', 'theme_list_block',            'theme_list');
45
$template->set_block('main_block', 'search_template_list_block',  'search_template_list');
46
$template->set_block('main_block', 'group_list_block',            'group_list');
47
$template->set_block('main_block', 'charset_list_block',          'charset_list');
48
$template->set_block('main_block', 'error_reporting_list_block',  'error_reporting_list');
49
$template->set_block('main_block', 'editor_list_block',           'editor_list');
50
$template->set_block('main_block', 'page_level_limit_list_block', 'page_level_limit_list');
51

  
52
$template->set_block('main_block', 'show_page_level_limit_block', 'show_page_level_limit');
53
$template->set_block('main_block', 'show_checkbox_1_block',       'show_checkbox_1');
54
$template->set_block('main_block', 'show_checkbox_2_block',       'show_checkbox_2');
55
$template->set_block('main_block', 'show_checkbox_3_block',       'show_checkbox_3');
56
$template->set_block('main_block', 'show_php_error_level_block',  'show_php_error_level');
57
$template->set_block('main_block', 'show_charset_block',          'show_charset');
58
$template->set_block('main_block', 'show_wysiwyg_block',          'show_wysiwyg');
59
$template->set_block('main_block', 'show_access_block',           'show_access');
60
$template->set_block('main_block', 'show_search_block',           'show_search');
61
$template->set_block('main_block', 'show_redirect_timer_block',   'show_redirect_timer');
62

  
36 63
// Query current settings in the db, then loop through them and print them
37 64
$query = "SELECT * FROM ".TABLE_PREFIX."settings";
38 65
$results = $database->query($query);
......
43 70
	$template->set_var(strtoupper($setting_name),$setting_value);
44 71
}
45 72

  
46
// Query current settings in the db, then loop through them and print them
47
$query = "SELECT * FROM ".TABLE_PREFIX."search WHERE extra = ''";
48
$results = $database->query($query);
49
while($setting = $results->fetchRow()) {
50
	$setting_name = $setting['name'];
51
	$setting_value = htmlspecialchars(($setting['value']));
52
	switch($setting_name) {
53
		// Search header
54
		case 'header':
55
			$template->set_var('SEARCH_HEADER', $setting_value);
56
		break;
57
		// Search results header
58
		case 'results_header':
59
			$template->set_var('SEARCH_RESULTS_HEADER', $setting_value);
60
		break;
61
		// Search results loop
62
		case 'results_loop':
63
			$template->set_var('SEARCH_RESULTS_LOOP', $setting_value);
64
		break;
65
		// Search results footer
66
		case 'results_footer':
67
			$template->set_var('SEARCH_RESULTS_FOOTER', $setting_value);
68
		break;
69
		// Search no results
70
		case 'no_results':
71
			$template->set_var('SEARCH_NO_RESULTS', $setting_value);
72
		break;
73
		// Search footer
74
		case 'footer':
75
			$template->set_var('SEARCH_FOOTER', $setting_value);
76
		break;
77
		// Search module-order
78
		case 'module_order':
79
			$template->set_var('SEARCH_MODULE_ORDER', $setting_value);
80
		break;
81
		// Search max lines of excerpt
82
		case 'max_excerpt':
83
			$template->set_var('SEARCH_MAX_EXCERPT', $setting_value);
84
		break;
85
		// time-limit
86
		case 'time_limit':
87
			$template->set_var('SEARCH_TIME_LIMIT', $setting_value);
88
		break;
89
		// Search template
90
		case 'template':
91
			$search_template = $setting_value;
92
		break;
93
	}
94
}
95

  
96 73
// Do the same for settings stored in config file as with ones in db
97 74
$database_type = '';
98

  
75
$is_advanced = (isset($_GET['advanced']) && $_GET['advanced'] == 'yes');
99 76
// Tell the browser whether or not to show advanced options
100
if(isset($_GET['advanced']) AND $_GET['advanced'] == 'yes') {
77
if($is_advanced)
78
{
101 79
	$template->set_var('DISPLAY_ADVANCED', '');
80
	$template->set_var('ADVANCED_FILE_PERMS_ID', 'file_perms_box');
81
	$template->set_var('BASIC_FILE_PERMS_ID', 'hide');
102 82
	$template->set_var('ADVANCED', 'yes');
103 83
	$template->set_var('ADVANCED_BUTTON', '<< '.$TEXT['HIDE_ADVANCED']);
104 84
	$template->set_var('ADVANCED_LINK', 'index.php?advanced=no');
105
	$template->set_var('BASIC_FILE_PERMS_ID', 'hide');
106
	$template->set_var('ADVANCED_FILE_PERMS_ID', 'file_perms_box');
85

  
107 86
} else {
108 87
	$template->set_var('DISPLAY_ADVANCED', ' style="display: none;"');
88
	$template->set_var('BASIC_FILE_PERMS_ID', 'file_perms_box');
89
	$template->set_var('ADVANCED_FILE_PERMS_ID', 'hide');
90

  
109 91
	$template->set_var('ADVANCED', 'no');
110 92
	$template->set_var('ADVANCED_BUTTON', $TEXT['SHOW_ADVANCED'].' >>');
111 93
	$template->set_var('ADVANCED_LINK', 'index.php?advanced=yes');
112
	$template->set_var('BASIC_FILE_PERMS_ID', 'file_perms_box');
113
	$template->set_var('ADVANCED_FILE_PERMS_ID', 'hide');
114 94
}
115 95

  
116
$template->set_var(array(	
96
	$query = "SELECT * FROM ".TABLE_PREFIX."search WHERE extra = ''";
97
	$results = $database->query($query);
98

  
99
	// Query current settings in the db, then loop through them and print them
100
	while($setting = $results->fetchRow())
101
	{
102
		$setting_name = $setting['name'];
103
		$setting_value = htmlspecialchars(($setting['value']));
104
		switch($setting_name) {
105
			// Search header
106
			case 'header':
107
				$template->set_var('SEARCH_HEADER', $setting_value);
108
			break;
109
			// Search results header
110
			case 'results_header':
111
				$template->set_var('SEARCH_RESULTS_HEADER', $setting_value);
112
			break;
113
			// Search results loop
114
			case 'results_loop':
115
				$template->set_var('SEARCH_RESULTS_LOOP', $setting_value);
116
			break;
117
			// Search results footer
118
			case 'results_footer':
119
				$template->set_var('SEARCH_RESULTS_FOOTER', $setting_value);
120
			break;
121
			// Search no results
122
			case 'no_results':
123
				$template->set_var('SEARCH_NO_RESULTS', $setting_value);
124
			break;
125
			// Search footer
126
			case 'footer':
127
				$template->set_var('SEARCH_FOOTER', $setting_value);
128
			break;
129
			// Search module-order
130
			case 'module_order':
131
				$template->set_var('SEARCH_MODULE_ORDER', $setting_value);
132
			break;
133
			// Search max lines of excerpt
134
			case 'max_excerpt':
135
				$template->set_var('SEARCH_MAX_EXCERPT', $setting_value);
136
			break;
137
			// time-limit
138
			case 'time_limit':
139
				$template->set_var('SEARCH_TIME_LIMIT', $setting_value);
140
			break;
141
			// Search template
142
			case 'template':
143
				$search_template = $setting_value;
144
			break;
145
		}
146
	}
147

  
148
	$template->set_var(array(
117 149
									'PAGES_DIRECTORY' => PAGES_DIRECTORY,
118 150
									'MEDIA_DIRECTORY' => MEDIA_DIRECTORY,
119 151
									'PAGE_EXTENSION' => PAGE_EXTENSION,
......
123 155
									'THEME_URL' => THEME_URL,
124 156
									'ADMIN_PATH' => ADMIN_PATH,
125 157
									'ADMIN_URL' => ADMIN_URL,
126
									'DATABASE_TYPE' => DB_TYPE,
127
									'DATABASE_HOST' => DB_HOST,
128
									'DATABASE_USERNAME' => DB_USERNAME,
129
									'DATABASE_NAME' => DB_NAME,
158
								    'DATABASE_TYPE' => '',
159
									'DATABASE_HOST' => '',
160
									'DATABASE_USERNAME' => '',
161
									'DATABASE_NAME' => '',
130 162
									'TABLE_PREFIX' => TABLE_PREFIX
131
								 )
132
						 );
163
								 ));
133 164

  
134
// Insert language values
135
$template->set_block('main_block', 'language_list_block', 'language_list');
136
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'language' ORDER BY name");
137
if($result->numRows() > 0) {
138
	while($addon = $result->fetchRow()) {
139
		$l_codes[$addon['name']] = $addon['directory'];
140
		$l_names[$addon['name']] = entities_to_7bit($addon['name']); // sorting-problem workaround
165
	// Insert language values
166
	$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'language' ORDER BY name");
167
	if($result->numRows() > 0)
168
	{
169
		while($addon = $result->fetchRow()) {
170
			$l_codes[$addon['name']] = $addon['directory'];
171
			$l_names[$addon['name']] = entities_to_7bit($addon['name']); // sorting-problem workaround
172
		}
173
		asort($l_names);
174
		foreach($l_names as $l_name=>$v) {
175
			// Insert code and name
176
			$template->set_var(array(
177
									'CODE' => $l_codes[$l_name],
178
									'NAME' => $l_name,
179
									'FLAG' => THEME_URL.'/images/flags/'.strtolower($l_codes[$l_name]),
180
									));
181
			// Check if it is selected
182
			if(DEFAULT_LANGUAGE == $l_codes[$l_name]) {
183
				$template->set_var('SELECTED', ' selected="selected"');
184
			} else {
185
				$template->set_var('SELECTED', '');
186
			}
187
			$template->parse('language_list', 'language_list_block', true);
188
		}
141 189
	}
142
	asort($l_names);
143
	foreach($l_names as $l_name=>$v) {
144
		// Insert code and name
145
		$template->set_var(array(
146
								'CODE' => $l_codes[$l_name],
147
								'NAME' => $l_name,
148
								'FLAG' => THEME_URL.'/images/flags/'.strtolower($l_codes[$l_name]),
149
								));
150
		// Check if it is selected
151
		if(DEFAULT_LANGUAGE == $l_codes[$l_name]) {
190

  
191
	// Insert default timezone values
192
	require(ADMIN_PATH.'/interface/timezones.php');
193
	foreach($TIMEZONES AS $hour_offset => $title)
194
	{
195
		// Make sure we dont list "System Default" as we are setting this value!
196
		if($hour_offset != '-20') {
197
			$template->set_var('VALUE', $hour_offset);
198
			$template->set_var('NAME', $title);
199
			if(DEFAULT_TIMEZONE == $hour_offset*60*60) {
200
				$template->set_var('SELECTED', ' selected="selected"');
201
			} else {
202
				$template->set_var('SELECTED', '');
203
			}
204
			$template->parse('timezone_list', 'timezone_list_block', true);
205
		}
206
	}
207

  
208
	// Insert default charset values
209
	require(ADMIN_PATH.'/interface/charsets.php');
210
	foreach($CHARSETS AS $code => $title) {
211
		$template->set_var('VALUE', $code);
212
		$template->set_var('NAME', $title);
213
		if(DEFAULT_CHARSET == $code) {
152 214
			$template->set_var('SELECTED', ' selected="selected"');
153 215
		} else {
154 216
			$template->set_var('SELECTED', '');
155 217
		}
156
		$template->parse('language_list', 'language_list_block', true);
218
		$template->parse('charset_list', 'charset_list_block', true);
157 219
	}
158
}
159 220

  
160
// Insert default timezone values
161
require(ADMIN_PATH.'/interface/timezones.php');
162
$template->set_block('main_block', 'timezone_list_block', 'timezone_list');
163
foreach($TIMEZONES AS $hour_offset => $title) {
164
	// Make sure we dont list "System Default" as we are setting this value!
165
	if($hour_offset != '-20') {
166
		$template->set_var('VALUE', $hour_offset);
221

  
222
	// Insert date format list
223
	require(ADMIN_PATH.'/interface/date_formats.php');
224
	foreach($DATE_FORMATS AS $format => $title) {
225
		$format = str_replace('|', ' ', $format); // Add's white-spaces (not able to be stored in array key)
226
		if($format != 'system_default') {
227
			$template->set_var('VALUE', $format);
228
		} else {
229
			$template->set_var('VALUE', '');
230
		}
167 231
		$template->set_var('NAME', $title);
168
		if(DEFAULT_TIMEZONE == $hour_offset*60*60) {
232
		if(DEFAULT_DATE_FORMAT == $format) {
169 233
			$template->set_var('SELECTED', ' selected="selected"');
170 234
		} else {
171 235
			$template->set_var('SELECTED', '');
172 236
		}
173
		$template->parse('timezone_list', 'timezone_list_block', true);
237
		$template->parse('date_format_list', 'date_format_list_block', true);
174 238
	}
175
}
176 239

  
177
// Insert default charset values
178
require(ADMIN_PATH.'/interface/charsets.php');
179
$template->set_block('main_block', 'charset_list_block', 'charset_list');
180
foreach($CHARSETS AS $code => $title) {
181
	$template->set_var('VALUE', $code);
182
	$template->set_var('NAME', $title);
183
	if(DEFAULT_CHARSET == $code) {
184
		$template->set_var('SELECTED', ' selected="selected"');
185
	} else {
186
		$template->set_var('SELECTED', '');
240
	// Insert time format list
241
	require(ADMIN_PATH.'/interface/time_formats.php');
242
	foreach($TIME_FORMATS AS $format => $title) {
243
		$format = str_replace('|', ' ', $format); // Add's white-spaces (not able to be stored in array key)
244
		if($format != 'system_default') {
245
			$template->set_var('VALUE', $format);
246
		} else {
247
			$template->set_var('VALUE', '');
248
		}
249
		$template->set_var('NAME', $title);
250
		if(DEFAULT_TIME_FORMAT == $format) {
251
			$template->set_var('SELECTED', ' selected="selected"');
252
		} else {
253
			$template->set_var('SELECTED', '');
254
		}
255
		$template->parse('time_format_list', 'time_format_list_block', true);
187 256
	}
188
	$template->parse('charset_list', 'charset_list_block', true);
189
}
190 257

  
191
// Insert date format list
192
require(ADMIN_PATH.'/interface/date_formats.php');
193
$template->set_block('main_block', 'date_format_list_block', 'date_format_list');
194
foreach($DATE_FORMATS AS $format => $title) {
195
	$format = str_replace('|', ' ', $format); // Add's white-spaces (not able to be stored in array key)
196
	if($format != 'system_default') {
197
		$template->set_var('VALUE', $format);
198
	} else {
199
		$template->set_var('VALUE', '');
258
	// Insert templates
259
	$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'template' AND function != 'theme' ORDER BY name");
260
	if($result->numRows() > 0) {
261
		while($addon = $result->fetchRow()) {
262
			$template->set_var('FILE', $addon['directory']);
263
			$template->set_var('NAME', $addon['name']);
264
			if(($addon['directory'] == DEFAULT_TEMPLATE) ? $selected = ' selected="selected"' : $selected = '');
265
			$template->set_var('SELECTED', $selected);
266
			$template->parse('template_list', 'template_list_block', true);
267
		}
200 268
	}
201
	$template->set_var('NAME', $title);
202
	if(DEFAULT_DATE_FORMAT == $format) {
203
		$template->set_var('SELECTED', ' selected="selected"');
204
	} else {
205
		$template->set_var('SELECTED', '');
206
	}
207
	$template->parse('date_format_list', 'date_format_list_block', true);
208
}
209 269

  
210
// Insert time format list
211
require(ADMIN_PATH.'/interface/time_formats.php');
212
$template->set_block('main_block', 'time_format_list_block', 'time_format_list');
213
foreach($TIME_FORMATS AS $format => $title) {
214
	$format = str_replace('|', ' ', $format); // Add's white-spaces (not able to be stored in array key)
215
	if($format != 'system_default') {
216
		$template->set_var('VALUE', $format);
217
	} else {
218
		$template->set_var('VALUE', '');
270
	// Insert backend theme
271
	$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'template' AND function = 'theme' ORDER BY name");
272
	if($result->numRows() > 0) {
273
		while($addon = $result->fetchRow()) {
274
			$template->set_var('FILE', $addon['directory']);
275
			$template->set_var('NAME', $addon['name']);
276
			if(($addon['directory'] == DEFAULT_THEME) ? $selected = ' selected="selected"' : $selected = '');
277
			$template->set_var('SELECTED', $selected);
278
			$template->parse('theme_list', 'theme_list_block', true);
279
		}
219 280
	}
220
	$template->set_var('NAME', $title);
221
	if(DEFAULT_TIME_FORMAT == $format) {
222
		$template->set_var('SELECTED', ' selected="selected"');
223
	} else {
224
		$template->set_var('SELECTED', '');
225
	}
226
	$template->parse('time_format_list', 'time_format_list_block', true);
227
}
228 281

  
229
// Insert templates
230
$template->set_block('main_block', 'template_list_block', 'template_list');
231
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'template' AND function != 'theme' ORDER BY name");
232
if($result->numRows() > 0) {
233
	while($addon = $result->fetchRow()) {
234
		$template->set_var('FILE', $addon['directory']);
235
		$template->set_var('NAME', $addon['name']);
236
		if(($addon['directory'] == DEFAULT_TEMPLATE) ? $selected = ' selected="selected"' : $selected = '');
237
		$template->set_var('SELECTED', $selected);
238
		$template->parse('template_list', 'template_list_block', true);
282
	// Insert WYSIWYG modules
283
	$file='none';
284
	$module_name=$TEXT['NONE'];
285
	$template->set_var('FILE', $file);
286
	$template->set_var('NAME', $module_name);
287
	$selected = (!defined('WYSIWYG_EDITOR') || $file == WYSIWYG_EDITOR) ? ' selected="selected"' : '';
288
	$template->set_var('SELECTED', $selected);
289
	$template->parse('editor_list', 'editor_list_block', true);
290
	$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'module' AND function = 'wysiwyg' ORDER BY name");
291
	if($result->numRows() > 0)
292
	{
293
		while($addon = $result->fetchRow())
294
	    {
295
			$template->set_var('FILE', $addon['directory']);
296
			$template->set_var('NAME', $addon['name']);
297
			$selected = (!defined('WYSIWYG_EDITOR') || $addon['directory'] == WYSIWYG_EDITOR) ? ' selected="selected"' : '';
298
			$template->set_var('SELECTED', $selected);
299
			$template->parse('editor_list', 'editor_list_block', true);
300
		}
239 301
	}
240
}
241 302

  
242
// Insert backend theme
243
$template->set_block('main_block', 'theme_list_block', 'theme_list');
244
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'template' AND function = 'theme' ORDER BY name");
245
if($result->numRows() > 0) {
246
	while($addon = $result->fetchRow()) {
247
		$template->set_var('FILE', $addon['directory']);
248
		$template->set_var('NAME', $addon['name']);
249
		if(($addon['directory'] == DEFAULT_THEME) ? $selected = ' selected="selected"' : $selected = '');
250
		$template->set_var('SELECTED', $selected);
251
		$template->parse('theme_list', 'theme_list_block', true);
252
	}
253
}
254

  
255
// Insert WYSIWYG modules
256
$template->set_block('main_block', 'editor_list_block', 'editor_list');
257
$file='none';
258
$module_name=$TEXT['NONE'];  
259
$template->set_var('FILE', $file);  
260
$template->set_var('NAME', $module_name);  
261
if((!defined('WYSIWYG_EDITOR') || $file == WYSIWYG_EDITOR) ? $selected = ' selected="selected"' : $selected = '');
262
$template->set_var('SELECTED', $selected);
263
$template->parse('editor_list', 'editor_list_block', true);  
264
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'module' AND function = 'wysiwyg' ORDER BY name");
265
if($result->numRows() > 0)
266
{
267
	while($addon = $result->fetchRow())
268
    {
269
		$template->set_var('FILE', $addon['directory']);
270
		$template->set_var('NAME', $addon['name']);
271
		if((defined('WYSIWYG_EDITOR') AND $addon['directory'] == WYSIWYG_EDITOR) ? $selected = ' selected="selected"' : $selected = '');
272
		$template->set_var('SELECTED', $selected);
273
		$template->parse('editor_list', 'editor_list_block', true);
274
	}
275
}
276

  
277 303
// Insert templates for search settings
278
$template->set_block('main_block', 'search_template_list_block', 'search_template_list');
304
	$search_template = ( ($search_template == DEFAULT_TEMPLATE) || ($search_template == '') ) ? DEFAULT_TEMPLATE : $search_template;
305
	$selected = ( ($search_template != DEFAULT_TEMPLATE) ) ?  ' selected="selected"' : $selected = '';
279 306

  
280
$search_template = ( ($search_template == DEFAULT_TEMPLATE) OR ($search_template == '') ) ? '' : $search_template;
307
	$template->set_var(array(
308
	        'FILE' => '',
309
	        'NAME' => $TEXT['SYSTEM_DEFAULT'],
310
	        'SELECTED' => $selected
311
	    ));
281 312

  
282
$selected = ( ($search_template != DEFAULT_TEMPLATE) ) ?  ' selected="selected"' : $selected = '';
313
	$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'template' AND function = 'template' ORDER BY name");
314
	if($result->numRows() > 0)
315
	{
316
		while($addon = $result->fetchRow())
317
	    {
318
			$template->set_var('FILE', $addon['directory']);
319
			$template->set_var('NAME', $addon['name']);
320
	        $selected = ($addon['directory'] == $search_template) ? ' selected="selected"' :  $selected = '';
321
			$template->set_var('SELECTED', $selected);
322
			$template->parse('search_template_list', 'search_template_list_block', true);
283 323

  
284
$template->set_var(array(
285
        'FILE' => '',
286
        'NAME' => $TEXT['SYSTEM_DEFAULT'],
287
        'SELECTED' => $selected
288
    ));
324
		}
325
	}
289 326

  
290
$template->parse('search_template_list', 'search_template_list_block', true);
291
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'template' AND function = 'template' ORDER BY name");
327
	// Insert default error reporting values
328
	require(ADMIN_PATH.'/interface/er_levels.php');
329
	foreach($ER_LEVELS AS $value => $title)
330
	{
331
		$template->set_var('VALUE', $value);
332
		$template->set_var('NAME', $title);
333
	    $selected = (ER_LEVEL == $value) ? ' selected="selected"' : '';
334
	    $template->set_var('SELECTED', $selected);
335
		$template->parse('error_reporting_list', 'error_reporting_list_block', true);
336
	}
292 337

  
293
if($result->numRows() > 0)
294
{
295
	while($addon = $result->fetchRow())
296
    {
297
		$template->set_var('FILE', $addon['directory']);
298
		$template->set_var('NAME', $addon['name']);
299
        $selected = ($addon['directory'] == $search_template) ? ' selected="selected"' :  $selected = '';
300
		$template->set_var('SELECTED', $selected);
338
	// Insert permissions values
339
	if($admin->get_permission('settings_advanced') != true)
340
	{
341
		$template->set_var('DISPLAY_ADVANCED_BUTTON', 'hide');
342
	}
301 343

  
302
		$template->parse('search_template_list', 'search_template_list_block', true);
344
	// Insert page level limits
345
	for($i = 1; $i <= 10; $i++)
346
	{
347
		$template->set_var('NUMBER', $i);
348
		if(PAGE_LEVEL_LIMIT == $i)
349
	    {
350
			$template->set_var('SELECTED', ' selected="selected"');
351
		} else {
352
			$template->set_var('SELECTED', '');
353
		}
354
		$template->parse('page_level_limit_list', 'page_level_limit_list_block', true);
303 355
	}
304
}
305 356

  
306
// Insert default error reporting values
307
require(ADMIN_PATH.'/interface/er_levels.php');
308
$template->set_block('main_block', 'error_reporting_list_block', 'error_reporting_list');
309
foreach($ER_LEVELS AS $value => $title)
310
{
311
	$template->set_var('VALUE', $value);
312
	$template->set_var('NAME', $title);
313
    $selected = (ER_LEVEL == $value) ? ' selected="selected"' : '';
314
    $template->set_var('SELECTED', $selected);
357
	// Work-out if multiple menus feature is enabled
358
	if(defined('MULTIPLE_MENUS') && MULTIPLE_MENUS == true)
359
	{
360
		$template->set_var('MULTIPLE_MENUS_ENABLED', ' checked="checked"');
361
	} else {
362
		$template->set_var('MULTIPLE_MENUS_DISABLED', ' checked="checked"');
363
	}
315 364

  
316
	$template->parse('error_reporting_list', 'error_reporting_list_block', true);
317
}
365
	// Work-out if page languages feature is enabled
366
	if(defined('PAGE_LANGUAGES') && PAGE_LANGUAGES == true)
367
	{
368
	        $template->set_var('PAGE_LANGUAGES_ENABLED', ' checked="checked"');
369
	} else {
370
	        $template->set_var('PAGE_LANGUAGES_DISABLED', ' checked="checked"');
371
	}
318 372

  
319
// Insert permissions values
320
if($admin->get_permission('settings_advanced') != true)
321
{
322
	$template->set_var('DISPLAY_ADVANCED_BUTTON', 'hide');
323
}
373
	// Work-out if smart login feature is enabled
374
	if(defined('SMART_LOGIN') && SMART_LOGIN == true)
375
	{
376
		$template->set_var('SMART_LOGIN_ENABLED', ' checked="checked"');
377
	} else {
378
		$template->set_var('SMART_LOGIN_DISABLED', ' checked="checked"');
379
	}
324 380

  
325
// Insert page level limits
326
$template->set_block('main_block', 'page_level_limit_list_block', 'page_level_limit_list');
327
for($i = 1; $i <= 10; $i++)
328
{
329
	$template->set_var('NUMBER', $i);
330
	if(PAGE_LEVEL_LIMIT == $i)
331
    {
332
		$template->set_var('SELECTED', ' selected="selected"');
381
	/* Make's sure GD library is installed */
382
	if(extension_loaded('gd') && function_exists('imageCreateFromJpeg'))
383
	{
384
		$template->set_var('GD_EXTENSION_ENABLED', '');
333 385
	} else {
334
		$template->set_var('SELECTED', '');
386
		$template->set_var('GD_EXTENSION_ENABLED', ' style="display: none;"');
335 387
	}
336
	$template->parse('page_level_limit_list', 'page_level_limit_list_block', true);
337
}
338 388

  
339
// Work-out if multiple menus feature is enabled
340
if(defined('MULTIPLE_MENUS') AND MULTIPLE_MENUS == true)
341
{
342
	$template->set_var('MULTIPLE_MENUS_ENABLED', ' checked="checked"');
343
} else {
344
	$template->set_var('MULTIPLE_MENUS_DISABLED', ' checked="checked"');
345
}
389
	// Work-out if section blocks feature is enabled
390
	if(defined('SECTION_BLOCKS') && SECTION_BLOCKS == true)
391
	{
392
		$template->set_var('SECTION_BLOCKS_ENABLED', ' checked="checked"');
393
	} else {
394
		$template->set_var('SECTION_BLOCKS_DISABLED', ' checked="checked"');
395
	}
346 396

  
347
// Work-out if page languages feature is enabled
348
if(defined('PAGE_LANGUAGES') AND PAGE_LANGUAGES == true)
349
{
350
        $template->set_var('PAGE_LANGUAGES_ENABLED', ' checked="checked"');
351
} else {
352
        $template->set_var('PAGE_LANGUAGES_DISABLED', ' checked="checked"');
353
}
397
	// Work-out if homepage redirection feature is enabled
398
	if(defined('HOMEPAGE_REDIRECTION') && HOMEPAGE_REDIRECTION == true)
399
	{
400
		$template->set_var('HOMEPAGE_REDIRECTION_ENABLED', ' checked="checked"');
401
	} else {
402
		$template->set_var('HOMEPAGE_REDIRECTION_DISABLED', ' checked="checked"');
403
	}
354 404

  
355
// Work-out if smart login feature is enabled
356
if(defined('SMART_LOGIN') AND SMART_LOGIN == true)
357
{
358
	$template->set_var('SMART_LOGIN_ENABLED', ' checked="checked"');
359
} else {
360
	$template->set_var('SMART_LOGIN_DISABLED', ' checked="checked"');
361
}
405
	// Work-out which server os should be checked
406
	if(OPERATING_SYSTEM == 'linux')
407
	{
408
		$template->set_var('LINUX_SELECTED', ' checked="checked"');
409
	} elseif(OPERATING_SYSTEM == 'windows') {
410
		$template->set_var('WINDOWS_SELECTED', ' checked="checked"');
411
	}
362 412

  
363
/* Make's sure GD library is installed */
364
if(extension_loaded('gd') AND function_exists('imageCreateFromJpeg'))
365
{
366
	$template->set_var('GD_EXTENSION_ENABLED', '');
367
} else {
368
	$template->set_var('GD_EXTENSION_ENABLED', ' style="display: none;"');
369
}
413
	// Work-out if manage sections feature is enabled
414
	if(MANAGE_SECTIONS)
415
	{
416
		$template->set_var('MANAGE_SECTIONS_ENABLED', ' checked="checked"');
417
	} else {
418
		$template->set_var('MANAGE_SECTIONS_DISABLED', ' checked="checked"');
419
	}
370 420

  
371
// Work-out if section blocks feature is enabled
372
if(defined('SECTION_BLOCKS') AND SECTION_BLOCKS == true)
373
{
374
	$template->set_var('SECTION_BLOCKS_ENABLED', ' checked="checked"');
375
} else {
376
	$template->set_var('SECTION_BLOCKS_DISABLED', ' checked="checked"');
377
}
421
	// Work-out which wbmailer routine should be checked
422
	if(WBMAILER_ROUTINE == 'phpmail')
423
	{
424
		$template->set_var('PHPMAIL_SELECTED', ' checked="checked"');
425
		$template->set_var('SMTP_VISIBILITY', ' style="display: none;"');
426
		$template->set_var('SMTP_VISIBILITY_AUTH', ' style="display: none;"');
427
	} elseif(WBMAILER_ROUTINE == 'smtp')
428
	{
429
		$template->set_var('SMTPMAIL_SELECTED', ' checked="checked"');
430
		$template->set_var('SMTP_VISIBILITY', '');
431
	}
378 432

  
379
// Work-out if homepage redirection feature is enabled
380
if(defined('HOMEPAGE_REDIRECTION') AND HOMEPAGE_REDIRECTION == true)
381
{
382
	$template->set_var('HOMEPAGE_REDIRECTION_ENABLED', ' checked="checked"');
383
} else {
384
	$template->set_var('HOMEPAGE_REDIRECTION_DISABLED', ' checked="checked"');
385
}
433
	// Work-out if SMTP authentification should be checked
434
	if(WBMAILER_SMTP_AUTH)
435
	{
436
		$template->set_var('SMTP_AUTH_SELECTED', ' checked="checked"');
437
		if(WBMAILER_ROUTINE == 'smtp')
438
	    {
439
			$template->set_var('SMTP_VISIBILITY_AUTH', '');
386 440

  
387
// Work-out which server os should be checked
388
if(OPERATING_SYSTEM == 'linux')
389
{
390
	$template->set_var('LINUX_SELECTED', ' checked="checked"');
391
} elseif(OPERATING_SYSTEM == 'windows') {
392
	$template->set_var('WINDOWS_SELECTED', ' checked="checked"');
393
}
394

  
395
// Work-out if manage sections feature is enabled
396
if(MANAGE_SECTIONS)
397
{
398
	$template->set_var('MANAGE_SECTIONS_ENABLED', ' checked="checked"');
399
} else {
400
	$template->set_var('MANAGE_SECTIONS_DISABLED', ' checked="checked"');
401
}
402

  
403
// Work-out which wbmailer routine should be checked
404
if(WBMAILER_ROUTINE == 'phpmail')
405
{
406
	$template->set_var('PHPMAIL_SELECTED', ' checked="checked"');
407
	$template->set_var('SMTP_VISIBILITY', ' style="display: none;"');
408
	$template->set_var('SMTP_VISIBILITY_AUTH', ' style="display: none;"');
409
} elseif(WBMAILER_ROUTINE == 'smtp')
410
{
411
	$template->set_var('SMTPMAIL_SELECTED', ' checked="checked"');
412
	$template->set_var('SMTP_VISIBILITY', '');
413
}
414

  
415
// Work-out if SMTP authentification should be checked
416
if(WBMAILER_SMTP_AUTH)
417
{
418
	$template->set_var('SMTP_AUTH_SELECTED', ' checked="checked"');
419
	if(WBMAILER_ROUTINE == 'smtp')
420
    {
421
		$template->set_var('SMTP_VISIBILITY_AUTH', '');
441
		} else {
442
			$template->set_var('SMTP_VISIBILITY_AUTH', ' style="display: none;"');
443
		}
422 444
	} else {
423 445
		$template->set_var('SMTP_VISIBILITY_AUTH', ' style="display: none;"');
424 446
	}
425
} else {
426
	$template->set_var('SMTP_VISIBILITY_AUTH', ' style="display: none;"');
427
}
428 447

  
429
// Work-out if intro feature is enabled
430
if(INTRO_PAGE)
431
{
432
	$template->set_var('INTRO_PAGE_ENABLED', ' checked="checked"');
433
} else {
434
	$template->set_var('INTRO_PAGE_DISABLED', ' checked="checked"');
435
}
448
	// Work-out if intro feature is enabled
449
	if(INTRO_PAGE)
450
	{
451
		$template->set_var('INTRO_PAGE_ENABLED', ' checked="checked"');
452
	} else {
453
		$template->set_var('INTRO_PAGE_DISABLED', ' checked="checked"');
454
	}
436 455

  
437
// Work-out if frontend login feature is enabled
438
if(FRONTEND_LOGIN)
439
{
440
	$template->set_var('PRIVATE_ENABLED', ' checked="checked"');
441
} else {
442
	$template->set_var('PRIVATE_DISABLED', ' checked="checked"');
443
}
456
	// Work-out if frontend login feature is enabled
457
	if(FRONTEND_LOGIN)
458
	{
459
		$template->set_var('PRIVATE_ENABLED', ' checked="checked"');
460
	} else {
461
		$template->set_var('PRIVATE_DISABLED', ' checked="checked"');
462
	}
444 463

  
445
// Work-out if page trash feature is disabled, in-line, or separate
446
if(PAGE_TRASH == 'disabled')
447
{
448
	$template->set_var('PAGE_TRASH_DISABLED', ' checked="checked"');
449
	$template->set_var('DISPLAY_PAGE_TRASH_SEPARATE', 'display: none;');
450
} elseif(PAGE_TRASH == 'inline')
451
{
452
	$template->set_var('PAGE_TRASH_INLINE', ' checked="checked"');
453
	$template->set_var('DISPLAY_PAGE_TRASH_SEPARATE', 'display: none;');
454
} elseif(PAGE_TRASH == 'separate')
455
{
456
	$template->set_var('PAGE_TRASH_SEPARATE', ' checked="checked"');
457
	$template->set_var('DISPLAY_PAGE_TRASH_SEPARATE', 'display: inline;');
458
}
464
	// Work-out if page trash feature is disabled, in-line, or separate
465
	if(PAGE_TRASH == 'disabled')
466
	{
467
		$template->set_var('PAGE_TRASH_DISABLED', ' checked="checked"');
468
		$template->set_var('DISPLAY_PAGE_TRASH_SEPARATE', 'display: none;');
469
	} elseif(PAGE_TRASH == 'inline')
470
	{
471
		$template->set_var('PAGE_TRASH_INLINE', ' checked="checked"');
472
		$template->set_var('DISPLAY_PAGE_TRASH_SEPARATE', 'display: none;');
473
	} elseif(PAGE_TRASH == 'separate')
474
	{
475
		$template->set_var('PAGE_TRASH_SEPARATE', ' checked="checked"');
476
		$template->set_var('DISPLAY_PAGE_TRASH_SEPARATE', 'display: inline;');
477
	}
459 478

  
460
// Work-out if media home folde feature is enabled
461
if(HOME_FOLDERS)
462
{
463
	$template->set_var('HOME_FOLDERS_ENABLED', ' checked="checked"');
464
} else {
465
	$template->set_var('HOME_FOLDERS_DISABLED', ' checked="checked"');
466
}
479
	// Work-out if media home folde feature is enabled
480
	if(HOME_FOLDERS)
481
	{
482
		$template->set_var('HOME_FOLDERS_ENABLED', ' checked="checked"');
483
	} else {
484
		$template->set_var('HOME_FOLDERS_DISABLED', ' checked="checked"');
485
	}
467 486

  
468
// Insert search select
469
if(SEARCH == 'private')
470
{
471
	$template->set_var('PRIVATE_SEARCH', ' selected="selected"');
472
} elseif(SEARCH == 'registered') {
473
	$template->set_var('REGISTERED_SEARCH', ' selected="selected"');
474
} elseif(SEARCH == 'none') {
475
	$template->set_var('NONE_SEARCH', ' selected="selected"');
476
}
487
	// Insert search select
488
	if(SEARCH == 'private')
489
	{
490
		$template->set_var('PRIVATE_SEARCH', ' selected="selected"');
491
	} elseif(SEARCH == 'registered') {
492
		$template->set_var('REGISTERED_SEARCH', ' selected="selected"');
493
	} elseif(SEARCH == 'none') {
494
		$template->set_var('NONE_SEARCH', ' selected="selected"');
495
	}
477 496

  
478
// Work-out if 777 permissions are set
479
if(STRING_FILE_MODE == '0777' AND STRING_DIR_MODE == '0777')
480
{
481
	$template->set_var('WORLD_WRITEABLE_SELECTED', ' checked="checked"');
482
}
497
	// Work-out if 777 permissions are set
498
	if(STRING_FILE_MODE == '0777' AND STRING_DIR_MODE == '0777')
499
	{
500
		$template->set_var('WORLD_WRITEABLE_SELECTED', ' checked="checked"');
501
	}
483 502

  
484
// Work-out which file mode boxes are checked
485
if(extract_permission(STRING_FILE_MODE, 'u', 'r'))
486
{
487
	$template->set_var('FILE_U_R_CHECKED', ' checked="checked"');
488
}
489
if(extract_permission(STRING_FILE_MODE, 'u', 'w'))
490
{
491
	$template->set_var('FILE_U_W_CHECKED', ' checked="checked"');
492
}
493
if(extract_permission(STRING_FILE_MODE, 'u', 'e'))
494
{
495
	$template->set_var('FILE_U_E_CHECKED', ' checked="checked"');
496
}
497
if(extract_permission(STRING_FILE_MODE, 'g', 'r'))
498
{
499
	$template->set_var('FILE_G_R_CHECKED', ' checked="checked"');
500
}
501
if(extract_permission(STRING_FILE_MODE, 'g', 'w'))
502
{
503
	$template->set_var('FILE_G_W_CHECKED', ' checked="checked"');
504
}
505
if(extract_permission(STRING_FILE_MODE, 'g', 'e'))
506
{
507
	$template->set_var('FILE_G_E_CHECKED', ' checked="checked"');
508
}
509
if(extract_permission(STRING_FILE_MODE, 'o', 'r'))
510
{
511
	$template->set_var('FILE_O_R_CHECKED', ' checked="checked"');
512
}
513
if(extract_permission(STRING_FILE_MODE, 'o', 'w'))
514
{
515
	$template->set_var('FILE_O_W_CHECKED', ' checked="checked"');
516
}
517
if(extract_permission(STRING_FILE_MODE, 'o', 'e'))
518
{
519
	$template->set_var('FILE_O_E_CHECKED', ' checked="checked"');
520
}
521
// Work-out which dir mode boxes are checked
522
if(extract_permission(STRING_DIR_MODE, 'u', 'r'))
523
{
524
	$template->set_var('DIR_U_R_CHECKED', ' checked="checked"');
525
}
526
if(extract_permission(STRING_DIR_MODE, 'u', 'w'))
527
{
528
	$template->set_var('DIR_U_W_CHECKED', ' checked="checked"');
529
}
530
if(extract_permission(STRING_DIR_MODE, 'u', 'e'))
531
{
532
	$template->set_var('DIR_U_E_CHECKED', ' checked="checked"');
533
}
534
if(extract_permission(STRING_DIR_MODE, 'g', 'r'))
535
{
536
	$template->set_var('DIR_G_R_CHECKED', ' checked="checked"');
537
}
538
if(extract_permission(STRING_DIR_MODE, 'g', 'w'))
539
{
540
	$template->set_var('DIR_G_W_CHECKED', ' checked="checked"');
541
}
542
if(extract_permission(STRING_DIR_MODE, 'g', 'e'))
543
{
544
	$template->set_var('DIR_G_E_CHECKED', ' checked="checked"');
545
}
546
if(extract_permission(STRING_DIR_MODE, 'o', 'r'))
547
{
548
	$template->set_var('DIR_O_R_CHECKED', ' checked="checked"');
549
}
550
if(extract_permission(STRING_DIR_MODE, 'o', 'w'))
551
{
552
	$template->set_var('DIR_O_W_CHECKED', ' checked="checked"');
553
}
554
if(extract_permission(STRING_DIR_MODE, 'o', 'e'))
555
{
556
	$template->set_var('DIR_O_E_CHECKED', ' checked="checked"');
557
}
503
	// Work-out which file mode boxes are checked
504
	if(extract_permission(STRING_FILE_MODE, 'u', 'r'))
505
	{
506
		$template->set_var('FILE_U_R_CHECKED', ' checked="checked"');
507
	}
508
	if(extract_permission(STRING_FILE_MODE, 'u', 'w'))
509
	{
510
		$template->set_var('FILE_U_W_CHECKED', ' checked="checked"');
511
	}
512
	if(extract_permission(STRING_FILE_MODE, 'u', 'e'))
513
	{
514
		$template->set_var('FILE_U_E_CHECKED', ' checked="checked"');
515
	}
516
	if(extract_permission(STRING_FILE_MODE, 'g', 'r'))
517
	{
518
		$template->set_var('FILE_G_R_CHECKED', ' checked="checked"');
519
	}
520
	if(extract_permission(STRING_FILE_MODE, 'g', 'w'))
521
	{
522
		$template->set_var('FILE_G_W_CHECKED', ' checked="checked"');
523
	}
524
	if(extract_permission(STRING_FILE_MODE, 'g', 'e'))
525
	{
526
		$template->set_var('FILE_G_E_CHECKED', ' checked="checked"');
527
	}
528
	if(extract_permission(STRING_FILE_MODE, 'o', 'r'))
529
	{
530
		$template->set_var('FILE_O_R_CHECKED', ' checked="checked"');
531
	}
532
	if(extract_permission(STRING_FILE_MODE, 'o', 'w'))
533
	{
534
		$template->set_var('FILE_O_W_CHECKED', ' checked="checked"');
535
	}
536
	if(extract_permission(STRING_FILE_MODE, 'o', 'e'))
537
	{
538
		$template->set_var('FILE_O_E_CHECKED', ' checked="checked"');
539
	}
540
	// Work-out which dir mode boxes are checked
541
	if(extract_permission(STRING_DIR_MODE, 'u', 'r'))
542
	{
543
		$template->set_var('DIR_U_R_CHECKED', ' checked="checked"');
544
	}
545
	if(extract_permission(STRING_DIR_MODE, 'u', 'w'))
546
	{
547
		$template->set_var('DIR_U_W_CHECKED', ' checked="checked"');
548
	}
549
	if(extract_permission(STRING_DIR_MODE, 'u', 'e'))
550
	{
551
		$template->set_var('DIR_U_E_CHECKED', ' checked="checked"');
552
	}
553
	if(extract_permission(STRING_DIR_MODE, 'g', 'r'))
554
	{
555
		$template->set_var('DIR_G_R_CHECKED', ' checked="checked"');
556
	}
557
	if(extract_permission(STRING_DIR_MODE, 'g', 'w'))
558
	{
559
		$template->set_var('DIR_G_W_CHECKED', ' checked="checked"');
560
	}
561
	if(extract_permission(STRING_DIR_MODE, 'g', 'e'))
562
	{
563
		$template->set_var('DIR_G_E_CHECKED', ' checked="checked"');
564
	}
565
	if(extract_permission(STRING_DIR_MODE, 'o', 'r'))
566
	{
567
		$template->set_var('DIR_O_R_CHECKED', ' checked="checked"');
568
	}
569
	if(extract_permission(STRING_DIR_MODE, 'o', 'w'))
570
	{
571
		$template->set_var('DIR_O_W_CHECKED', ' checked="checked"');
572
	}
573
	if(extract_permission(STRING_DIR_MODE, 'o', 'e'))
574
	{
575
		$template->set_var('DIR_O_E_CHECKED', ' checked="checked"');
576
	}
558 577

  
559
// Insert Server Email value into template
560
$template->set_var('SERVER_EMAIL', SERVER_EMAIL);
578
	// Insert Server Email value into template
579
	$template->set_var('SERVER_EMAIL', SERVER_EMAIL);
561 580

  
562
// Insert groups into signup list
563
$template->set_block('main_block', 'group_list_block', 'group_list');
564
$results = $database->query("SELECT group_id, name FROM ".TABLE_PREFIX."groups WHERE group_id != '1'");
565
if($results->numRows() > 0)
566
{
567
	while($group = $results->fetchRow())
568
    {
569
		$template->set_var('ID', $group['group_id']);
570
		$template->set_var('NAME', $group['name']);
571
		if(FRONTEND_SIGNUP == $group['group_id'])
572
        {
573
			$template->set_var('SELECTED', ' selected="selected"');
574
		} else {
575
			$template->set_var('SELECTED', '');
581
	// Insert groups into signup list
582
	$results = $database->query("SELECT group_id, name FROM ".TABLE_PREFIX."groups WHERE group_id != '1'");
583
	if($results->numRows() > 0)
584
	{
585
		while($group = $results->fetchRow())
586
	    {
587
			$template->set_var('ID', $group['group_id']);
588
			$template->set_var('NAME', $group['name']);
589
			if(FRONTEND_SIGNUP == $group['group_id'])
590
	        {
591
				$template->set_var('SELECTED', ' selected="selected"');
592
			} else {
593
				$template->set_var('SELECTED', '');
594
			}
595
			$template->parse('group_list', 'group_list_block', true);
576 596
		}
597
	} else {
598
		$template->set_var('ID', 'disabled');
599
		$template->set_var('NAME', $MESSAGE['GROUPS']['NO_GROUPS_FOUND']);
577 600
		$template->parse('group_list', 'group_list_block', true);
578 601
	}
579
} else {
580
	$template->set_var('ID', 'disabled');
581
	$template->set_var('NAME', $MESSAGE['GROUPS']['NO_GROUPS_FOUND']);
582
	$template->parse('group_list', 'group_list_block', true);
583
}
584 602

  
585
// Insert language headings
586
$template->set_var(array(
603
	// Insert language headings
604
	$template->set_var(array(
587 605
								'HEADING_GENERAL_SETTINGS' => $HEADING['GENERAL_SETTINGS'],
588 606
								'HEADING_DEFAULT_SETTINGS' => $HEADING['DEFAULT_SETTINGS'],
589 607
								'HEADING_SEARCH_SETTINGS' => $HEADING['SEARCH_SETTINGS'],
......
592 610
								'HEADING_ADMINISTRATION_TOOLS' => $HEADING['ADMINISTRATION_TOOLS']
593 611
								)
594 612
						);
595
// Insert language text and messages
596
$template->set_var(array(
613
	// Insert language text and messages
614
	$template->set_var(array(
597 615
								'TEXT_WEBSITE_TITLE' => $TEXT['WEBSITE_TITLE'],
598 616
								'TEXT_WEBSITE_DESCRIPTION' => $TEXT['WEBSITE_DESCRIPTION'],
599 617
								'TEXT_WEBSITE_KEYWORDS' => $TEXT['WEBSITE_KEYWORDS'],
......
692 710
								'TEXT_MODULE_ORDER' => $TEXT['MODULE_ORDER'],
693 711
								'TEXT_MAX_EXCERPT' => $TEXT['MAX_EXCERPT'],
694 712
								'TEXT_TIME_LIMIT' => $TEXT['TIME_LIMIT']
695
								)
696
						);
713
								));
697 714

  
715
if($is_advanced)
716
{
717
	$template->parse('show_page_level_limit', 'show_page_level_limit_block', true);
718
	$template->parse('show_checkbox_1',       'show_checkbox_1_block', true);
719
 	$template->parse('show_checkbox_2',       'show_checkbox_2_block', true);
720
	$template->parse('show_checkbox_3',       'show_checkbox_3_block', true);
721
	$template->parse('show_php_error_level',  'show_php_error_level_block', true);
722
	$template->parse('show_charset',          'show_charset_block', true);
723
	$template->parse('show_access',           'show_access_block', true);
724
	$template->parse('show_wysiwyg',          'show_wysiwyg_block', true);
725
	$template->parse('show_search',           'show_search_block', false);
726
	$template->parse('show_redirect_timer',   'show_redirect_timer_block', true);
727
}else {
728
	$template->set_block('show_page_level_limit', '');
729
	$template->set_block('show_checkbox_1', '');
730
	$template->set_block('show_checkbox_2', '');
731
	$template->set_block('show_checkbox_3', '');
732
	$template->set_block('show_php_error_level', '');
733
	$template->set_block('show_charset', '');
734
	$template->set_block('show_access', '');
735
	$template->set_block('show_wysiwyg', '');
736
	$template->set_block('show_search', '');
737
	$template->set_block('show_redirect_timer', '');
738
}
739

  
698 740
// Parse template objects output
699 741
$template->parse('main', 'main_block', false);
700 742
$template->pparse('output', 'page');
branches/2.8.x/wb/templates/wb_theme/theme.css
23 23
h1 { color: #000000; font-size: 20px; text-align: center; text-transform: uppercase; }
24 24
h2 { margin: 5px 0px 5px 0px; color: #336699; font-size: 15px; }
25 25
h4 { margin: 0; border-bottom: 1px solid #DDD; padding-bottom: 5px; }
26
a h3 { margin: 0; font-size :1.1em; padding-bottom: 2px; }
27
li p { margin: 0.5em 0; }
26 28
a:link, a:visited, a:active { color: #003366; text-decoration: none; }
27 29
a:hover { color: #336699; text-decoration: none; }
28 30
ul, li { margin: 0; padding: 0; list-style: none; }
31
.current a, .current a:link, .current a:active, .current a:visited { background: #fff url(images/menuo.png); background-repeat: repeat-x; color: #fff; }
29 32
label { cursor: pointer; }
30 33
input:focus, input:active, select:focus, textarea:focus { background: #F1F8FD; }
31 34
iframe { border: 1px solid #35373a; }
......
33 36
.header { width: 900px; margin: 0 auto; }
34 37
.container { width: 85%; margin: 0 auto; background: #fff url(images/bgtitle.png); background-repeat: repeat-x; }
35 38
.content { padding: 20px; width: 95%; height: 200px; margin: 0 auto; min-height: 300px;  vertical-align: top; }
36
.current a, .current a:link, .current a:active, .current a:visited { background: #fff url(images/menuo.png); background-repeat: repeat-x; color: #fff; }
37 39
.description { width: 240px; padding: 0px 0px 0px 3px; text-align: left; vertical-align: top; }
38 40
.graphic { width: 50px; border: 4px solid #FDFDFD; padding-left: 3px; height: 50px; }
39 41
.graphic img { padding: 3px 12px 3px 3px; margin-right: 12px; border-right: 3px solid silver; background-color: #FFFFFF; vertical-align: middle; }
......
59 61
.setting_value { width: 90%; }
60 62
.setting_value textarea { height: 50px; }
61 63
.title { width: 90%; padding: 4px 0px 0px 3px; color: #003366; font-weight: bold; font-size: 14px; text-align: left; height: 16px; }
62
.tool_table ul { margin: 0; padding: 0; margin-left: 20px; margin-bottom: 10px; }
63
.tool_table li { padding-bottom: 5px; list-style-type: disc; }
64
.tool_table ul { margin: 0; padding: 0; margin-left: 20px; margin-bottom: 2px; }
65
.tool_table li { padding: 1px; list-style-type: disc; }
64 66
/* CSS STYLES FOR THE PAGES SECTION */
65 67
table.pages_view { width: 100%; margin: 0 auto; border: 0; background-color: #ECF3F7; border-spacing: 0px; }
66 68
table.pages_view tr:hover { background-color: #F1F8DD; }
......
163 165
      background: #f5f5f5 none;
164 166
   }
165 167

  
166
 div#username { height: 17px; width:402px; min-width:250px; border: 0px groove #6799c4; text-align: left; font-weight:bold; margin:0;} 
168
 div#username { height: 17px; width:402px; background-color: #e9e9e9; min-width:250px; border: 0px groove #6799c4; text-align: left; font-weight:bold; margin:0;} 
167 169
.save_section { margin: 20px auto 5px auto; }
170

  
171

  
branches/2.8.x/wb/templates/wb_theme/templates/settings.htt
39 39
		<textarea name="website_footer" cols="50" rows="3">{WEBSITE_FOOTER}</textarea>
40 40
	</td>
41 41
</tr>
42
<!-- BEGIN show_page_level_limit_block -->
42 43
<tr{DISPLAY_ADVANCED}>
43 44
	<td class="setting_name">{TEXT_PAGE_LEVEL_LIMIT}:</td>
44 45
	<td class="setting_value" colspan="2">
......
49 50
		</select>
50 51
	</td>
51 52
</tr>
53
<!-- END show_page_level_limit_block -->
52 54
<tr>
53 55
	<td class="setting_name">{TEXT_PAGE_TRASH}:</td>
54 56
	<td class="setting_value" colspan="2">
......
62 64
		</div>
63 65
	</td>
64 66
</tr>
67
<!-- BEGIN show_checkbox_1_block -->
65 68
<tr{DISPLAY_ADVANCED}>
66 69
        <td class="setting_name">{TEXT_PAGE_LANGUAGES}:</td>
67 70
        <td class="setting_value" colspan="2">
......
80 83
		<label for="multiple_menus_false">{TEXT_DISABLED}</label>
81 84
	</td>
82 85
</tr>
86
<!-- END show_checkbox_1_block -->
83 87
<tr>
84 88
	<td class="setting_name">{TEXT_HOME_FOLDERS}:</td>
85 89
	<td class="setting_value" colspan="2">
......
89 93
		<label for="home_folders_false">{TEXT_DISABLED}</label>
90 94
	</td>
91 95
</tr>
96
<!-- BEGIN show_checkbox_2_block -->
92 97
<tr{DISPLAY_ADVANCED}>
93 98
	<td class="setting_name">{TEXT_MANAGE_SECTIONS}:</td>
94 99
	<td class="setting_value" colspan="2">
......
107 112
		<label for="section_blocks_false">{TEXT_DISABLED}</label>
108 113
	</td>
109 114
</tr>
115
<!-- END show_checkbox_2_block -->
110 116
<tr>
111 117
	<td class="setting_name">{TEXT_INTRO_PAGE}:</td>
112 118
	<td class="setting_value" colspan="2">
......
116 122
		<label for="intro_page_false">{TEXT_DISABLED}</label>
117 123
	</td>
118 124
</tr>
125
<!-- BEGIN show_checkbox_3_block -->
119 126
<tr{DISPLAY_ADVANCED}>
120 127
	<td class="setting_name">{TEXT_HOMEPAGE_REDIRECTION}:</td>
121 128
	<td class="setting_value" colspan="2">
......
134 141
		<label for="smart_login_false">{TEXT_DISABLED}</label>
135 142
	</td>
136 143
</tr>
144
<!-- END show_checkbox_3_block -->
137 145
<tr>
138 146
	<td class="setting_name">{TEXT_LOGIN}:</td>
139 147
	<td class="setting_value" colspan="2">
......
143 151
		<label for="frontend_login_false">{TEXT_DISABLED}</label>
144 152
	</td>
145 153
</tr>
154
<!-- BEGIN show_redirect_timer_block -->
146 155
<tr{DISPLAY_ADVANCED}>
147 156
	<td class="setting_name">{TEXT_REDIRECT_AFTER}:</td>
148 157
	<td class="setting_value" colspan="2">
149 158
		<input type="text" name="redirect_timer" value="{REDIRECT_TIMER}" />
150 159
	</td>
151 160
</tr>
161
<!-- END show_redirect_timer_block -->
152 162
<tr>
153 163
	<td class="setting_name">{TEXT_SIGNUP}:</td>
154 164
	<td class="setting_value" colspan="2">
......
160 170
		</select>
161 171
	</td>
162 172
</tr>
173
<!-- BEGIN show_php_error_level_block -->
163 174
<tr{DISPLAY_ADVANCED}>
164 175
	<td class="setting_name">{TEXT_PHP_ERROR_LEVEL}:</td>
165 176
	<td class="setting_value" colspan="2">
......
171 182
		</select>
172 183
	</td>
173 184
</tr>
185
<!-- END show_php_error_level_block -->
186
<!-- BEGIN show_wysiwyg_block -->
174 187
<tr{DISPLAY_ADVANCED}>
175 188
	<td class="setting_name">{TEXT_WYSIWYG_STYLE}:</td>
176 189
	<td class="setting_value" colspan="2">
......
187 200
		</select>
188 201
	</td>
189 202
</tr>
203
<!-- END show_wysiwyg_block -->
190 204
<tr>
191 205
	<td>&nbsp;</td>
192 206
	<td align="left" nowrap="nowrap">
......
212 226
		</select>
213 227
	</td>
214 228
</tr>
229
<!-- BEGIN show_charset_block -->
215 230
<tr{DISPLAY_ADVANCED}>
216 231
	<td class="setting_name">{TEXT_CHARSET}:</td>
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff