Project

General

Profile

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