Project

General

Profile

1
<?php
2
/**
3
 *
4
 * @category        admin
5
 * @package         settings
6
 * @author          WebsiteBaker Project
7
 * @copyright       2004-2009, Ryan Djurovich
8
 * @copyright       2009-2011, Website Baker Org. e.V.
9
 * @link			http://www.websitebaker2.org/
10
 * @license         http://www.gnu.org/licenses/gpl.html
11
 * @platform        WebsiteBaker 2.8.x
12
 * @requirements    PHP 5.2.2 and higher
13
 * @version         $Id: index.php 1441 2011-04-09 23:04:22Z Luisehahne $
14
 * @filesource		$HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/admin/settings/index.php $
15
 * @lastmodified    $Date: 2011-04-10 01:04:22 +0200 (Sun, 10 Apr 2011) $
16
 *
17
 */
18

    
19
require('../../config.php');
20
require_once(WB_PATH.'/framework/class.admin.php');
21

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

    
28
// Include the WB functions file
29
require_once(WB_PATH.'/framework/functions.php');
30
require_once(WB_PATH.'/framework/functions-utf8.php');
31

    
32
// Create new template object
33
$template = new Template(THEME_PATH.'/templates');
34
// $template->debug = true;
35

    
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
	$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'language' ORDER BY directory");
157
	if($result->numRows() > 0)
158
	{
159
		while($addon = $result->fetchRow()) {
160
			$template->set_var('CODE',        $addon['directory']);
161
			$template->set_var('NAME',        $addon['name']);
162
			$template->set_var('FLAG',        THEME_URL.'/images/flags/'.strtolower($addon['directory']));
163
			$template->set_var('SELECTED',    (DEFAULT_LANGUAGE == $addon['directory'] ? ' selected="selected"' : '') );
164
			$template->parse('language_list', 'language_list_block', true);
165
		}
166
	}
167

    
168
	// Insert default timezone values
169
	require(ADMIN_PATH.'/interface/timezones.php');
170
	foreach($TIMEZONES AS $hour_offset => $title)
171
	{
172
		// Make sure we dont list "System Default" as we are setting this value!
173
		if($hour_offset != '-20') {
174
			$template->set_var('VALUE', $hour_offset);
175
			$template->set_var('NAME', $title);
176
			if(DEFAULT_TIMEZONE == $hour_offset*60*60) {
177
				$template->set_var('SELECTED', ' selected="selected"');
178
			} else {
179
				$template->set_var('SELECTED', '');
180
			}
181
			$template->parse('timezone_list', 'timezone_list_block', true);
182
		}
183
	}
184

    
185
	// Insert default charset values
186
	require(ADMIN_PATH.'/interface/charsets.php');
187
	foreach($CHARSETS AS $code => $title) {
188
		$template->set_var('VALUE', $code);
189
		$template->set_var('NAME', $title);
190
		if(DEFAULT_CHARSET == $code) {
191
			$template->set_var('SELECTED', ' selected="selected"');
192
		} else {
193
			$template->set_var('SELECTED', '');
194
		}
195
		$template->parse('charset_list', 'charset_list_block', true);
196
	}
197

    
198

    
199
	// Insert date format list
200
	require(ADMIN_PATH.'/interface/date_formats.php');
201
	foreach($DATE_FORMATS AS $format => $title) {
202
		$format = str_replace('|', ' ', $format); // Add's white-spaces (not able to be stored in array key)
203
		if($format != 'system_default') {
204
			$template->set_var('VALUE', $format);
205
		} else {
206
			$template->set_var('VALUE', '');
207
		}
208
		$template->set_var('NAME', $title);
209
		if(DEFAULT_DATE_FORMAT == $format) {
210
			$template->set_var('SELECTED', ' selected="selected"');
211
		} else {
212
			$template->set_var('SELECTED', '');
213
		}
214
		$template->parse('date_format_list', 'date_format_list_block', true);
215
	}
216

    
217
	// Insert time format list
218
	require(ADMIN_PATH.'/interface/time_formats.php');
219
	foreach($TIME_FORMATS AS $format => $title) {
220
		$format = str_replace('|', ' ', $format); // Add's white-spaces (not able to be stored in array key)
221
		if($format != 'system_default') {
222
			$template->set_var('VALUE', $format);
223
		} else {
224
			$template->set_var('VALUE', '');
225
		}
226
		$template->set_var('NAME', $title);
227
		if(DEFAULT_TIME_FORMAT == $format) {
228
			$template->set_var('SELECTED', ' selected="selected"');
229
		} else {
230
			$template->set_var('SELECTED', '');
231
		}
232
		$template->parse('time_format_list', 'time_format_list_block', true);
233
	}
234

    
235
	// Insert templates
236
	$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'template' AND function != 'theme' ORDER BY name");
237
	if($result->numRows() > 0) {
238
		while($addon = $result->fetchRow()) {
239
			$template->set_var('FILE', $addon['directory']);
240
			$template->set_var('NAME', $addon['name']);
241
			if(($addon['directory'] == DEFAULT_TEMPLATE) ? $selected = ' selected="selected"' : $selected = '');
242
			$template->set_var('SELECTED', $selected);
243
			$template->parse('template_list', 'template_list_block', true);
244
		}
245
	}
246

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

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

    
280
// Insert templates for search settings
281
	$search_template = ( ($search_template == DEFAULT_TEMPLATE) || ($search_template == '') ) ? '' : $search_template;
282
	$selected = ( ($search_template != DEFAULT_TEMPLATE) ) ?  ' selected="selected"' : $selected = '';
283

    
284
	$template->set_var(array(
285
	        'FILE' => '',
286
	        'NAME' => $TEXT['SYSTEM_DEFAULT'],
287
	        'SELECTED' => $selected
288
	    ));
289
	$template->parse('search_template_list', 'search_template_list_block', true);
290

    
291
	$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'template' AND function = 'template' ORDER BY name");
292
	if($result->numRows() > 0)
293
	{
294
		while($addon = $result->fetchRow())
295
	    {
296
			$template->set_var('FILE', $addon['directory']);
297
			$template->set_var('NAME', $addon['name']);
298
	        $selected = ($addon['directory'] == $search_template) ? ' selected="selected"' :  $selected = '';
299
			$template->set_var('SELECTED', $selected);
300
			$template->parse('search_template_list', 'search_template_list_block', true);
301

    
302
		}
303
	}
304

    
305
	// Insert default error reporting values
306
	require(ADMIN_PATH.'/interface/er_levels.php');
307
	foreach($ER_LEVELS AS $value => $title)
308
	{
309
		$template->set_var('VALUE', $value);
310
		$template->set_var('NAME', $title);
311
	    $selected = (ER_LEVEL == $value) ? ' selected="selected"' : '';
312
	    $template->set_var('SELECTED', $selected);
313
		$template->parse('error_reporting_list', 'error_reporting_list_block', true);
314
	}
315

    
316
	// Insert permissions values
317
	if($admin->get_permission('settings_advanced') != true)
318
	{
319
		$template->set_var('DISPLAY_ADVANCED_BUTTON', 'hide');
320
	}
321

    
322
	// Insert page level limits
323
	for($i = 1; $i <= 10; $i++)
324
	{
325
		$template->set_var('NUMBER', $i);
326
		if(PAGE_LEVEL_LIMIT == $i)
327
	    {
328
			$template->set_var('SELECTED', ' selected="selected"');
329
		} else {
330
			$template->set_var('SELECTED', '');
331
		}
332
		$template->parse('page_level_limit_list', 'page_level_limit_list_block', true);
333
	}
334

    
335
	// Work-out if multiple menus feature is enabled
336
	if(defined('MULTIPLE_MENUS') && MULTIPLE_MENUS == true)
337
	{
338
		$template->set_var('MULTIPLE_MENUS_ENABLED', ' checked="checked"');
339
	} else {
340
		$template->set_var('MULTIPLE_MENUS_DISABLED', ' checked="checked"');
341
	}
342

    
343
	// Work-out if page languages feature is enabled
344
	if(defined('PAGE_LANGUAGES') && PAGE_LANGUAGES == true)
345
	{
346
	        $template->set_var('PAGE_LANGUAGES_ENABLED', ' checked="checked"');
347
	} else {
348
	        $template->set_var('PAGE_LANGUAGES_DISABLED', ' checked="checked"');
349
	}
350

    
351
	// Work-out if warn_page_leave feature is enabled
352
	if (defined('WARN_PAGE_LEAVE') && WARN_PAGE_LEAVE == true)
353
	{
354
		$template->set_var('WARN_PAGE_LEAVE_ENABLED', ' checked="checked"');
355
	} else {
356
		$template->set_var('WARN_PAGE_LEAVE_DISABLED', ' checked="checked"');
357
	}
358

    
359
	// Work-out if smart login feature is enabled
360
	if(defined('SMART_LOGIN') && SMART_LOGIN == true)
361
	{
362
		$template->set_var('SMART_LOGIN_ENABLED', ' checked="checked"');
363
	} else {
364
		$template->set_var('SMART_LOGIN_DISABLED', ' checked="checked"');
365
	}
366

    
367
	/* Make's sure GD library is installed */
368
	if(extension_loaded('gd') && function_exists('imageCreateFromJpeg'))
369
	{
370
		$template->set_var('GD_EXTENSION_ENABLED', '');
371
	} else {
372
		$template->set_var('GD_EXTENSION_ENABLED', ' style="display: none;"');
373
	}
374

    
375
	// Work-out if section blocks feature is enabled
376
	if(defined('SECTION_BLOCKS') && SECTION_BLOCKS == true)
377
	{
378
		$template->set_var('SECTION_BLOCKS_ENABLED', ' checked="checked"');
379
	} else {
380
		$template->set_var('SECTION_BLOCKS_DISABLED', ' checked="checked"');
381
	}
382

    
383
	// Work-out if homepage redirection feature is enabled
384
	if(defined('HOMEPAGE_REDIRECTION') && HOMEPAGE_REDIRECTION == true)
385
	{
386
		$template->set_var('HOMEPAGE_REDIRECTION_ENABLED', ' checked="checked"');
387
	} else {
388
		$template->set_var('HOMEPAGE_REDIRECTION_DISABLED', ' checked="checked"');
389
	}
390

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

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

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

    
419
	// Work-out if SMTP authentification should be checked
420
	if(WBMAILER_SMTP_AUTH)
421
	{
422
		$template->set_var('SMTP_AUTH_SELECTED', ' checked="checked"');
423
		if(WBMAILER_ROUTINE == 'smtp')
424
	    {
425
			$template->set_var('SMTP_VISIBILITY_AUTH', '');
426

    
427
		} else {
428
			$template->set_var('SMTP_VISIBILITY_AUTH', ' style="display: none;"');
429
		}
430
	} else {
431
		$template->set_var('SMTP_VISIBILITY_AUTH', ' style="display: none;"');
432
	}
433

    
434
	// Work-out if intro feature is enabled
435
	if(INTRO_PAGE)
436
	{
437
		$template->set_var('INTRO_PAGE_ENABLED', ' checked="checked"');
438
	} else {
439
		$template->set_var('INTRO_PAGE_DISABLED', ' checked="checked"');
440
	}
441

    
442
	// Work-out if frontend login feature is enabled
443
	if(FRONTEND_LOGIN)
444
	{
445
		$template->set_var('PRIVATE_ENABLED', ' checked="checked"');
446
	} else {
447
		$template->set_var('PRIVATE_DISABLED', ' checked="checked"');
448
	}
449

    
450
	// Work-out if page trash feature is disabled, in-line, or separate
451
	if(PAGE_TRASH == 'disabled')
452
	{
453
		$template->set_var('PAGE_TRASH_DISABLED', ' checked="checked"');
454
		$template->set_var('DISPLAY_PAGE_TRASH_SEPARATE', 'display: none;');
455
	} elseif(PAGE_TRASH == 'inline')
456
	{
457
		$template->set_var('PAGE_TRASH_INLINE', ' checked="checked"');
458
		$template->set_var('DISPLAY_PAGE_TRASH_SEPARATE', 'display: none;');
459
	} elseif(PAGE_TRASH == 'separate')
460
	{
461
		$template->set_var('PAGE_TRASH_SEPARATE', ' checked="checked"');
462
		$template->set_var('DISPLAY_PAGE_TRASH_SEPARATE', 'display: inline;');
463
	}
464

    
465
	// Work-out if media home folde feature is enabled
466
	if(HOME_FOLDERS)
467
	{
468
		$template->set_var('HOME_FOLDERS_ENABLED', ' checked="checked"');
469
	} else {
470
		$template->set_var('HOME_FOLDERS_DISABLED', ' checked="checked"');
471
	}
472

    
473
	// Insert search select
474
	if(SEARCH == 'private')
475
	{
476
		$template->set_var('PRIVATE_SEARCH', ' selected="selected"');
477
	} elseif(SEARCH == 'registered') {
478
		$template->set_var('REGISTERED_SEARCH', ' selected="selected"');
479
	} elseif(SEARCH == 'none') {
480
		$template->set_var('NONE_SEARCH', ' selected="selected"');
481
	}
482

    
483
	// Work-out if 777 permissions are set
484
	if(STRING_FILE_MODE == '0777' AND STRING_DIR_MODE == '0777')
485
	{
486
		$template->set_var('WORLD_WRITEABLE_SELECTED', ' checked="checked"');
487
	}
488

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

    
564
	$template->set_var(array(
565
						'PAGES_DIRECTORY' => PAGES_DIRECTORY,
566
						'MEDIA_DIRECTORY' => MEDIA_DIRECTORY,
567
						'PAGE_EXTENSION' => PAGE_EXTENSION,
568
						'PAGE_SPACER' => PAGE_SPACER,
569
						'TABLE_PREFIX' => TABLE_PREFIX
570
					 ));
571

    
572
	// Insert Server Email value into template
573
	$template->set_var('SERVER_EMAIL', SERVER_EMAIL);
574

    
575
	// Insert groups into signup list
576
	$results = $database->query("SELECT group_id, name FROM ".TABLE_PREFIX."groups WHERE group_id != '1'");
577
	if($results->numRows() > 0)
578
	{
579
		while($group = $results->fetchRow())
580
	    {
581
			$template->set_var('ID', $group['group_id']);
582
			$template->set_var('NAME', $group['name']);
583
			if(FRONTEND_SIGNUP == $group['group_id'])
584
	        {
585
				$template->set_var('SELECTED', ' selected="selected"');
586
			} else {
587
				$template->set_var('SELECTED', '');
588
			}
589
			$template->parse('group_list', 'group_list_block', true);
590
		}
591
	} else {
592
		$template->set_var('ID', 'disabled');
593
		$template->set_var('NAME', $MESSAGE['GROUPS']['NO_GROUPS_FOUND']);
594
		$template->parse('group_list', 'group_list_block', true);
595
	}
596

    
597
	// Insert language headings
598
	$template->set_var(array(
599
								'HEADING_GENERAL_SETTINGS' => $HEADING['GENERAL_SETTINGS'],
600
								'HEADING_DEFAULT_SETTINGS' => $HEADING['DEFAULT_SETTINGS'],
601
								'HEADING_SEARCH_SETTINGS' => $HEADING['SEARCH_SETTINGS'],
602
								'HEADING_SERVER_SETTINGS' => $HEADING['SERVER_SETTINGS'],
603
								'HEADING_WBMAILER_SETTINGS' => $HEADING['WBMAILER_SETTINGS'],
604
								'HEADING_ADMINISTRATION_TOOLS' => $HEADING['ADMINISTRATION_TOOLS']
605
								)
606
						);
607
	// Insert language text and messages
608
	$template->set_var(array(
609
								'TEXT_WEBSITE_TITLE' => $TEXT['WEBSITE_TITLE'],
610
								'TEXT_WEBSITE_DESCRIPTION' => $TEXT['WEBSITE_DESCRIPTION'],
611
								'TEXT_WEBSITE_KEYWORDS' => $TEXT['WEBSITE_KEYWORDS'],
612
								'TEXT_WEBSITE_HEADER' => $TEXT['WEBSITE_HEADER'],
613
								'TEXT_WEBSITE_FOOTER' => $TEXT['WEBSITE_FOOTER'],
614
								'TEXT_HEADER' => $TEXT['HEADER'],
615
								'TEXT_FOOTER' => $TEXT['FOOTER'],
616
								'TEXT_VISIBILITY' => $TEXT['VISIBILITY'],
617
								'TEXT_RESULTS_HEADER' => $TEXT['RESULTS_HEADER'],
618
								'TEXT_RESULTS_LOOP' => $TEXT['RESULTS_LOOP'],
619
								'TEXT_RESULTS_FOOTER' => $TEXT['RESULTS_FOOTER'],
620
								'TEXT_NO_RESULTS' => $TEXT['NO_RESULTS'],
621
								'TEXT_TEXT' => $TEXT['TEXT'],
622
								'TEXT_DEFAULT' => $TEXT['DEFAULT'],
623
								'TEXT_LANGUAGE' => $TEXT['LANGUAGE'],
624
								'TEXT_TIMEZONE' => $TEXT['TIMEZONE'],
625
								'TEXT_CHARSET' => $TEXT['CHARSET'],
626
								'TEXT_DATE_FORMAT' => $TEXT['DATE_FORMAT'],
627
								'TEXT_TIME_FORMAT' => $TEXT['TIME_FORMAT'],
628
								'TEXT_TEMPLATE' => $TEXT['TEMPLATE'],
629
								'TEXT_THEME' => $TEXT['THEME'],
630
								'TEXT_WYSIWYG_EDITOR' => $TEXT['WYSIWYG_EDITOR'],
631
								'TEXT_PAGE_LEVEL_LIMIT' => $TEXT['PAGE_LEVEL_LIMIT'],
632
								'TEXT_INTRO_PAGE' => $TEXT['INTRO_PAGE'],
633
								'TEXT_FRONTEND' => $TEXT['FRONTEND'],
634
								'TEXT_LOGIN' => $TEXT['LOGIN'],
635
								'TEXT_REDIRECT_AFTER' => $TEXT['REDIRECT_AFTER'],
636
								'TEXT_SIGNUP' => $TEXT['SIGNUP'],
637
								'TEXT_PHP_ERROR_LEVEL' => $TEXT['PHP_ERROR_LEVEL'],
638
								'TEXT_PAGES_DIRECTORY' => $TEXT['PAGES_DIRECTORY'],
639
								'TEXT_MEDIA_DIRECTORY' => $TEXT['MEDIA_DIRECTORY'],
640
								'TEXT_PAGE_EXTENSION' => $TEXT['PAGE_EXTENSION'],
641
								'TEXT_PAGE_SPACER' => $TEXT['PAGE_SPACER'],
642
								'TEXT_RENAME_FILES_ON_UPLOAD' => $TEXT['RENAME_FILES_ON_UPLOAD'],
643
								'TEXT_APP_NAME' => $TEXT['APP_NAME'],
644
								'TEXT_SESSION_IDENTIFIER' => $TEXT['SESSION_IDENTIFIER'],
645
								'TEXT_SEC_ANCHOR' => $TEXT['SEC_ANCHOR'],
646
								'TEXT_SERVER_OPERATING_SYSTEM' => $TEXT['SERVER_OPERATING_SYSTEM'],
647
								'TEXT_LINUX_UNIX_BASED' => $TEXT['LINUX_UNIX_BASED'],
648
								'TEXT_WINDOWS' => $TEXT['WINDOWS'],
649
								'TEXT_ADMIN' => $TEXT['ADMIN'],
650
								'TEXT_TYPE' => $TEXT['TYPE'],
651
								'TEXT_DATABASE' => $TEXT['DATABASE'],
652
								'TEXT_HOST' => $TEXT['HOST'],
653
								'TEXT_USERNAME' => $TEXT['USERNAME'],
654
								'TEXT_PASSWORD' => $TEXT['PASSWORD'],
655
								'TEXT_NAME' => $TEXT['NAME'],
656
								'TEXT_TABLE_PREFIX' => $TEXT['TABLE_PREFIX'],
657
								'TEXT_SAVE' => $TEXT['SAVE'],
658
								'TEXT_RESET' => $TEXT['RESET'],
659
								'TEXT_CHANGES' => $TEXT['CHANGES'],
660
								'TEXT_ENABLED' => $TEXT['ENABLED'],
661
								'TEXT_DISABLED' => $TEXT['DISABLED'],
662
								'TEXT_MANAGE_SECTIONS' => $HEADING['MANAGE_SECTIONS'],
663
								'TEXT_MANAGE' => $TEXT['MANAGE'],
664
								'TEXT_SEARCH' => $TEXT['SEARCH'],
665
								'TEXT_PUBLIC' => $TEXT['PUBLIC'],
666
								'TEXT_PRIVATE' => $TEXT['PRIVATE'],
667
								'TEXT_REGISTERED' => $TEXT['REGISTERED'],
668
								'TEXT_NONE' => $TEXT['NONE'],
669
								'TEXT_FILES' => strtoupper(substr($TEXT['FILES'], 0, 1)).substr($TEXT['FILES'], 1),
670
								'TEXT_DIRECTORIES' => $TEXT['DIRECTORIES'],
671
								'TEXT_FILESYSTEM_PERMISSIONS' => $TEXT['FILESYSTEM_PERMISSIONS'],
672
								'TEXT_USER' => $TEXT['USER'],
673
								'TEXT_GROUP' => $TEXT['GROUP'],
674
								'TEXT_OTHERS' => $TEXT['OTHERS'],
675
								'TEXT_READ' => $TEXT['READ'],
676
								'TEXT_WRITE' => $TEXT['WRITE'],
677
								'TEXT_EXECUTE' => $TEXT['EXECUTE'],
678
								'TEXT_WARN_PAGE_LEAVE' => '',
679
								'TEXT_SMART_LOGIN' => $TEXT['SMART_LOGIN'],
680
								'TEXT_MULTIPLE_MENUS' => $TEXT['MULTIPLE_MENUS'],
681
								'TEXT_HOMEPAGE_REDIRECTION' => $TEXT['HOMEPAGE_REDIRECTION'],
682
								'TEXT_SECTION_BLOCKS' => $TEXT['SECTION_BLOCKS'],
683
								'TEXT_PLEASE_SELECT' => $TEXT['PLEASE_SELECT'],
684
								'TEXT_PAGE_TRASH' => $TEXT['PAGE_TRASH'],
685
								'TEXT_PAGE_LANGUAGES' => $TEXT['PAGE_LANGUAGES'],
686
								'TEXT_INLINE' => $TEXT['INLINE'],
687
								'TEXT_SEPARATE' => $TEXT['SEPARATE'],
688
								'TEXT_HOME_FOLDERS' => $TEXT['HOME_FOLDERS'],
689
								'TEXT_WYSIWYG_STYLE' => $TEXT['WYSIWYG_STYLE'],
690
								'TEXT_WORLD_WRITEABLE_FILE_PERMISSIONS' => $TEXT['WORLD_WRITEABLE_FILE_PERMISSIONS'],
691
								'TEXT_WBMAILER_DEFAULT_SETTINGS_NOTICE' => $TEXT['WBMAILER_DEFAULT_SETTINGS_NOTICE'],
692
								'TEXT_WBMAILER_DEFAULT_SENDER_MAIL' => $TEXT['WBMAILER_DEFAULT_SENDER_MAIL'],
693
								'TEXT_WBMAILER_DEFAULT_SENDER_NAME' => $TEXT['WBMAILER_DEFAULT_SENDER_NAME'],
694
								'TEXT_WBMAILER_NOTICE' => $TEXT['WBMAILER_NOTICE'],
695
								'TEXT_WBMAILER_FUNCTION' => $TEXT['WBMAILER_FUNCTION'],
696
								'TEXT_WBMAILER_SMTP_HOST' => $TEXT['WBMAILER_SMTP_HOST'],
697
								'TEXT_WBMAILER_PHP' => $TEXT['WBMAILER_PHP'],
698
								'TEXT_WBMAILER_SMTP' => $TEXT['WBMAILER_SMTP'],
699
								'TEXT_WBMAILER_SMTP_AUTH' => $TEXT['WBMAILER_SMTP_AUTH'],
700
								'TEXT_WBMAILER_SMTP_AUTH_NOTICE' => $TEXT['WBMAILER_SMTP_AUTH_NOTICE'],
701
								'TEXT_WBMAILER_SMTP_USERNAME' => $TEXT['WBMAILER_SMTP_USERNAME'],
702
								'TEXT_WBMAILER_SMTP_PASSWORD' => $TEXT['WBMAILER_SMTP_PASSWORD'],
703
								'MODE_SWITCH_WARNING' => $MESSAGE['SETTINGS']['MODE_SWITCH_WARNING'],
704
								'WORLD_WRITEABLE_WARNING' => $MESSAGE['SETTINGS']['WORLD_WRITEABLE_WARNING'],
705
								'TEXT_MODULE_ORDER' => $TEXT['MODULE_ORDER'],
706
								'TEXT_MAX_EXCERPT' => $TEXT['MAX_EXCERPT'],
707
								'TEXT_TIME_LIMIT' => $TEXT['TIME_LIMIT']
708
								));
709

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

    
735
// Parse template objects output
736
$template->parse('main', 'main_block', false);
737
$template->pparse('output', 'page');
738

    
739
$admin->print_footer();
740

    
741
?>
(1-1/3)