Project

General

Profile

1 1356 Luisehahne
<?php
2
/**
3
 *
4
 * @category        admin
5
 * @package         settings
6 1529 Luisehahne
 * @author          Ryan Djurovich, WebsiteBaker Project
7 1716 Luisehahne
 * @copyright       2009-2012, WebsiteBaker Org. e.V.
8 1356 Luisehahne
 * @link			http://www.websitebaker2.org/
9
 * @license         http://www.gnu.org/licenses/gpl.html
10
 * @platform        WebsiteBaker 2.8.x
11 1374 Luisehahne
 * @requirements    PHP 5.2.2 and higher
12 1356 Luisehahne
 * @version         $Id$
13
 * @filesource		$HeadURL$
14
 * @lastmodified    $Date$
15
 *
16
 */
17
18
require('../../config.php');
19
require_once(WB_PATH.'/framework/class.admin.php');
20
21
if(isset($_GET['advanced']) && $_GET['advanced'] == 'yes') {
22
	$admin = new admin('Settings', 'settings_advanced');
23
} else {
24
	$admin = new admin('Settings', 'settings_basic');
25
}
26
27 1716 Luisehahne
// add new values, later in upgrade-script
28
$cfg = array(
29
	'website_signature' => defined('WEBSITE_SIGNATURE') ? WEBSITE_SIGNATURE : '',
30
	'confirmed_registration' => (defined('CONFIRMED_REGISTRATION') ? CONFIRMED_REGISTRATION : '0'),
31
	);
32
db_update_key_value( 'settings', $cfg );
33
34 1356 Luisehahne
// Include the WB functions file
35
require_once(WB_PATH.'/framework/functions.php');
36
require_once(WB_PATH.'/framework/functions-utf8.php');
37
38 1716 Luisehahne
$mLang = ModLanguage::getInstance();
39
$mLang->setLanguage(dirname(__FILE__).'/languages/', LANGUAGE, DEFAULT_LANGUAGE);
40
41 1529 Luisehahne
// Setup template object, parse vars to it, then parse it
42 1356 Luisehahne
// Create new template object
43 1716 Luisehahne
$template = new Template(dirname($admin->correct_theme_source('settings.htt')),'keep');
44 1356 Luisehahne
// $template->debug = true;
45
$template->set_file('page',        'settings.htt');
46
$template->set_block('page',       'main_block', 'main');
47
$template->set_var('FTAN', $admin->getFTAN());
48
49
$template->set_block('main_block', 'template_list_block',         'template_list');
50
$template->set_block('main_block', 'timezone_list_block',         'timezone_list');
51
$template->set_block('main_block', 'language_list_block',         'language_list');
52
$template->set_block('main_block', 'date_format_list_block',      'date_format_list');
53
$template->set_block('main_block', 'time_format_list_block',      'time_format_list');
54
$template->set_block('main_block', 'theme_list_block',            'theme_list');
55
$template->set_block('main_block', 'search_template_list_block',  'search_template_list');
56
$template->set_block('main_block', 'group_list_block',            'group_list');
57
$template->set_block('main_block', 'charset_list_block',          'charset_list');
58
$template->set_block('main_block', 'error_reporting_list_block',  'error_reporting_list');
59
$template->set_block('main_block', 'editor_list_block',           'editor_list');
60
$template->set_block('main_block', 'page_level_limit_list_block', 'page_level_limit_list');
61
62
$template->set_block('main_block', 'show_page_level_limit_block', 'show_page_level_limit');
63
$template->set_block('main_block', 'show_checkbox_1_block',       'show_checkbox_1');
64
$template->set_block('main_block', 'show_checkbox_2_block',       'show_checkbox_2');
65
$template->set_block('main_block', 'show_checkbox_3_block',       'show_checkbox_3');
66
$template->set_block('main_block', 'show_php_error_level_block',  'show_php_error_level');
67
$template->set_block('main_block', 'show_charset_block',          'show_charset');
68
$template->set_block('main_block', 'show_wysiwyg_block',          'show_wysiwyg');
69
$template->set_block('main_block', 'show_access_block',           'show_access');
70
$template->set_block('main_block', 'show_search_block',           'show_search');
71
$template->set_block('main_block', 'show_redirect_timer_block',   'show_redirect_timer');
72
73
// Query current settings in the db, then loop through them and print them
74
$query = "SELECT * FROM ".TABLE_PREFIX."settings";
75
$results = $database->query($query);
76
while($setting = $results->fetchRow())
77
{
78
	$setting_name = $setting['name'];
79
	$setting_value = ( $setting_name != 'wbmailer_smtp_password' ) ? htmlspecialchars($setting['value']) : $setting['value'];
80
	$template->set_var(strtoupper($setting_name),$setting_value);
81
}
82
83
// Do the same for settings stored in config file as with ones in db
84
$database_type = '';
85
$is_advanced = (isset($_GET['advanced']) && $_GET['advanced'] == 'yes');
86
// Tell the browser whether or not to show advanced options
87
if($is_advanced)
88
{
89
	$template->set_var('DISPLAY_ADVANCED', '');
90
	$template->set_var('ADVANCED_FILE_PERMS_ID', 'file_perms_box');
91
	$template->set_var('BASIC_FILE_PERMS_ID', 'hide');
92
	$template->set_var('ADVANCED', 'yes');
93
	$template->set_var('ADVANCED_BUTTON', '&lt;&lt; '.$TEXT['HIDE_ADVANCED']);
94
	$template->set_var('ADVANCED_LINK', 'index.php?advanced=no');
95
96
} else {
97
	$template->set_var('DISPLAY_ADVANCED', ' style="display: none;"');
98
	$template->set_var('BASIC_FILE_PERMS_ID', 'file_perms_box');
99
	$template->set_var('ADVANCED_FILE_PERMS_ID', 'hide');
100
101
	$template->set_var('ADVANCED', 'no');
102
	$template->set_var('ADVANCED_BUTTON', $TEXT['SHOW_ADVANCED'].' &gt;&gt;');
103
	$template->set_var('ADVANCED_LINK', 'index.php?advanced=yes');
104
}
105
106
	$query = "SELECT * FROM ".TABLE_PREFIX."search WHERE extra = ''";
107
	$results = $database->query($query);
108
109
	// Query current settings in the db, then loop through them and print them
110
	while($setting = $results->fetchRow())
111
	{
112
		$setting_name = $setting['name'];
113
		$setting_value = htmlspecialchars(($setting['value']));
114
		switch($setting_name) {
115
			// Search header
116
			case 'header':
117
				$template->set_var('SEARCH_HEADER', $setting_value);
118
			break;
119
			// Search results header
120
			case 'results_header':
121
				$template->set_var('SEARCH_RESULTS_HEADER', $setting_value);
122
			break;
123
			// Search results loop
124
			case 'results_loop':
125
				$template->set_var('SEARCH_RESULTS_LOOP', $setting_value);
126
			break;
127
			// Search results footer
128
			case 'results_footer':
129
				$template->set_var('SEARCH_RESULTS_FOOTER', $setting_value);
130
			break;
131
			// Search no results
132
			case 'no_results':
133
				$template->set_var('SEARCH_NO_RESULTS', $setting_value);
134
			break;
135
			// Search footer
136
			case 'footer':
137
				$template->set_var('SEARCH_FOOTER', $setting_value);
138
			break;
139
			// Search module-order
140
			case 'module_order':
141
				$template->set_var('SEARCH_MODULE_ORDER', $setting_value);
142
			break;
143
			// Search max lines of excerpt
144
			case 'max_excerpt':
145
				$template->set_var('SEARCH_MAX_EXCERPT', $setting_value);
146
			break;
147
			// time-limit
148
			case 'time_limit':
149
				$template->set_var('SEARCH_TIME_LIMIT', $setting_value);
150
			break;
151
			// Search template
152
			case 'template':
153
				$search_template = $setting_value;
154
			break;
155
		}
156
	}
157
158 1716 Luisehahne
	$sSelected = ' selected="selected"';
159
	$checked   = ' checked="checked"';
160
/*-- insert all needed vars from language files ----------------------------------------*/
161
	$template->set_var($mLang->getLangArray());
162
163 1356 Luisehahne
	$template->set_var(array(
164
						'WB_URL' => WB_URL,
165
						'THEME_URL' => THEME_URL,
166
						'ADMIN_URL' => ADMIN_URL,
167
					 ));
168
169
	// Insert language values
170 1716 Luisehahne
	$sql  = 'SELECT `name`, `directory` FROM `'.TABLE_PREFIX.'addons` ';
171
	$sql .= 'WHERE `type` = \'language\' ';
172
	$sql .= 'AND `function` != \'theme\' ';
173
	$sql .= 'ORDER BY `directory`';
174
175
	if( ($result = $database->query($sql)) && ($result->numRows() > 0) )
176
//	$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'language' ORDER BY directory");
177
//	if($result->numRows() > 0)
178 1356 Luisehahne
	{
179
		while($addon = $result->fetchRow()) {
180 1457 Luisehahne
	        $langIcons = (empty($addon['directory'])) ? 'none' : strtolower($addon['directory']);
181
182 1435 Luisehahne
			$template->set_var('CODE',        $addon['directory']);
183
			$template->set_var('NAME',        $addon['name']);
184 1457 Luisehahne
			$template->set_var('FLAG',        THEME_URL.'/images/flags/'.$langIcons);
185 1716 Luisehahne
			$template->set_var('SELECTED',    (DEFAULT_LANGUAGE == $addon['directory'] ? $sSelected : '') );
186 1356 Luisehahne
			$template->parse('language_list', 'language_list_block', true);
187
		}
188
	}
189
190
	// Insert default timezone values
191
	require(ADMIN_PATH.'/interface/timezones.php');
192
	foreach($TIMEZONES AS $hour_offset => $title)
193
	{
194
		// Make sure we dont list "System Default" as we are setting this value!
195
		if($hour_offset != '-20') {
196
			$template->set_var('VALUE', $hour_offset);
197
			$template->set_var('NAME', $title);
198
			if(DEFAULT_TIMEZONE == $hour_offset*60*60) {
199 1716 Luisehahne
				$template->set_var('SELECTED', $sSelected);
200 1356 Luisehahne
			} else {
201
				$template->set_var('SELECTED', '');
202
			}
203
			$template->parse('timezone_list', 'timezone_list_block', true);
204
		}
205
	}
206
207
	// Insert default charset values
208
	require(ADMIN_PATH.'/interface/charsets.php');
209
	foreach($CHARSETS AS $code => $title) {
210
		$template->set_var('VALUE', $code);
211
		$template->set_var('NAME', $title);
212
		if(DEFAULT_CHARSET == $code) {
213 1716 Luisehahne
			$template->set_var('SELECTED', $sSelected);
214 1356 Luisehahne
		} else {
215
			$template->set_var('SELECTED', '');
216
		}
217
		$template->parse('charset_list', 'charset_list_block', true);
218
	}
219
220
221
	// Insert date format list
222
	require(ADMIN_PATH.'/interface/date_formats.php');
223
	foreach($DATE_FORMATS AS $format => $title) {
224
		$format = str_replace('|', ' ', $format); // Add's white-spaces (not able to be stored in array key)
225
		if($format != 'system_default') {
226
			$template->set_var('VALUE', $format);
227
		} else {
228
			$template->set_var('VALUE', '');
229
		}
230
		$template->set_var('NAME', $title);
231
		if(DEFAULT_DATE_FORMAT == $format) {
232 1716 Luisehahne
			$template->set_var('SELECTED', $sSelected);
233 1356 Luisehahne
		} else {
234
			$template->set_var('SELECTED', '');
235
		}
236
		$template->parse('date_format_list', 'date_format_list_block', true);
237
	}
238
239
	// Insert time format list
240
	require(ADMIN_PATH.'/interface/time_formats.php');
241
	foreach($TIME_FORMATS AS $format => $title) {
242
		$format = str_replace('|', ' ', $format); // Add's white-spaces (not able to be stored in array key)
243
		if($format != 'system_default') {
244
			$template->set_var('VALUE', $format);
245
		} else {
246
			$template->set_var('VALUE', '');
247
		}
248
		$template->set_var('NAME', $title);
249
		if(DEFAULT_TIME_FORMAT == $format) {
250 1716 Luisehahne
			$template->set_var('SELECTED', $sSelected);
251 1356 Luisehahne
		} else {
252
			$template->set_var('SELECTED', '');
253
		}
254
		$template->parse('time_format_list', 'time_format_list_block', true);
255
	}
256
257 1716 Luisehahne
// Insert templates
258
	$sql  = 'SELECT `name`, `directory` FROM `'.TABLE_PREFIX.'addons` ';
259
	$sql .= 'WHERE `type` = \'template\' ';
260
	$sql .= 'AND `function` != \'theme\' ';
261
	$sql .= 'ORDER BY `name`';
262
	if( ($result = $database->query($sql)) && ($result->numRows() > 0) )
263
	{
264
//	$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'template' AND function != 'theme' ORDER BY name");
265
//	if($result->numRows() > 0) {
266
		while($addon = $result->fetchRow())
267
		{
268
			if( $admin->get_permission($addon['directory'],'template' ) )
269
			{
270
				$template->set_var('FILE', $addon['directory']);
271
				$template->set_var('NAME', $addon['name']);
272
				$selected = (($addon['directory'] == DEFAULT_TEMPLATE) ? $sSelected : '');
273
				$template->set_var('SELECTED', $selected);
274
				$template->parse('template_list', 'template_list_block', true);
275
			}
276 1356 Luisehahne
		}
277
	}
278
279 1716 Luisehahne
// Insert backend theme
280
	$sql  = 'SELECT `name`, `directory` FROM `'.TABLE_PREFIX.'addons` ';
281
	$sql .= 'WHERE `type` = \'template\' ';
282
	$sql .= 'AND `function` = \'theme\' ';
283
	$sql .= 'ORDER BY `name`';
284
285
286
	if( ($result = $database->query($sql)) && ($result->numRows() > 0) )
287
	{
288
//	$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'template' AND function = 'theme' ORDER BY name");
289
//	if($result->numRows() > 0) {
290
		while($addon = $result->fetchRow())
291
		{
292
			if( $admin->get_permission($addon['directory'],'template' ) )
293
			{
294
				$template->set_var('FILE', $addon['directory']);
295
				$template->set_var('NAME', $addon['name']);
296
				$selected = (($addon['directory'] == DEFAULT_THEME) ? $sSelected : '');
297
				$template->set_var('SELECTED', $selected);
298
				$template->parse('theme_list', 'theme_list_block', true);
299
			}
300 1356 Luisehahne
		}
301
	}
302
303
	// Insert WYSIWYG modules
304
	$file='none';
305
	$module_name=$TEXT['NONE'];
306
	$template->set_var('FILE', $file);
307
	$template->set_var('NAME', $module_name);
308 1716 Luisehahne
	$selected = (!defined('WYSIWYG_EDITOR') || $file == WYSIWYG_EDITOR) ? $sSelected : '';
309 1356 Luisehahne
	$template->set_var('SELECTED', $selected);
310
	$template->parse('editor_list', 'editor_list_block', true);
311 1716 Luisehahne
	$sql  = 'SELECT `name`, `directory` FROM `'.TABLE_PREFIX.'addons` ';
312
	$sql .= 'WHERE `type` = \'module\' ';
313
	$sql .= 'AND `function` = \'wysiwyg\' ';
314
	$sql .= 'ORDER BY `name`';
315
	if( ($result = $database->query($sql)) && ($result->numRows() > 0) )
316 1356 Luisehahne
	{
317 1716 Luisehahne
//	$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'module' AND function = 'wysiwyg' ORDER BY name");
318
//	if($result->numRows() > 0)
319
//	{
320 1356 Luisehahne
		while($addon = $result->fetchRow())
321
	    {
322 1716 Luisehahne
			if( $admin->get_permission($addon['directory'],'module' ) )
323
			{
324
				$template->set_var('FILE', $addon['directory']);
325
				$template->set_var('NAME', $addon['name']);
326
				$selected = (!defined('WYSIWYG_EDITOR') || $addon['directory'] == WYSIWYG_EDITOR) ? $sSelected : '';
327
				$template->set_var('SELECTED', $selected);
328
				$template->parse('editor_list', 'editor_list_block', true);
329
			}
330 1356 Luisehahne
		}
331
	}
332
333
// Insert templates for search settings
334 1366 Luisehahne
	$search_template = ( ($search_template == DEFAULT_TEMPLATE) || ($search_template == '') ) ? '' : $search_template;
335 1716 Luisehahne
	$selected = ( ($search_template != DEFAULT_TEMPLATE) ) ?  $sSelected : '';
336 1356 Luisehahne
337
	$template->set_var(array(
338
	        'FILE' => '',
339
	        'NAME' => $TEXT['SYSTEM_DEFAULT'],
340
	        'SELECTED' => $selected
341
	    ));
342 1366 Luisehahne
	$template->parse('search_template_list', 'search_template_list_block', true);
343 1356 Luisehahne
344 1716 Luisehahne
	$sql  = 'SELECT `name`, `directory` FROM `'.TABLE_PREFIX.'addons` ';
345
	$sql .= 'WHERE `type` = \'template\' ';
346
	$sql .= 'AND `function` = \'template\' ';
347
	$sql .= 'ORDER BY `name`';
348
    if( ($result = $database->query($sql)) && ($result->numRows() > 0) )
349 1356 Luisehahne
	{
350 1716 Luisehahne
//	$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'template' AND function = 'template' ORDER BY name");
351
//	if($result->numRows() > 0)
352
//	{
353 1356 Luisehahne
		while($addon = $result->fetchRow())
354
	    {
355 1716 Luisehahne
			if( $admin->get_permission($addon['directory'],'template' ) )
356
			{
357
				$template->set_var('FILE', $addon['directory']);
358
				$template->set_var('NAME', $addon['name']);
359
		        $selected = ($addon['directory'] == $search_template) ? $sSelected :  '';
360
				$template->set_var('SELECTED', $selected);
361
				$template->parse('search_template_list', 'search_template_list_block', true);
362
			}
363 1356 Luisehahne
		}
364
	}
365
366
	// Insert default error reporting values
367
	require(ADMIN_PATH.'/interface/er_levels.php');
368
	foreach($ER_LEVELS AS $value => $title)
369
	{
370
		$template->set_var('VALUE', $value);
371
		$template->set_var('NAME', $title);
372 1716 Luisehahne
	    $selected = (ER_LEVEL == $value) ? $sSelected : '';
373 1356 Luisehahne
	    $template->set_var('SELECTED', $selected);
374
		$template->parse('error_reporting_list', 'error_reporting_list_block', true);
375
	}
376
377 1716 Luisehahne
378 1356 Luisehahne
	// Insert permissions values
379
	if($admin->get_permission('settings_advanced') != true)
380
	{
381
		$template->set_var('DISPLAY_ADVANCED_BUTTON', 'hide');
382
	}
383
384
	// Insert page level limits
385
	for($i = 1; $i <= 10; $i++)
386
	{
387
		$template->set_var('NUMBER', $i);
388
		if(PAGE_LEVEL_LIMIT == $i)
389
	    {
390 1716 Luisehahne
			$template->set_var('SELECTED', $sSelected);
391 1356 Luisehahne
		} else {
392
			$template->set_var('SELECTED', '');
393
		}
394
		$template->parse('page_level_limit_list', 'page_level_limit_list_block', true);
395
	}
396
397
	// Work-out if multiple menus feature is enabled
398
	if(defined('MULTIPLE_MENUS') && MULTIPLE_MENUS == true)
399
	{
400 1716 Luisehahne
		$template->set_var('MULTIPLE_MENUS_ENABLED', $checked);
401 1356 Luisehahne
	} else {
402 1716 Luisehahne
		$template->set_var('MULTIPLE_MENUS_DISABLED', $checked);
403 1356 Luisehahne
	}
404
405
	// Work-out if page languages feature is enabled
406
	if(defined('PAGE_LANGUAGES') && PAGE_LANGUAGES == true)
407
	{
408 1716 Luisehahne
        $template->set_var('PAGE_LANGUAGES_ENABLED', $checked);
409 1356 Luisehahne
	} else {
410 1716 Luisehahne
        $template->set_var('PAGE_LANGUAGES_DISABLED', $checked);
411 1356 Luisehahne
	}
412
413 1409 FrankH
	// Work-out if warn_page_leave feature is enabled
414
	if (defined('WARN_PAGE_LEAVE') && WARN_PAGE_LEAVE == true)
415
	{
416 1716 Luisehahne
		$template->set_var('WARN_PAGE_LEAVE_ENABLED', $checked);
417 1409 FrankH
	} else {
418 1716 Luisehahne
		$template->set_var('WARN_PAGE_LEAVE_DISABLED', $checked);
419 1409 FrankH
	}
420
421 1356 Luisehahne
	// Work-out if smart login feature is enabled
422
	if(defined('SMART_LOGIN') && SMART_LOGIN == true)
423
	{
424 1716 Luisehahne
		$template->set_var('SMART_LOGIN_ENABLED', $checked);
425 1356 Luisehahne
	} else {
426 1716 Luisehahne
		$template->set_var('SMART_LOGIN_DISABLED', $checked);
427 1356 Luisehahne
	}
428
429
	/* Make's sure GD library is installed */
430
	if(extension_loaded('gd') && function_exists('imageCreateFromJpeg'))
431
	{
432
		$template->set_var('GD_EXTENSION_ENABLED', '');
433
	} else {
434
		$template->set_var('GD_EXTENSION_ENABLED', ' style="display: none;"');
435
	}
436
437
	// Work-out if section blocks feature is enabled
438
	if(defined('SECTION_BLOCKS') && SECTION_BLOCKS == true)
439
	{
440 1716 Luisehahne
		$template->set_var('SECTION_BLOCKS_ENABLED', $checked);
441 1356 Luisehahne
	} else {
442 1716 Luisehahne
		$template->set_var('SECTION_BLOCKS_DISABLED', $checked);
443 1356 Luisehahne
	}
444
445
	// Work-out if homepage redirection feature is enabled
446
	if(defined('HOMEPAGE_REDIRECTION') && HOMEPAGE_REDIRECTION == true)
447
	{
448 1716 Luisehahne
		$template->set_var('HOMEPAGE_REDIRECTION_ENABLED', $checked);
449 1356 Luisehahne
	} else {
450 1716 Luisehahne
		$template->set_var('HOMEPAGE_REDIRECTION_DISABLED', $checked);
451 1356 Luisehahne
	}
452
453
	// Work-out which server os should be checked
454
	if(OPERATING_SYSTEM == 'linux')
455
	{
456 1716 Luisehahne
		$template->set_var('LINUX_SELECTED', $checked);
457 1356 Luisehahne
	} elseif(OPERATING_SYSTEM == 'windows') {
458 1716 Luisehahne
		$template->set_var('WINDOWS_SELECTED', $checked);
459 1356 Luisehahne
	}
460
461 1668 Luisehahne
	// Work-out if developer infos feature is enabled
462
	if(defined('DEV_INFOS') && DEV_INFOS == true)
463
	{
464 1716 Luisehahne
		$template->set_var('DEV_INFOS_ENABLED', $checked);
465 1668 Luisehahne
	} else {
466 1716 Luisehahne
		$template->set_var('DEV_INFOS_DISABLED', $checked);
467 1668 Luisehahne
	}
468
469 1356 Luisehahne
	// Work-out if manage sections feature is enabled
470
	if(MANAGE_SECTIONS)
471
	{
472 1716 Luisehahne
		$template->set_var('MANAGE_SECTIONS_ENABLED', $checked);
473 1356 Luisehahne
	} else {
474 1716 Luisehahne
		$template->set_var('MANAGE_SECTIONS_DISABLED', $checked);
475 1356 Luisehahne
	}
476
477
	// Work-out which wbmailer routine should be checked
478 1572 Luisehahne
	$template->set_var(array(
479
				'TEXT_WBMAILER_DEFAULT_SETTINGS_NOTICE' => $TEXT['WBMAILER_DEFAULT_SETTINGS_NOTICE'],
480
				'TEXT_WBMAILER_DEFAULT_SENDER_MAIL' => $TEXT['WBMAILER_DEFAULT_SENDER_MAIL'],
481
				'TEXT_WBMAILER_DEFAULT_SENDER_NAME' => $TEXT['WBMAILER_DEFAULT_SENDER_NAME'],
482
				'TEXT_WBMAILER_NOTICE' => $TEXT['WBMAILER_NOTICE'],
483
				'TEXT_WBMAILER_FUNCTION' => $TEXT['WBMAILER_FUNCTION'],
484
				'TEXT_WBMAILER_SMTP_HOST' => $TEXT['WBMAILER_SMTP_HOST'],
485
				'TEXT_WBMAILER_PHP' => $TEXT['WBMAILER_PHP'],
486
				'TEXT_WBMAILER_SMTP' => $TEXT['WBMAILER_SMTP'],
487
				'TEXT_WBMAILER_SMTP_AUTH' => $TEXT['WBMAILER_SMTP_AUTH'],
488
				'TEXT_WBMAILER_SMTP_AUTH_NOTICE' => $TEXT['REQUIRED'].' '.$TEXT['WBMAILER_SMTP_AUTH'],
489
				'TEXT_WBMAILER_SMTP_USERNAME' => $TEXT['WBMAILER_SMTP_USERNAME'],
490
				'TEXT_WBMAILER_SMTP_PASSWORD' => $TEXT['WBMAILER_SMTP_PASSWORD'],
491 1716 Luisehahne
				'SMTP_AUTH_SELECTED' => $checked
492 1572 Luisehahne
				));
493 1356 Luisehahne
	if(WBMAILER_ROUTINE == 'phpmail')
494
	{
495 1716 Luisehahne
		$template->set_var('PHPMAIL_SELECTED', $checked);
496 1356 Luisehahne
		$template->set_var('SMTP_VISIBILITY', ' style="display: none;"');
497 1572 Luisehahne
		$template->set_var('SMTP_VISIBILITY_AUTH', '');
498
		// $template->set_var('SMTP_AUTH_SELECTED', '');
499 1356 Luisehahne
	} elseif(WBMAILER_ROUTINE == 'smtp')
500
	{
501 1716 Luisehahne
		$template->set_var('SMTPMAIL_SELECTED', $checked);
502 1356 Luisehahne
		$template->set_var('SMTP_VISIBILITY', '');
503 1572 Luisehahne
		$template->set_var('SMTP_VISIBILITY_AUTH', '');
504 1356 Luisehahne
	}
505 1572 Luisehahne
/* deprecated
506 1356 Luisehahne
	// Work-out if SMTP authentification should be checked
507
	if(WBMAILER_SMTP_AUTH)
508
	{
509 1716 Luisehahne
		$template->set_var('SMTP_AUTH_SELECTED', $checked);
510 1356 Luisehahne
		if(WBMAILER_ROUTINE == 'smtp')
511
	    {
512
			$template->set_var('SMTP_VISIBILITY_AUTH', '');
513
514
		} else {
515
			$template->set_var('SMTP_VISIBILITY_AUTH', ' style="display: none;"');
516
		}
517
	} else {
518
		$template->set_var('SMTP_VISIBILITY_AUTH', ' style="display: none;"');
519
	}
520 1572 Luisehahne
*/
521 1356 Luisehahne
	// Work-out if intro feature is enabled
522
	if(INTRO_PAGE)
523
	{
524 1716 Luisehahne
		$template->set_var('INTRO_PAGE_ENABLED', $checked);
525 1356 Luisehahne
	} else {
526 1716 Luisehahne
		$template->set_var('INTRO_PAGE_DISABLED', $checked);
527 1356 Luisehahne
	}
528
529
	// Work-out if frontend login feature is enabled
530
	if(FRONTEND_LOGIN)
531
	{
532 1716 Luisehahne
		$template->set_var('PRIVATE_ENABLED', $checked);
533 1356 Luisehahne
	} else {
534 1716 Luisehahne
		$template->set_var('PRIVATE_DISABLED', $checked);
535 1356 Luisehahne
	}
536 1716 Luisehahne
	// Work-out if frontend login feature is enabled
537 1356 Luisehahne
538 1716 Luisehahne
	if(CONFIRMED_REGISTRATION)
539
	{
540
		$template->set_var('CONFIRMED_REGISTRATION_ENABLED', $checked);
541
	} else {
542
		$template->set_var('CONFIRMED_REGISTRATION_DISABLED', $checked);
543
	}
544
545 1356 Luisehahne
	// Work-out if page trash feature is disabled, in-line, or separate
546
	if(PAGE_TRASH == 'disabled')
547
	{
548 1716 Luisehahne
		$template->set_var('PAGE_TRASH_DISABLED', $checked);
549 1356 Luisehahne
		$template->set_var('DISPLAY_PAGE_TRASH_SEPARATE', 'display: none;');
550
	} elseif(PAGE_TRASH == 'inline')
551
	{
552 1716 Luisehahne
		$template->set_var('PAGE_TRASH_INLINE', $checked);
553 1356 Luisehahne
		$template->set_var('DISPLAY_PAGE_TRASH_SEPARATE', 'display: none;');
554
	} elseif(PAGE_TRASH == 'separate')
555
	{
556 1716 Luisehahne
		$template->set_var('PAGE_TRASH_SEPARATE', $checked);
557 1356 Luisehahne
		$template->set_var('DISPLAY_PAGE_TRASH_SEPARATE', 'display: inline;');
558
	}
559
560
	// Work-out if media home folde feature is enabled
561
	if(HOME_FOLDERS)
562
	{
563 1716 Luisehahne
		$template->set_var('HOME_FOLDERS_ENABLED', $checked);
564 1356 Luisehahne
	} else {
565 1716 Luisehahne
		$template->set_var('HOME_FOLDERS_DISABLED', $checked);
566 1356 Luisehahne
	}
567
568
	// Insert search select
569
	if(SEARCH == 'private')
570
	{
571 1716 Luisehahne
		$template->set_var('PRIVATE_SEARCH', $sSelected);
572 1356 Luisehahne
	} elseif(SEARCH == 'registered') {
573 1716 Luisehahne
		$template->set_var('REGISTERED_SEARCH', $sSelected);
574 1356 Luisehahne
	} elseif(SEARCH == 'none') {
575 1716 Luisehahne
		$template->set_var('NONE_SEARCH', $sSelected);
576 1356 Luisehahne
	}
577
578
	// Work-out if 777 permissions are set
579
	if(STRING_FILE_MODE == '0777' AND STRING_DIR_MODE == '0777')
580
	{
581 1716 Luisehahne
		$template->set_var('WORLD_WRITEABLE_SELECTED', $checked);
582 1356 Luisehahne
	}
583
584
	// Work-out which file mode boxes are checked
585
	if(extract_permission(STRING_FILE_MODE, 'u', 'r'))
586
	{
587 1716 Luisehahne
		$template->set_var('FILE_U_R_CHECKED', $checked);
588 1356 Luisehahne
	}
589
	if(extract_permission(STRING_FILE_MODE, 'u', 'w'))
590
	{
591 1716 Luisehahne
		$template->set_var('FILE_U_W_CHECKED', $checked);
592 1356 Luisehahne
	}
593
	if(extract_permission(STRING_FILE_MODE, 'u', 'e'))
594
	{
595 1716 Luisehahne
		$template->set_var('FILE_U_E_CHECKED', $checked);
596 1356 Luisehahne
	}
597
	if(extract_permission(STRING_FILE_MODE, 'g', 'r'))
598
	{
599 1716 Luisehahne
		$template->set_var('FILE_G_R_CHECKED', $checked);
600 1356 Luisehahne
	}
601
	if(extract_permission(STRING_FILE_MODE, 'g', 'w'))
602
	{
603 1716 Luisehahne
		$template->set_var('FILE_G_W_CHECKED', $checked);
604 1356 Luisehahne
	}
605
	if(extract_permission(STRING_FILE_MODE, 'g', 'e'))
606
	{
607 1716 Luisehahne
		$template->set_var('FILE_G_E_CHECKED', $checked);
608 1356 Luisehahne
	}
609
	if(extract_permission(STRING_FILE_MODE, 'o', 'r'))
610
	{
611 1716 Luisehahne
		$template->set_var('FILE_O_R_CHECKED', $checked);
612 1356 Luisehahne
	}
613
	if(extract_permission(STRING_FILE_MODE, 'o', 'w'))
614
	{
615 1716 Luisehahne
		$template->set_var('FILE_O_W_CHECKED', $checked);
616 1356 Luisehahne
	}
617
	if(extract_permission(STRING_FILE_MODE, 'o', 'e'))
618
	{
619 1716 Luisehahne
		$template->set_var('FILE_O_E_CHECKED', $checked);
620 1356 Luisehahne
	}
621
	// Work-out which dir mode boxes are checked
622
	if(extract_permission(STRING_DIR_MODE, 'u', 'r'))
623
	{
624 1716 Luisehahne
		$template->set_var('DIR_U_R_CHECKED', $checked);
625 1356 Luisehahne
	}
626
	if(extract_permission(STRING_DIR_MODE, 'u', 'w'))
627
	{
628 1716 Luisehahne
		$template->set_var('DIR_U_W_CHECKED', $checked);
629 1356 Luisehahne
	}
630
	if(extract_permission(STRING_DIR_MODE, 'u', 'e'))
631
	{
632 1716 Luisehahne
		$template->set_var('DIR_U_E_CHECKED', $checked);
633 1356 Luisehahne
	}
634
	if(extract_permission(STRING_DIR_MODE, 'g', 'r'))
635
	{
636 1716 Luisehahne
		$template->set_var('DIR_G_R_CHECKED', $checked);
637 1356 Luisehahne
	}
638
	if(extract_permission(STRING_DIR_MODE, 'g', 'w'))
639
	{
640 1716 Luisehahne
		$template->set_var('DIR_G_W_CHECKED', $checked);
641 1356 Luisehahne
	}
642
	if(extract_permission(STRING_DIR_MODE, 'g', 'e'))
643
	{
644 1716 Luisehahne
		$template->set_var('DIR_G_E_CHECKED', $checked);
645 1356 Luisehahne
	}
646
	if(extract_permission(STRING_DIR_MODE, 'o', 'r'))
647
	{
648 1716 Luisehahne
		$template->set_var('DIR_O_R_CHECKED', $checked);
649 1356 Luisehahne
	}
650
	if(extract_permission(STRING_DIR_MODE, 'o', 'w'))
651
	{
652 1716 Luisehahne
		$template->set_var('DIR_O_W_CHECKED', $checked);
653 1356 Luisehahne
	}
654
	if(extract_permission(STRING_DIR_MODE, 'o', 'e'))
655
	{
656 1716 Luisehahne
		$template->set_var('DIR_O_E_CHECKED', $checked);
657 1356 Luisehahne
	}
658
659
	$template->set_var(array(
660
						'PAGES_DIRECTORY' => PAGES_DIRECTORY,
661 1668 Luisehahne
						'PAGE_ICON_DIR'   => PAGE_ICON_DIR,
662 1356 Luisehahne
						'MEDIA_DIRECTORY' => MEDIA_DIRECTORY,
663
						'PAGE_EXTENSION' => PAGE_EXTENSION,
664
						'PAGE_SPACER' => PAGE_SPACER,
665
						'TABLE_PREFIX' => TABLE_PREFIX
666
					 ));
667
668
	// Insert Server Email value into template
669
	$template->set_var('SERVER_EMAIL', SERVER_EMAIL);
670
671
	// Insert groups into signup list
672
	$results = $database->query("SELECT group_id, name FROM ".TABLE_PREFIX."groups WHERE group_id != '1'");
673
	if($results->numRows() > 0)
674
	{
675
		while($group = $results->fetchRow())
676
	    {
677
			$template->set_var('ID', $group['group_id']);
678
			$template->set_var('NAME', $group['name']);
679
			if(FRONTEND_SIGNUP == $group['group_id'])
680
	        {
681 1716 Luisehahne
				$template->set_var('SELECTED', $sSelected);
682 1356 Luisehahne
			} else {
683
				$template->set_var('SELECTED', '');
684
			}
685
			$template->parse('group_list', 'group_list_block', true);
686
		}
687
	} else {
688
		$template->set_var('ID', 'disabled');
689
		$template->set_var('NAME', $MESSAGE['GROUPS']['NO_GROUPS_FOUND']);
690
		$template->parse('group_list', 'group_list_block', true);
691
	}
692
693
	// Insert language headings
694
	$template->set_var(array(
695 1572 Luisehahne
					'HEADING_GENERAL_SETTINGS' => $HEADING['GENERAL_SETTINGS'],
696
					'HEADING_DEFAULT_SETTINGS' => $HEADING['DEFAULT_SETTINGS'],
697
					'HEADING_SEARCH_SETTINGS' => $HEADING['SEARCH_SETTINGS'],
698
					'HEADING_SERVER_SETTINGS' => $HEADING['SERVER_SETTINGS'],
699
					'HEADING_WBMAILER_SETTINGS' => $HEADING['WBMAILER_SETTINGS'],
700
					'HEADING_ADMINISTRATION_TOOLS' => $HEADING['ADMINISTRATION_TOOLS']
701
					)
702
			);
703 1356 Luisehahne
	// Insert language text and messages
704
	$template->set_var(array(
705 1572 Luisehahne
					'TEXT_WEBSITE_TITLE' => $TEXT['WEBSITE_TITLE'],
706
					'TEXT_WEBSITE_DESCRIPTION' => $TEXT['WEBSITE_DESCRIPTION'],
707
					'TEXT_WEBSITE_KEYWORDS' => $TEXT['WEBSITE_KEYWORDS'],
708
					'TEXT_WEBSITE_HEADER' => $TEXT['WEBSITE_HEADER'],
709
					'TEXT_WEBSITE_FOOTER' => $TEXT['WEBSITE_FOOTER'],
710
					'TEXT_HEADER' => $TEXT['HEADER'],
711
					'TEXT_FOOTER' => $TEXT['FOOTER'],
712
					'TEXT_VISIBILITY' => $TEXT['VISIBILITY'],
713
					'TEXT_RESULTS_HEADER' => $TEXT['RESULTS_HEADER'],
714
					'TEXT_RESULTS_LOOP' => $TEXT['RESULTS_LOOP'],
715
					'TEXT_RESULTS_FOOTER' => $TEXT['RESULTS_FOOTER'],
716
					'TEXT_NO_RESULTS' => $TEXT['NO_RESULTS'],
717
					'TEXT_TEXT' => $TEXT['TEXT'],
718
					'TEXT_DEFAULT' => $TEXT['DEFAULT'],
719
					'TEXT_LANGUAGE' => $TEXT['LANGUAGE'],
720
					'TEXT_TIMEZONE' => $TEXT['TIMEZONE'],
721
					'TEXT_CHARSET' => $TEXT['CHARSET'],
722
					'TEXT_DATE_FORMAT' => $TEXT['DATE_FORMAT'],
723
					'TEXT_TIME_FORMAT' => $TEXT['TIME_FORMAT'],
724
					'TEXT_TEMPLATE' => $TEXT['TEMPLATE'],
725
					'TEXT_THEME' => $TEXT['THEME'],
726
					'TEXT_WYSIWYG_EDITOR' => $TEXT['WYSIWYG_EDITOR'],
727
					'TEXT_PAGE_LEVEL_LIMIT' => $TEXT['PAGE_LEVEL_LIMIT'],
728
					'TEXT_INTRO_PAGE' => $TEXT['INTRO_PAGE'],
729
					'TEXT_FRONTEND' => $TEXT['FRONTEND'],
730
					'TEXT_LOGIN' => $TEXT['LOGIN'],
731
					'TEXT_REDIRECT_AFTER' => $TEXT['REDIRECT_AFTER'],
732 1716 Luisehahne
					'TEXT_SIGNUP' => $TEXT['SIGNUP'].' '.$TEXT['GROUP'],
733 1572 Luisehahne
					'TEXT_PHP_ERROR_LEVEL' => $TEXT['PHP_ERROR_LEVEL'],
734 1668 Luisehahne
					'TEXT_MULTILINGUAL' => $TEXT['MULTILINGUAL'],
735
					'TEXT_DEV_INFOS' => $TEXT['DEV_INFOS'],
736 1572 Luisehahne
					'TEXT_PAGES_DIRECTORY' => $TEXT['PAGES_DIRECTORY'],
737 1668 Luisehahne
					'TEXT_PAGE_ICON_DIR' => $TEXT['PAGE_ICON_DIR'],
738 1572 Luisehahne
					'TEXT_MEDIA_DIRECTORY' => $TEXT['MEDIA_DIRECTORY'],
739
					'TEXT_PAGE_EXTENSION' => $TEXT['PAGE_EXTENSION'],
740
					'TEXT_PAGE_SPACER' => $TEXT['PAGE_SPACER'],
741
					'TEXT_RENAME_FILES_ON_UPLOAD' => $TEXT['RENAME_FILES_ON_UPLOAD'],
742
					'TEXT_APP_NAME' => $TEXT['APP_NAME'],
743
					'TEXT_SESSION_IDENTIFIER' => $TEXT['SESSION_IDENTIFIER'],
744
					'TEXT_SEC_ANCHOR' => $TEXT['SEC_ANCHOR'],
745
					'TEXT_SERVER_OPERATING_SYSTEM' => $TEXT['SERVER_OPERATING_SYSTEM'],
746
					'TEXT_LINUX_UNIX_BASED' => $TEXT['LINUX_UNIX_BASED'],
747
					'TEXT_WINDOWS' => $TEXT['WINDOWS'],
748
					'TEXT_ADMIN' => $TEXT['ADMIN'],
749
					'TEXT_TYPE' => $TEXT['TYPE'],
750
					'TEXT_DATABASE' => $TEXT['DATABASE'],
751
					'TEXT_HOST' => $TEXT['HOST'],
752
					'TEXT_USERNAME' => $TEXT['USERNAME'],
753
					'TEXT_PASSWORD' => $TEXT['PASSWORD'],
754
					'TEXT_NAME' => $TEXT['NAME'],
755
					'TEXT_TABLE_PREFIX' => $TEXT['TABLE_PREFIX'],
756
					'TEXT_SAVE' => $TEXT['SAVE'],
757
					'TEXT_RESET' => $TEXT['RESET'],
758
					'TEXT_CHANGES' => $TEXT['CHANGES'],
759
					'TEXT_ENABLED' => $TEXT['ENABLED'],
760
					'TEXT_DISABLED' => $TEXT['DISABLED'],
761
					'TEXT_MANAGE_SECTIONS' => $HEADING['MANAGE_SECTIONS'],
762
					'TEXT_MANAGE' => $TEXT['MANAGE'],
763
					'TEXT_SEARCH' => $TEXT['SEARCH'],
764
					'TEXT_PUBLIC' => $TEXT['PUBLIC'],
765
					'TEXT_PRIVATE' => $TEXT['PRIVATE'],
766
					'TEXT_REGISTERED' => $TEXT['REGISTERED'],
767
					'TEXT_NONE' => $TEXT['NONE'],
768
					'TEXT_FILES' => strtoupper(substr($TEXT['FILES'], 0, 1)).substr($TEXT['FILES'], 1),
769
					'TEXT_DIRECTORIES' => $TEXT['DIRECTORIES'],
770
					'TEXT_FILESYSTEM_PERMISSIONS' => $TEXT['FILESYSTEM_PERMISSIONS'],
771
					'TEXT_USER' => $TEXT['USER'],
772
					'TEXT_GROUP' => $TEXT['GROUP'],
773
					'TEXT_OTHERS' => $TEXT['OTHERS'],
774
					'TEXT_READ' => $TEXT['READ'],
775
					'TEXT_WRITE' => $TEXT['WRITE'],
776
					'TEXT_EXECUTE' => $TEXT['EXECUTE'],
777
					'TEXT_WARN_PAGE_LEAVE' => '',
778
					'TEXT_SMART_LOGIN' => $TEXT['SMART_LOGIN'],
779 1716 Luisehahne
					'TEXT_CONFIRMED_REGISTRATION' => $TEXT['EMAIL'].' '.$TEXT['SIGNUP'],
780 1572 Luisehahne
					'TEXT_MULTIPLE_MENUS' => $TEXT['MULTIPLE_MENUS'],
781
					'TEXT_HOMEPAGE_REDIRECTION' => $TEXT['HOMEPAGE_REDIRECTION'],
782
					'TEXT_SECTION_BLOCKS' => $TEXT['SECTION_BLOCKS'],
783
					'TEXT_PLEASE_SELECT' => $TEXT['PLEASE_SELECT'],
784
					'TEXT_PAGE_TRASH' => $TEXT['PAGE_TRASH'],
785
					'TEXT_PAGE_LANGUAGES' => $TEXT['PAGE_LANGUAGES'],
786
					'TEXT_INLINE' => $TEXT['INLINE'],
787
					'TEXT_SEPARATE' => $TEXT['SEPARATE'],
788
					'TEXT_HOME_FOLDERS' => $TEXT['HOME_FOLDERS'],
789
					'TEXT_WYSIWYG_STYLE' => $TEXT['WYSIWYG_STYLE'],
790
					'TEXT_WORLD_WRITEABLE_FILE_PERMISSIONS' => $TEXT['WORLD_WRITEABLE_FILE_PERMISSIONS'],
791
					'MODE_SWITCH_WARNING' => $MESSAGE['SETTINGS']['MODE_SWITCH_WARNING'],
792
					'WORLD_WRITEABLE_WARNING' => $MESSAGE['SETTINGS']['WORLD_WRITEABLE_WARNING'],
793
					'TEXT_MODULE_ORDER' => $TEXT['MODULE_ORDER'],
794
					'TEXT_MAX_EXCERPT' => $TEXT['MAX_EXCERPT'],
795
					'TEXT_TIME_LIMIT' => $TEXT['TIME_LIMIT']
796
					));
797 1356 Luisehahne
798
if($is_advanced)
799
{
800
	$template->parse('show_page_level_limit', 'show_page_level_limit_block', true);
801
	$template->parse('show_checkbox_1',       'show_checkbox_1_block', true);
802
 	$template->parse('show_checkbox_2',       'show_checkbox_2_block', true);
803
	$template->parse('show_checkbox_3',       'show_checkbox_3_block', true);
804
	$template->parse('show_php_error_level',  'show_php_error_level_block', true);
805
	$template->parse('show_charset',          'show_charset_block', true);
806
	$template->parse('show_wysiwyg',          'show_wysiwyg_block', true);
807
	$template->parse('show_search',           'show_search_block', false);
808
	$template->parse('show_redirect_timer',   'show_redirect_timer_block', true);
809
}else {
810
	$template->set_block('show_page_level_limit', '');
811
	$template->set_block('show_checkbox_1', '');
812
	$template->set_block('show_checkbox_2', '');
813
	$template->set_block('show_checkbox_3', '');
814
	$template->set_block('show_php_error_level', '');
815
	$template->set_block('show_charset', '');
816
	$template->set_block('show_wysiwyg', '');
817
	$template->set_block('show_search', '');
818
	$template->set_block('show_redirect_timer', '');
819
}
820 1572 Luisehahne
if($is_advanced && $admin->get_user_id()=='1')
821
{
822
	$template->parse('show_access', 'show_access_block', true);
823
}else {
824
	$template->set_block('show_access', '');
825
}
826 1356 Luisehahne
827
// Parse template objects output
828
$template->parse('main', 'main_block', false);
829
$template->pparse('output', 'page');
830
831
$admin->print_footer();