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 1767 Luisehahne
	'modules_upgrade_list' => (defined('MODULES_UPGRADE_LIST') ? MODULES_UPGRADE_LIST : ''),
32 1716 Luisehahne
	);
33
db_update_key_value( 'settings', $cfg );
34
35 1356 Luisehahne
// Include the WB functions file
36
require_once(WB_PATH.'/framework/functions.php');
37
require_once(WB_PATH.'/framework/functions-utf8.php');
38
39 1777 Luisehahne
if(!class_exists('Template', false)){ include(WB_PATH.'/include/phplib/ttemplate.inc'); }
40 1716 Luisehahne
41 1529 Luisehahne
// Setup template object, parse vars to it, then parse it
42 1356 Luisehahne
// Create new template object
43 1777 Luisehahne
$oTpl = new Template(dirname($admin->correct_theme_source('settings.htt')),'comment');
44
//$oTpl->debug = true;
45
//$oTpl->filename_comments = true;
46
//$oTpl->unknown_regexp = "strict";
47
//$oTpl->halt_on_error = "report" ;
48 1356 Luisehahne
49 1777 Luisehahne
$oTpl->set_file('page',  'settings.htt');
50
$oTpl->set_block('page', 'main_block', 'main');
51 1356 Luisehahne
52 1777 Luisehahne
$mLang = ModLanguage::getInstance();
53
$mLang->setLanguage(dirname(__FILE__).'/languages/', LANGUAGE, DEFAULT_LANGUAGE);
54
55
$oTpl->set_var('FTAN', $admin->getFTAN());
56 1745 Luisehahne
/*-- insert all needed vars from language files ----------------------------------------*/
57 1777 Luisehahne
$oTpl->set_var($mLang->getLangArray());
58 1356 Luisehahne
59
// Query current settings in the db, then loop through them and print them
60 1777 Luisehahne
$query = "SELECT * FROM `".TABLE_PREFIX."settings`";
61
if($results = $database->query($query)) {
62
    while($setting = $results->fetchRow(MYSQL_ASSOC)) {
63
    	$setting_name = $setting['name'];
64
    	$setting_value = ( $setting_name != 'wbmailer_smtp_password' ) ? htmlspecialchars($setting['value']) : htmlentities($setting['value'], ENT_COMPAT, 'UTF-8');
65
    	$oTpl->set_var(strtoupper($setting_name),($setting_value));
66
//        $oTpl->parse('main', 'main_block', true);
67
    }
68 1356 Luisehahne
}
69
70
$is_advanced = (isset($_GET['advanced']) && $_GET['advanced'] == 'yes');
71
// Tell the browser whether or not to show advanced options
72 1777 Luisehahne
    if($is_advanced)
73
    {
74
    	$oTpl->set_var('DISPLAY_ADVANCED', '');
75
    	$oTpl->set_var('ADVANCED_FILE_PERMS_ID', 'file_perms_box');
76
    	$oTpl->set_var('BASIC_FILE_PERMS_ID', 'hide');
77
    	$oTpl->set_var('ADVANCED', 'yes');
78
    	$oTpl->set_var('ADVANCED_BUTTON', '&lt;&lt; '.$TEXT['HIDE_ADVANCED']);
79
    	$oTpl->set_var('ADVANCED_LINK', 'index.php?advanced=no');
80 1356 Luisehahne
81 1777 Luisehahne
    } else {
82
    	$oTpl->set_var('DISPLAY_ADVANCED', ' style="display: none;"');
83
    	$oTpl->set_var('BASIC_FILE_PERMS_ID', 'file_perms_box');
84
    	$oTpl->set_var('ADVANCED_FILE_PERMS_ID', 'hide');
85 1356 Luisehahne
86 1777 Luisehahne
    	$oTpl->set_var('ADVANCED', 'no');
87
    	$oTpl->set_var('ADVANCED_BUTTON', $TEXT['SHOW_ADVANCED'].' &gt;&gt;');
88
    	$oTpl->set_var('ADVANCED_LINK', 'index.php?advanced=yes');
89
    }
90 1356 Luisehahne
91 1777 Luisehahne
	$sSelected = ' selected="selected"';
92
	$checked   = ' checked="checked"';
93 1356 Luisehahne
94 1777 Luisehahne
	$oTpl->set_var(array(
95
		'WB_URL' => WB_URL,
96
		'THEME_URL' => THEME_URL,
97
		'ADMIN_URL' => ADMIN_URL,
98
	 ));
99
100
	// Insert language headings
101
	$oTpl->set_var(array(
102
		'HEADING_GENERAL_SETTINGS' => $HEADING['GENERAL_SETTINGS'],
103
		'HEADING_DEFAULT_SETTINGS' => $HEADING['DEFAULT_SETTINGS'],
104
		'HEADING_SEARCH_SETTINGS' => $HEADING['SEARCH_SETTINGS'],
105
		'HEADING_SERVER_SETTINGS' => $HEADING['SERVER_SETTINGS'],
106
		'HEADING_WBMAILER_SETTINGS' => $HEADING['WBMAILER_SETTINGS'],
107
		'HEADING_ADMINISTRATION_TOOLS' => $HEADING['ADMINISTRATION_TOOLS']
108
		)
109
	);
110
111
	// Insert language textarea label
112
	$oTpl->set_var(array(
113
		'TEXT_WEBSITE_TITLE' => $TEXT['WEBSITE_TITLE'],
114
		'TEXT_WEBSITE_DESCRIPTION' => $TEXT['WEBSITE_DESCRIPTION'],
115
		'TEXT_WEBSITE_KEYWORDS' => $TEXT['WEBSITE_KEYWORDS'],
116
		'TEXT_WEBSITE_HEADER' => $TEXT['WEBSITE_HEADER'],
117
		'TEXT_WEBSITE_FOOTER' => $TEXT['WEBSITE_FOOTER'],
118
		'TEXT_HEADER' => $TEXT['HEADER'],
119
		'TEXT_FOOTER' => $TEXT['FOOTER'],
120
		'TEXT_TEXT' => $TEXT['TEXT'],
121
		'TEXT_RESULTS_HEADER' => $TEXT['RESULTS_HEADER'],
122
		'TEXT_RESULTS_LOOP' => $TEXT['RESULTS_LOOP'],
123
		'TEXT_RESULTS_FOOTER' => $TEXT['RESULTS_FOOTER'],
124
		));
125
126
	// Insert generell language
127
    $oTpl->set_var(array(
128
		'TEXT_SAVE' => $TEXT['SAVE'],
129
		'TEXT_RESET' => $TEXT['RESET'],
130
		'TEXT_ENABLED' => $TEXT['ENABLED'],
131
		'TEXT_DISABLED' => $TEXT['DISABLED'],
132
		'TEXT_DEFAULT' => $TEXT['DEFAULT'],
133
		'TEXT_NO_RESULTS' => $TEXT['NO_RESULTS'],
134
		'TEXT_PLEASE_SELECT' => $TEXT['PLEASE_SELECT'],
135
		));
136
137
// Insert language labels
138
	$oTpl->set_var(array(
139
		'TEXT_PAGE_TRASH' => $TEXT['PAGE_TRASH'],
140
		'TEXT_PAGE_LANGUAGES' => $TEXT['PAGE_LANGUAGES'],
141
		'TEXT_FRONTEND' => $TEXT['FRONTEND'],
142
		'TEXT_LOGIN' => $TEXT['LOGIN'],
143
		'TEXT_HOMEPAGE_REDIRECTION' => $TEXT['HOMEPAGE_REDIRECTION'],
144
		'TEXT_SECTION_BLOCKS' => $TEXT['SECTION_BLOCKS'],
145
		'TEXT_MANAGE' => $TEXT['MANAGE'],
146
		'TEXT_SMART_LOGIN' => $TEXT['SMART_LOGIN'],
147
		'TEXT_PHP_ERROR_LEVEL' => $TEXT['PHP_ERROR_LEVEL'],
148
		'TEXT_WYSIWYG_STYLE' => $TEXT['WYSIWYG_STYLE'],
149
		'TEXT_CHARSET' => $TEXT['CHARSET'],
150
		'TEXT_REDIRECT_AFTER' => $TEXT['REDIRECT_AFTER'],
151
		'TEXT_SIGNUP' => $TEXT['SIGNUP'].' '.$TEXT['GROUP'],
152
		'TEXT_MULTILINGUAL' => $TEXT['MULTILINGUAL'],
153
		'TEXT_HOME_FOLDERS' => $TEXT['HOME_FOLDERS'],
154
		'TEXT_MANAGE_SECTIONS' => $HEADING['MANAGE_SECTIONS'],
155
		'TEXT_MULTIPLE_MENUS' => $TEXT['MULTIPLE_MENUS'],
156
		'TEXT_INLINE' => $TEXT['INLINE'],
157
		'TEXT_SEPARATE' => $TEXT['SEPARATE'],
158
		'TEXT_LANGUAGE' => $TEXT['LANGUAGE'],
159
		'TEXT_TIMEZONE' => $TEXT['TIMEZONE'],
160
		'TEXT_DATE_FORMAT' => $TEXT['DATE_FORMAT'],
161
		'TEXT_TIME_FORMAT' => $TEXT['TIME_FORMAT'],
162
		'TEXT_TEMPLATE' => $TEXT['TEMPLATE'],
163
		'TEXT_THEME' => $TEXT['THEME'],
164
		'TEXT_WYSIWYG_EDITOR' => $TEXT['WYSIWYG_EDITOR'],
165
		'TEXT_PAGE_LEVEL_LIMIT' => $TEXT['PAGE_LEVEL_LIMIT'],
166
		'TEXT_INTRO_PAGE' => $TEXT['INTRO_PAGE'],
167
		));
168
169
//  Insert permissions values
170
	if($admin->get_permission('settings_advanced') != true)
171 1356 Luisehahne
	{
172 1777 Luisehahne
		$oTpl->set_var('DISPLAY_ADVANCED_BUTTON', 'hide');
173
	}
174
175
    /**
176
     * <!-- BEGIN show_page_level_limit_block -->
177
     * Insert page level limits
178
     */
179
    $oTpl->set_block('main_block', 'show_page_level_limit_block', 'show_page_level_limit');
180
    /**
181
     * <!-- BEGIN page_level_limit_list_block -->
182
     */
183
    $oTpl->set_block('show_page_level_limit_block', 'page_level_limit_list_block', 'page_level_limit_list');
184
	for($i = 1; $i <= 10; $i++)
185
	{
186
		$oTpl->set_var('NUMBER', $i);
187
		if(PAGE_LEVEL_LIMIT == $i)
188
	    {
189
			$oTpl->set_var('SELECTED', $sSelected);
190
		} else {
191
			$oTpl->set_var('SELECTED', '');
192 1356 Luisehahne
		}
193 1777 Luisehahne
		$oTpl->parse('page_level_limit_list', 'page_level_limit_list_block', true);
194 1356 Luisehahne
	}
195
196 1777 Luisehahne
    /**
197
     * <!-- END page_level_limit_list_block -->
198
     * <!-- END show_page_level_limit_block -->
199
     */
200
    if($is_advanced)
201
    {
202
    	$oTpl->parse('show_page_level_limit', 'show_page_level_limit_block', false);
203
    } else {
204
    	$oTpl->parse('show_page_level_limit', '');
205
    }
206 1716 Luisehahne
207 1777 Luisehahne
    /**
208
     * Work-out if page trash feature is disabled, in-line, or separate
209
     */
210
	if(PAGE_TRASH == 'disabled')
211
	{
212
    	$oTpl->set_var(array(
213
				'PAGE_TRASH_DISABLED' => $checked,
214
				'PAGE_TRASH_INLINE' => '',
215
				'DISPLAY_PAGE_TRASH_SEPARATE' => 'display: none;',
216
				));
217
	} elseif(PAGE_TRASH == 'inline')
218
	{
219
    	$oTpl->set_var(array(
220
				'PAGE_TRASH_INLINE' => $checked,
221
				'PAGE_TRASH_DISABLED' => '',
222
				'DISPLAY_PAGE_TRASH_SEPARATE' => 'display: none;',
223
				));
224
	} elseif(PAGE_TRASH == 'separate')
225
	{
226
		$oTpl->set_var('PAGE_TRASH_SEPARATE', $checked);
227
		$oTpl->set_var('DISPLAY_PAGE_TRASH_SEPARATE', 'display: inline;');
228
	}
229 1356 Luisehahne
230 1777 Luisehahne
    /**
231
     * <!-- BEGIN show_checkbox_1_block -->
232
     * advanced yes
233
     */
234
    $oTpl->set_block('main_block', 'show_checkbox_1_block', 'show_checkbox_1');
235
//  Work-out if page languages feature is enabled
236
	if(defined('PAGE_LANGUAGES') && PAGE_LANGUAGES == true)
237
	{
238
    	$oTpl->set_var(array(
239
				'PAGE_LANGUAGES_ENABLED' => $checked,
240
				'PAGE_LANGUAGES_DISABLED' => '',
241
				));
242
	} else {
243
    	$oTpl->set_var(array(
244
				'PAGE_LANGUAGES_DISABLED' => $checked,
245
				'PAGE_LANGUAGES_ENABLED' => '',
246
				));
247
	}
248
249
//  Work-out if page extended feature is enabled
250
	if(defined('PAGE_EXTENDED') && PAGE_EXTENDED == true)
251
	{
252
    	$oTpl->set_var(array(
253
				'PAGE_EXTENDED_ENABLED' => $checked,
254
				'PAGE_EXTENDED_DISABLED' => '',
255
				));
256
	} else {
257
    	$oTpl->set_var(array(
258
				'PAGE_EXTENDED_DISABLED' => $checked,
259
				'PAGE_EXTENDED_ENABLED' => '',
260
				));
261
	}
262
263
//  Work-out if multiple menus feature is enabled
264
	if(defined('MULTIPLE_MENUS') && MULTIPLE_MENUS == true)
265
	{
266
    	$oTpl->set_var(array(
267
				'MULTIPLE_MENUS_ENABLED' => $checked,
268
				'MULTIPLE_MENUS_DISABLED' => '',
269
				));
270
	} else {
271
    	$oTpl->set_var(array(
272
				'MULTIPLE_MENUS_DISABLED' => $checked,
273
				'MULTIPLE_MENUS_ENABLED' => '',
274
				));
275
	}
276
277
    /**
278
     * <!-- END show_checkbox_1_block -->
279
     * advanced yes
280
     */
281
    if($is_advanced)
282
    {
283
    	$oTpl->parse('show_checkbox_1', 'show_checkbox_1_block');
284
    } else {
285
    	$oTpl->parse('show_checkbox_1', '');
286
    }
287
288
//  Work-out if media home folder feature is enabled
289
    $oTpl->set_var('TEXT_HOME_FOLDERS', $TEXT['HOME_FOLDERS']);
290
	if(HOME_FOLDERS)
291
	{
292
    	$oTpl->set_var(array(
293
				'HOME_FOLDERS_ENABLED' => $checked,
294
				'HOME_FOLDERS_DISABLED' => '',
295
				));
296
	} else {
297
    	$oTpl->set_var(array(
298
				'HOME_FOLDERS_DISABLED' => $checked,
299
				'HOME_FOLDERS_ENABLED' => '',
300
				));
301
	}
302
303
    $oTpl->set_block('main_block', 'show_checkbox_2_block', 'show_checkbox_2');
304
//  Work-out if manage sections feature is enabled
305
	if(MANAGE_SECTIONS)
306
	{
307
    	$oTpl->set_var(array(
308
				'MANAGE_SECTIONS_ENABLED' => $checked,
309
				'MANAGE_SECTIONS_DISABLED' => '',
310
				));
311
	} else {
312
    	$oTpl->set_var(array(
313
				'MANAGE_SECTIONS_DISABLED' => $checked,
314
				'MANAGE_SECTIONS_ENABLED' => '',
315
				));
316
	}
317
318
	// Work-out if section blocks feature is enabled
319
	if(defined('SECTION_BLOCKS') && SECTION_BLOCKS == true)
320
	{
321
    	$oTpl->set_var(array(
322
				'SECTION_BLOCKS_ENABLED' => $checked,
323
				'SECTION_BLOCKS_DISABLED' => '',
324
				));
325
	} else {
326
    	$oTpl->set_var(array(
327
				'SECTION_BLOCKS_DISABLED' => $checked,
328
				'SECTION_BLOCKS_ENABLED' => '',
329
				));
330
	}
331
332
    /**
333
     *
334
     */
335
    if($is_advanced)
336
    {
337
     	$oTpl->parse('show_checkbox_2', 'show_checkbox_2_block');
338
    } else {
339
    	$oTpl->parse('show_checkbox_2', '');
340
    }
341
342
	// Work-out if intro feature is enabled
343
	if(INTRO_PAGE)
344
	{
345
    	$oTpl->set_var(array(
346
				'INTRO_PAGE_ENABLED' => $checked,
347
				'INTRO_PAGE_DISABLED' => '',
348
				));
349
	} else {
350
    	$oTpl->set_var(array(
351
				'INTRO_PAGE_DISABLED' => $checked,
352
				'INTRO_PAGE_ENABLED' => '',
353
				));
354
	}
355
/**
356
 * <!-- BEGIN show_checkbox_3_block -->
357
 */
358
    $oTpl->set_block('main_block', 'show_checkbox_3_block', 'show_checkbox_3');
359
//  Work-out if homepage redirection feature is enabled
360
	if(defined('HOMEPAGE_REDIRECTION') && HOMEPAGE_REDIRECTION == true)
361
	{
362
    	$oTpl->set_var(array(
363
				'HOMEPAGE_REDIRECTION_ENABLED' => $checked,
364
				'HOMEPAGE_REDIRECTION_DISABLED' => '',
365
				));
366
	} else {
367
//		$oTpl->set_var('HOMEPAGE_REDIRECTION_DISABLED', $checked);
368
    	$oTpl->set_var(array(
369
				'HOMEPAGE_REDIRECTION_DISABLED' => $checked,
370
				'HOMEPAGE_REDIRECTION_ENABLED' => '',
371
				));
372
	}
373
//  Work-out if smart login feature is enabled
374
	if(defined('SMART_LOGIN') && SMART_LOGIN == true)
375
	{
376
		$oTpl->set_var('SMART_LOGIN_ENABLED', $checked);
377
    	$oTpl->set_var(array(
378
				'SMART_LOGIN_ENABLED' => $checked,
379
				'SMART_LOGIN_DISABLED' => '',
380
				));
381
	} else {
382
		$oTpl->set_var('SMART_LOGIN_DISABLED', $checked);
383
    	$oTpl->set_var(array(
384
				'SMART_LOGIN_DISABLED' => $checked,
385
				'SMART_LOGIN_ENABLED' => '',
386
				));
387
	}
388
389
    /**
390
     * <!-- END show_checkbox_3_block -->
391
     */
392
    if($is_advanced)
393
    {
394
    	$oTpl->parse('show_checkbox_3', 'show_checkbox_3_block');
395
    } else {
396
    	$oTpl->parse('show_checkbox_3', 'show_checkbox_3_block', '');
397
    }
398
399
//  Work-out if frontend login feature is enabled
400
	if(FRONTEND_LOGIN)
401
	{
402
    	$oTpl->set_var(array(
403
				'PRIVATE_ENABLED' => $checked,
404
				'PRIVATE_DISABLED' => '',
405
				));
406
	} else {
407
    	$oTpl->set_var(array(
408
				'PRIVATE_DISABLED' => $checked,
409
				'INTRO_PAGE_ENABLED' => '',
410
				));
411
	}
412
413
	if(CONFIRMED_REGISTRATION)
414
	{
415
    	$oTpl->set_var(array(
416
				'CONFIRMED_REGISTRATION_ENABLED' => $checked,
417
				'CONFIRMED_REGISTRATION_DISABLED' => '',
418
				));
419
	} else {
420
    	$oTpl->set_var(array(
421
				'CONFIRMED_REGISTRATION_DISABLED' => $checked,
422
				'CONFIRMED_REGISTRATION_ENABLED' => '',
423
				));
424
	}
425
426
//  Insert groups into signup list
427
    $oTpl->set_block('main_block', 'group_list_block', 'group_list');
428
    $sql = "SELECT `group_id`, `name` FROM `".TABLE_PREFIX."groups` WHERE `group_id` != '1'";
429
	if($results = $database->query($sql)) {
430
    	if($results->numRows() > 0)
431
    	{
432
    		while($group = $results->fetchRow(MYSQL_ASSOC))
433
    	    {
434
    			$oTpl->set_var('ID', $group['group_id']);
435
    			$oTpl->set_var('NAME', $group['name']);
436
    			if(FRONTEND_SIGNUP == $group['group_id'])
437
    	        {
438
    				$oTpl->set_var('SELECTED', $sSelected);
439
    			} else {
440
    				$oTpl->set_var('SELECTED', '');
441
    			}
442
    			$oTpl->parse('group_list', 'group_list_block', true);
443
    		}
444
    	} else {
445
    		$oTpl->set_var('ID', 'disabled');
446
    		$oTpl->set_var('NAME', $MESSAGE['GROUPS']['NO_GROUPS_FOUND']);
447
    		$oTpl->parse('group_list', 'group_list_block', true);
448
    	}
449
	}
450
451
    /**
452
     * <!-- BEGIN show_redirect_timer_block -->
453
     */
454
    $oTpl->set_block('main_block', 'show_redirect_timer_block', 'show_redirect_timer');
455
456
    /**
457
     * <!-- END show_redirect_timer_block -->
458
     */
459
    if($is_advanced)
460
    {
461
    	$oTpl->parse('show_redirect_timer', 'show_redirect_timer_block');
462
    } else {
463
    	$oTpl->parse('show_redirect_timer', '');
464
    }
465
466
    /**
467
     * <!-- BEGIN show_php_error_level_block -->
468
     */
469
	// Insert default error reporting values
470
	require(ADMIN_PATH.'/interface/er_levels.php');
471
    $oTpl->set_block('main_block', 'show_php_error_level_block',  'show_php_error_level');
472
    $oTpl->set_block('show_php_error_level_block', 'php_error_list_block',  'php_error_list');
473
	foreach($ER_LEVELS AS $value => $title)
474
	{
475
		$oTpl->set_var('VALUE', $value);
476
		$oTpl->set_var('NAME', $title);
477
	    $selected = (ER_LEVEL == $value) ? $sSelected : '';
478
	    $oTpl->set_var('SELECTED', $selected);
479
		$oTpl->parse('php_error_list', 'php_error_list_block', true);
480
	}
481
482
    /**
483
     * <!-- END show_php_error_level_block -->
484
     */
485
    if($is_advanced)
486
    {
487
    	$oTpl->parse('show_php_error_level',  'show_php_error_level_block');
488
    } else {
489
    	$oTpl->parse('show_php_error_level', '');
490
    }
491
492
    /**
493
     * <!-- BEGIN show_wysiwyg_block -->
494
     */
495
//  Insert WYSIWYG modules
496
    $oTpl->set_block('main_block', 'show_wysiwyg_block',        'show_wysiwyg');
497
    $oTpl->set_block('show_wysiwyg_block', 'editor_list_block', 'editor_list');
498
	$file='none';
499
	$module_name=$TEXT['NONE'];
500
	$oTpl->set_var('FILE', $file);
501
	$oTpl->set_var('NAME', $module_name);
502
	$selected = (!defined('WYSIWYG_EDITOR') || $file == WYSIWYG_EDITOR) ? $sSelected : '';
503
	$oTpl->set_var('SELECTED', $selected);
504
	$oTpl->parse('editor_list', 'editor_list_block', true);
505 1716 Luisehahne
	$sql  = 'SELECT `name`, `directory` FROM `'.TABLE_PREFIX.'addons` ';
506 1777 Luisehahne
	$sql .= 'WHERE `type` = \'module\' ';
507
	$sql .= 'AND `function` = \'wysiwyg\' ';
508
	$sql .= 'ORDER BY `name`';
509
	if( ($result = $database->query($sql)) && ($result->numRows() > 0) )
510
	{
511
		while($addon = $result->fetchRow(MYSQL_ASSOC))
512
	    {
513
			if( $admin->get_permission($addon['directory'],'module' ) )
514
			{
515
				$oTpl->set_var('FILE', $addon['directory']);
516
				$oTpl->set_var('NAME', $addon['name']);
517
				$selected = (!defined('WYSIWYG_EDITOR') || $addon['directory'] == WYSIWYG_EDITOR) ? $sSelected : '';
518
				$oTpl->set_var('SELECTED', $selected);
519
				$oTpl->parse('editor_list', 'editor_list_block', true);
520
			}
521
		}
522
	}
523
524
    /**
525
     * <!-- END show_wysiwyg_block -->
526
     */
527
    if($is_advanced)
528
    {
529
    	$oTpl->parse('show_wysiwyg','show_wysiwyg_block');
530
    } else {
531
    	$oTpl->parse('show_wysiwyg', '');
532
    }
533
534
//  Insert language values
535
    $oTpl->set_block('main_block', 'language_list_block', 'language_list');
536
	$sql  = 'SELECT `name`, `directory` FROM `'.TABLE_PREFIX.'addons` ';
537 1716 Luisehahne
	$sql .= 'WHERE `type` = \'language\' ';
538
	$sql .= 'AND `function` != \'theme\' ';
539
	$sql .= 'ORDER BY `directory`';
540
	if( ($result = $database->query($sql)) && ($result->numRows() > 0) )
541 1356 Luisehahne
	{
542 1777 Luisehahne
		while($addon = $result->fetchRow(MYSQL_ASSOC)) {
543 1457 Luisehahne
	        $langIcons = (empty($addon['directory'])) ? 'none' : strtolower($addon['directory']);
544
545 1777 Luisehahne
			$oTpl->set_var('CODE',        $addon['directory']);
546
			$oTpl->set_var('NAME',        $addon['name']);
547
			$oTpl->set_var('FLAG',        THEME_URL.'/images/flags/'.$langIcons);
548
			$oTpl->set_var('SELECTED',    (DEFAULT_LANGUAGE == $addon['directory'] ? $sSelected : '') );
549
			$oTpl->parse('language_list', 'language_list_block', true);
550 1356 Luisehahne
		}
551
	}
552 1777 Luisehahne
    /**
553
     * <!-- BEGIN show_charset_block -->
554
     */
555
//  Insert default charset values
556
    $oTpl->set_block('main_block', 'show_charset_block', 'show_charset');
557
	require(ADMIN_PATH.'/interface/charsets.php');
558
    $oTpl->set_block('show_charset_block', 'charset_list_block', 'charset_list');
559
	foreach($CHARSETS AS $code => $title) {
560
		$oTpl->set_var('VALUE', $code);
561
		$oTpl->set_var('NAME', $title);
562
		if(DEFAULT_CHARSET == $code) {
563
			$oTpl->set_var('SELECTED', $sSelected);
564
		} else {
565
			$oTpl->set_var('SELECTED', '');
566
		}
567
		$oTpl->parse('charset_list', 'charset_list_block', true);
568
	}
569
    /**
570
     * <!-- END show_charset_block -->
571
     */
572
    if($is_advanced)
573
    {
574
    	$oTpl->parse('show_charset', 'show_charset_block');
575
    } else {
576
    	$oTpl->parse('show_charset', '');
577
    }
578 1356 Luisehahne
579 1777 Luisehahne
//  nsert default timezone values
580 1356 Luisehahne
	require(ADMIN_PATH.'/interface/timezones.php');
581 1777 Luisehahne
    $oTpl->set_block('main_block', 'timezone_list_block','timezone_list');
582 1356 Luisehahne
	foreach($TIMEZONES AS $hour_offset => $title)
583
	{
584 1777 Luisehahne
//  Make sure we dont list "System Default" as we are setting this value!
585 1356 Luisehahne
		if($hour_offset != '-20') {
586 1777 Luisehahne
			$oTpl->set_var('VALUE', $hour_offset);
587
			$oTpl->set_var('NAME', $title);
588 1356 Luisehahne
			if(DEFAULT_TIMEZONE == $hour_offset*60*60) {
589 1777 Luisehahne
				$oTpl->set_var('SELECTED', $sSelected);
590 1356 Luisehahne
			} else {
591 1777 Luisehahne
				$oTpl->set_var('SELECTED', '');
592 1356 Luisehahne
			}
593 1777 Luisehahne
			$oTpl->parse('timezone_list', 'timezone_list_block', true);
594 1356 Luisehahne
		}
595
	}
596
597 1777 Luisehahne
//  Insert date format list
598 1356 Luisehahne
	require(ADMIN_PATH.'/interface/date_formats.php');
599 1777 Luisehahne
    $oTpl->set_block('main_block', 'date_format_list_block', 'date_format_list');
600 1356 Luisehahne
	foreach($DATE_FORMATS AS $format => $title) {
601
		$format = str_replace('|', ' ', $format); // Add's white-spaces (not able to be stored in array key)
602
		if($format != 'system_default') {
603 1777 Luisehahne
			$oTpl->set_var('VALUE', $format);
604 1356 Luisehahne
		} else {
605 1777 Luisehahne
			$oTpl->set_var('VALUE', '');
606 1356 Luisehahne
		}
607 1777 Luisehahne
		$oTpl->set_var('NAME', $title);
608 1356 Luisehahne
		if(DEFAULT_DATE_FORMAT == $format) {
609 1777 Luisehahne
			$oTpl->set_var('SELECTED', $sSelected);
610 1356 Luisehahne
		} else {
611 1777 Luisehahne
			$oTpl->set_var('SELECTED', '');
612 1356 Luisehahne
		}
613 1777 Luisehahne
		$oTpl->parse('date_format_list', 'date_format_list_block', true);
614 1356 Luisehahne
	}
615
616 1777 Luisehahne
//  Insert time format list
617 1356 Luisehahne
	require(ADMIN_PATH.'/interface/time_formats.php');
618 1777 Luisehahne
    $oTpl->set_block('main_block', 'time_format_list_block', 'time_format_list');
619 1356 Luisehahne
	foreach($TIME_FORMATS AS $format => $title) {
620
		$format = str_replace('|', ' ', $format); // Add's white-spaces (not able to be stored in array key)
621
		if($format != 'system_default') {
622 1777 Luisehahne
			$oTpl->set_var('VALUE', $format);
623 1356 Luisehahne
		} else {
624 1777 Luisehahne
			$oTpl->set_var('VALUE', '');
625 1356 Luisehahne
		}
626 1777 Luisehahne
		$oTpl->set_var('NAME', $title);
627 1356 Luisehahne
		if(DEFAULT_TIME_FORMAT == $format) {
628 1777 Luisehahne
			$oTpl->set_var('SELECTED', $sSelected);
629 1356 Luisehahne
		} else {
630 1777 Luisehahne
			$oTpl->set_var('SELECTED', '');
631 1356 Luisehahne
		}
632 1777 Luisehahne
		$oTpl->parse('time_format_list', 'time_format_list_block', true);
633 1356 Luisehahne
	}
634
635 1716 Luisehahne
// Insert templates
636 1777 Luisehahne
    $oTpl->set_block('main_block', 'template_list_block',         'template_list');
637 1716 Luisehahne
	$sql  = 'SELECT `name`, `directory` FROM `'.TABLE_PREFIX.'addons` ';
638
	$sql .= 'WHERE `type` = \'template\' ';
639
	$sql .= 'AND `function` != \'theme\' ';
640
	$sql .= 'ORDER BY `name`';
641
	if( ($result = $database->query($sql)) && ($result->numRows() > 0) )
642
	{
643 1777 Luisehahne
		while($addon = $result->fetchRow(MYSQL_ASSOC))
644 1716 Luisehahne
		{
645
			if( $admin->get_permission($addon['directory'],'template' ) )
646
			{
647 1777 Luisehahne
				$oTpl->set_var('FILE', $addon['directory']);
648
				$oTpl->set_var('NAME', $addon['name']);
649 1716 Luisehahne
				$selected = (($addon['directory'] == DEFAULT_TEMPLATE) ? $sSelected : '');
650 1777 Luisehahne
				$oTpl->set_var('SELECTED', $selected);
651
				$oTpl->parse('template_list', 'template_list_block', true);
652 1716 Luisehahne
			}
653 1356 Luisehahne
		}
654
	}
655
656 1716 Luisehahne
// Insert backend theme
657 1777 Luisehahne
    $oTpl->set_block('main_block', 'theme_list_block',            'theme_list');
658 1716 Luisehahne
	$sql  = 'SELECT `name`, `directory` FROM `'.TABLE_PREFIX.'addons` ';
659
	$sql .= 'WHERE `type` = \'template\' ';
660
	$sql .= 'AND `function` = \'theme\' ';
661
	$sql .= 'ORDER BY `name`';
662
663
	if( ($result = $database->query($sql)) && ($result->numRows() > 0) )
664
	{
665 1777 Luisehahne
		while($addon = $result->fetchRow(MYSQL_ASSOC))
666 1716 Luisehahne
		{
667
			if( $admin->get_permission($addon['directory'],'template' ) )
668
			{
669 1777 Luisehahne
				$oTpl->set_var('FILE', $addon['directory']);
670
				$oTpl->set_var('NAME', $addon['name']);
671 1716 Luisehahne
				$selected = (($addon['directory'] == DEFAULT_THEME) ? $sSelected : '');
672 1777 Luisehahne
				$oTpl->set_var('SELECTED', $selected);
673
				$oTpl->parse('theme_list', 'theme_list_block', true);
674 1716 Luisehahne
			}
675 1356 Luisehahne
		}
676
	}
677
678 1777 Luisehahne
//  Work-out if warn_page_leave feature is enabled
679
//	if (defined('WARN_PAGE_LEAVE') && WARN_PAGE_LEAVE == true)
680 1716 Luisehahne
//	{
681 1777 Luisehahne
//    	$oTpl->set_var(array(
682
//				'WARN_PAGE_LEAVE_ENABLED' => $checked,
683
//				'WARN_PAGE_LEAVE_DISABLED' => '',
684
//				));
685
//	} else {
686
//    	$oTpl->set_var(array(
687
//				'MANAGE_SECTIONS_DISABLED' => $checked,
688
//				'WARN_PAGE_LEAVE_DISABLED' => '',
689
//				));
690
//	}
691
692
/*  Make's sure GD library is installed */
693
//	if(extension_loaded('gd') && function_exists('imageCreateFromJpeg'))
694
//	{
695
//		$oTpl->set_var('GD_EXTENSION_ENABLED', '');
696
//	} else {
697
//		$oTpl->set_var('GD_EXTENSION_ENABLED', ' style="display: none;"');
698
//	}
699
700
//  Insert permissions values
701
//	if($admin->get_permission('settings_advanced') != true)
702
//	{
703
//		$oTpl->set_var('DISPLAY_ADVANCED_BUTTON', 'hide');
704
//	}
705
706
/**
707
 *
708
 *
709
 */
710
    $oTpl->set_block('main_block', 'show_search_block','show_search');
711
	$query = "SELECT * FROM `".TABLE_PREFIX."search` WHERE `extra` = '' ";
712
	if($results = $database->query($query))
713
    {
714
    	// Query current settings in the db, then loop through them and print them
715
    	while($setting = $results->fetchRow(MYSQL_ASSOC))
716
    	{
717
    		$setting_name = $setting['name'];
718
    		$setting_value = htmlspecialchars(($setting['value']));
719
    		switch($setting_name) {
720
    			// Search header
721
    			case 'header':
722
    				$oTpl->set_var('SEARCH_HEADER', $setting_value);
723
    			break;
724
    			// Search results header
725
    			case 'results_header':
726
    				$oTpl->set_var('SEARCH_RESULTS_HEADER', $setting_value);
727
    			break;
728
    			// Search results loop
729
    			case 'results_loop':
730
    				$oTpl->set_var('SEARCH_RESULTS_LOOP', $setting_value);
731
    			break;
732
    			// Search results footer
733
    			case 'results_footer':
734
    				$oTpl->set_var('SEARCH_RESULTS_FOOTER', $setting_value);
735
    			break;
736
    			// Search no results
737
    			case 'no_results':
738
    				$oTpl->set_var('SEARCH_NO_RESULTS', $setting_value);
739
    			break;
740
    			// Search footer
741
    			case 'footer':
742
    				$oTpl->set_var('SEARCH_FOOTER', $setting_value);
743
    			break;
744
    			// Search module-order
745
    			case 'module_order':
746
    				$oTpl->set_var('SEARCH_MODULE_ORDER', $setting_value);
747
    			break;
748
    			// Search max lines of excerpt
749
    			case 'max_excerpt':
750
    				$oTpl->set_var('SEARCH_MAX_EXCERPT', $setting_value);
751
    			break;
752
    			// time-limit
753
    			case 'time_limit':
754
    				$oTpl->set_var('SEARCH_TIME_LIMIT', $setting_value);
755
    			break;
756
    			// Search template
757
    			case 'template':
758
    				$search_template = $setting_value;
759
    			break;
760
    		}
761
    	}
762 1356 Luisehahne
	}
763
764
// Insert templates for search settings
765 1777 Luisehahne
    $oTpl->set_block('main_block', 'search_template_list_block',  'search_template_list');
766 1366 Luisehahne
	$search_template = ( ($search_template == DEFAULT_TEMPLATE) || ($search_template == '') ) ? '' : $search_template;
767 1716 Luisehahne
	$selected = ( ($search_template != DEFAULT_TEMPLATE) ) ?  $sSelected : '';
768 1356 Luisehahne
769 1777 Luisehahne
	$oTpl->set_var(array(
770 1356 Luisehahne
	        'FILE' => '',
771 1777 Luisehahne
			'TEXT_MODULE_ORDER' => $TEXT['MODULE_ORDER'],
772 1356 Luisehahne
	        'NAME' => $TEXT['SYSTEM_DEFAULT'],
773
	        'SELECTED' => $selected
774
	    ));
775 1777 Luisehahne
	$oTpl->parse('search_template_list', 'search_template_list_block', true);
776 1716 Luisehahne
	$sql  = 'SELECT `name`, `directory` FROM `'.TABLE_PREFIX.'addons` ';
777
	$sql .= 'WHERE `type` = \'template\' ';
778
	$sql .= 'AND `function` = \'template\' ';
779
	$sql .= 'ORDER BY `name`';
780
    if( ($result = $database->query($sql)) && ($result->numRows() > 0) )
781 1356 Luisehahne
	{
782 1777 Luisehahne
		while($addon = $result->fetchRow(MYSQL_ASSOC))
783 1356 Luisehahne
	    {
784 1716 Luisehahne
			if( $admin->get_permission($addon['directory'],'template' ) )
785
			{
786 1777 Luisehahne
				$oTpl->set_var('FILE', $addon['directory']);
787
				$oTpl->set_var('NAME', $addon['name']);
788 1716 Luisehahne
		        $selected = ($addon['directory'] == $search_template) ? $sSelected :  '';
789 1777 Luisehahne
				$oTpl->set_var('SELECTED', $selected);
790
				$oTpl->parse('search_template_list', 'search_template_list_block', true);
791 1716 Luisehahne
			}
792 1356 Luisehahne
		}
793
	}
794
795 1777 Luisehahne
	// Insert search select
796
    $oTpl->set_var(array(
797
		'TEXT_REGISTERED' => $TEXT['REGISTERED'],
798
		'TEXT_PUBLIC' => $TEXT['PUBLIC'],
799
		'TEXT_PRIVATE' => $TEXT['PRIVATE'],
800
		'TEXT_NONE' => $TEXT['NONE'],
801
		'TEXT_MAX_EXCERPT' => $TEXT['MAX_EXCERPT'],
802
		'TEXT_TIME_LIMIT' => $TEXT['TIME_LIMIT'],
803
		'TEXT_VISIBILITY' => $TEXT['VISIBILITY'],
804
		'TEXT_SEARCH' => $TEXT['SEARCH'],
805
		));
806
	if(SEARCH == 'private')
807 1356 Luisehahne
	{
808 1777 Luisehahne
    	$oTpl->set_var(array(
809
				'PRIVATE_SEARCH' => $sSelected,
810
				'REGISTERED_SEARCH' => '',
811
				'NONE_SEARCH' => '',
812 1721 Luisehahne
				));
813 1777 Luisehahne
	} elseif(SEARCH == 'public') {
814
    	$oTpl->set_var(array(
815
				'PRIVATE_SEARCH' => '',
816
				'REGISTERED_SEARCH' => '',
817
				'NONE_SEARCH' => '',
818 1721 Luisehahne
				));
819 1777 Luisehahne
	} elseif(SEARCH == 'registered') {
820
    	$oTpl->set_var(array(
821
				'PRIVATE_SEARCH' => '',
822
				'REGISTERED_SEARCH' => $sSelected,
823
				'NONE_SEARCH' => '',
824 1721 Luisehahne
				));
825 1777 Luisehahne
	} elseif(SEARCH == 'none') {
826
    	$oTpl->set_var(array(
827
				'PRIVATE_SEARCH' => '',
828
				'REGISTERED_SEARCH' => '',
829
				'NONE_SEARCH' => $sSelected,
830 1721 Luisehahne
				));
831 1356 Luisehahne
	}
832
833 1777 Luisehahne
if($is_advanced)
834
{
835
	$oTpl->parse('show_search', 'show_search_block');
836
} else {
837
	$oTpl->parse('show_search', '');
838
}
839 1409 FrankH
840 1777 Luisehahne
    $oTpl->set_block('main_block', 'show_access_block','show_access');
841
//  Work-out which wbmailer routine should be checked
842
	$oTpl->set_var(array(
843
		'TEXT_WBMAILER_DEFAULT_SETTINGS_NOTICE' => $TEXT['WBMAILER_DEFAULT_SETTINGS_NOTICE'],
844
		'TEXT_WBMAILER_DEFAULT_SENDER_MAIL' => $TEXT['WBMAILER_DEFAULT_SENDER_MAIL'],
845
		'TEXT_WBMAILER_DEFAULT_SENDER_NAME' => $TEXT['WBMAILER_DEFAULT_SENDER_NAME'],
846
		'TEXT_WBMAILER_NOTICE' => $TEXT['WBMAILER_NOTICE'],
847
		'TEXT_WBMAILER_FUNCTION' => $TEXT['WBMAILER_FUNCTION'],
848
		'TEXT_WBMAILER_SMTP_HOST' => $TEXT['WBMAILER_SMTP_HOST'],
849
		'TEXT_WBMAILER_PHP' => $TEXT['WBMAILER_PHP'],
850
		'TEXT_WBMAILER_SMTP' => $TEXT['WBMAILER_SMTP'],
851
		'TEXT_WBMAILER_SMTP_AUTH' => $TEXT['WBMAILER_SMTP_AUTH'],
852
		'TEXT_WBMAILER_SMTP_AUTH_NOTICE' => $TEXT['REQUIRED'].' '.$TEXT['WBMAILER_SMTP_AUTH'],
853
		'TEXT_WBMAILER_SMTP_USERNAME' => $TEXT['WBMAILER_SMTP_USERNAME'],
854
		'TEXT_WBMAILER_SMTP_PASSWORD' => $TEXT['WBMAILER_SMTP_PASSWORD'],
855
		'SMTP_AUTH_SELECTED' => $checked
856
		));
857 1356 Luisehahne
858 1668 Luisehahne
	// Work-out if developer infos feature is enabled
859
	if(defined('DEV_INFOS') && DEV_INFOS == true)
860
	{
861 1777 Luisehahne
    	$oTpl->set_var(array(
862 1721 Luisehahne
				'DEV_INFOS_ENABLED' => $checked,
863
				'DEV_INFOS_DISABLED' => '',
864
				));
865 1668 Luisehahne
	} else {
866 1777 Luisehahne
    	$oTpl->set_var(array(
867 1721 Luisehahne
				'DEV_INFOS_DISABLED' => $checked,
868
				'DEV_INFOS_ENABLED' => '',
869
				));
870 1668 Luisehahne
	}
871
872 1777 Luisehahne
//  Work-out which server os should be checked
873
	if(OPERATING_SYSTEM == 'linux')
874 1731 Luisehahne
	{
875 1777 Luisehahne
		$oTpl->set_var('LINUX_SELECTED', $checked);
876
		$oTpl->set_var('WINDOWS_SELECTED', '');
877
	} elseif(OPERATING_SYSTEM == 'windows') {
878
		$oTpl->set_var('WINDOWS_SELECTED', $checked);
879
		$oTpl->set_var('LINUX_SELECTED', '');
880 1731 Luisehahne
	}
881
882 1356 Luisehahne
	if(WBMAILER_ROUTINE == 'phpmail')
883
	{
884 1777 Luisehahne
		$oTpl->set_var('PHPMAIL_SELECTED', $checked);
885
		$oTpl->set_var('SMTP_VISIBILITY', ' style="display: none;"');
886
//		$oTpl->set_var('SMTP_VISIBILITY_AUTH', '');
887
		$oTpl->set_var('SMTP_AUTH_SELECTED', '');
888
		$oTpl->set_var('SMTPMAIL_SELECTED',  '');
889 1356 Luisehahne
	} elseif(WBMAILER_ROUTINE == 'smtp')
890
	{
891 1777 Luisehahne
		$oTpl->set_var('SMTPMAIL_SELECTED', $checked);
892
		$oTpl->set_var('PHPMAIL_SELECTED', '');
893
		$oTpl->set_var('SMTP_VISIBILITY', '');
894
//		$oTpl->set_var('SMTP_VISIBILITY_AUTH', '');
895 1356 Luisehahne
	}
896 1572 Luisehahne
/* deprecated
897 1356 Luisehahne
	// Work-out if SMTP authentification should be checked
898
	if(WBMAILER_SMTP_AUTH)
899
	{
900 1777 Luisehahne
		$oTpl->set_var('SMTP_AUTH_SELECTED', $checked);
901 1356 Luisehahne
		if(WBMAILER_ROUTINE == 'smtp')
902
	    {
903 1777 Luisehahne
			$oTpl->set_var('SMTP_VISIBILITY_AUTH', '');
904 1356 Luisehahne
905
		} else {
906 1777 Luisehahne
			$oTpl->set_var('SMTP_VISIBILITY_AUTH', ' style="display: none;"');
907 1356 Luisehahne
		}
908
	} else {
909 1777 Luisehahne
		$oTpl->set_var('SMTP_VISIBILITY_AUTH', ' style="display: none;"');
910 1356 Luisehahne
	}
911 1572 Luisehahne
*/
912 1356 Luisehahne
913 1777 Luisehahne
	// Work-out if 777 permissions are set
914
	$oTpl->set_var('WORLD_WRITEABLE_SELECTED', '');
915
	if(STRING_FILE_MODE == '0777' AND STRING_DIR_MODE == '0777')
916 1356 Luisehahne
	{
917 1777 Luisehahne
		$oTpl->set_var('WORLD_WRITEABLE_SELECTED', $checked);
918 1356 Luisehahne
	}
919
920 1716 Luisehahne
921 1777 Luisehahne
	$oTpl->set_var(array(
922
		'FILE_U_R_CHECKED' => '',
923
		'FILE_U_W_CHECKED' => '',
924
		'FILE_U_E_CHECKED' => '',
925
		'FILE_G_R_CHECKED' => '',
926
		'FILE_G_W_CHECKED' => '',
927
		'FILE_G_E_CHECKED' => '',
928
		'FILE_O_R_CHECKED' => '',
929
		'FILE_O_W_CHECKED' => '',
930
		'FILE_O_E_CHECKED' => '',
931
		'DIR_U_R_CHECKED' => '',
932
		'DIR_U_W_CHECKED' => '',
933
		'DIR_U_E_CHECKED' => '',
934
		'DIR_G_R_CHECKED' => '',
935
		'DIR_G_W_CHECKED' => '',
936
		'DIR_G_E_CHECKED' => '',
937
		'DIR_O_R_CHECKED' => '',
938
		'DIR_O_W_CHECKED' => '',
939
		'DIR_O_E_CHECKED' => '',
940
		));
941 1356 Luisehahne
942 1777 Luisehahne
//  Work-out which file mode boxes are checked
943 1356 Luisehahne
	if(extract_permission(STRING_FILE_MODE, 'u', 'r'))
944
	{
945 1777 Luisehahne
		$oTpl->set_var('FILE_U_R_CHECKED', $checked);
946 1356 Luisehahne
	}
947
	if(extract_permission(STRING_FILE_MODE, 'u', 'w'))
948
	{
949 1777 Luisehahne
		$oTpl->set_var('FILE_U_W_CHECKED', $checked);
950 1356 Luisehahne
	}
951
	if(extract_permission(STRING_FILE_MODE, 'u', 'e'))
952
	{
953 1777 Luisehahne
		$oTpl->set_var('FILE_U_E_CHECKED', $checked);
954 1356 Luisehahne
	}
955
	if(extract_permission(STRING_FILE_MODE, 'g', 'r'))
956
	{
957 1777 Luisehahne
		$oTpl->set_var('FILE_G_R_CHECKED', $checked);
958 1356 Luisehahne
	}
959
	if(extract_permission(STRING_FILE_MODE, 'g', 'w'))
960
	{
961 1777 Luisehahne
		$oTpl->set_var('FILE_G_W_CHECKED', $checked);
962 1356 Luisehahne
	}
963
	if(extract_permission(STRING_FILE_MODE, 'g', 'e'))
964
	{
965 1777 Luisehahne
		$oTpl->set_var('FILE_G_E_CHECKED', $checked);
966 1356 Luisehahne
	}
967
	if(extract_permission(STRING_FILE_MODE, 'o', 'r'))
968
	{
969 1777 Luisehahne
		$oTpl->set_var('FILE_O_R_CHECKED', $checked);
970 1356 Luisehahne
	}
971
	if(extract_permission(STRING_FILE_MODE, 'o', 'w'))
972
	{
973 1777 Luisehahne
		$oTpl->set_var('FILE_O_W_CHECKED', $checked);
974 1356 Luisehahne
	}
975
	if(extract_permission(STRING_FILE_MODE, 'o', 'e'))
976
	{
977 1777 Luisehahne
		$oTpl->set_var('FILE_O_E_CHECKED', $checked);
978 1356 Luisehahne
	}
979
	// Work-out which dir mode boxes are checked
980
	if(extract_permission(STRING_DIR_MODE, 'u', 'r'))
981
	{
982 1777 Luisehahne
		$oTpl->set_var('DIR_U_R_CHECKED', $checked);
983 1356 Luisehahne
	}
984
	if(extract_permission(STRING_DIR_MODE, 'u', 'w'))
985
	{
986 1777 Luisehahne
		$oTpl->set_var('DIR_U_W_CHECKED', $checked);
987 1356 Luisehahne
	}
988
	if(extract_permission(STRING_DIR_MODE, 'u', 'e'))
989
	{
990 1777 Luisehahne
		$oTpl->set_var('DIR_U_E_CHECKED', $checked);
991 1356 Luisehahne
	}
992
	if(extract_permission(STRING_DIR_MODE, 'g', 'r'))
993
	{
994 1777 Luisehahne
		$oTpl->set_var('DIR_G_R_CHECKED', $checked);
995 1356 Luisehahne
	}
996
	if(extract_permission(STRING_DIR_MODE, 'g', 'w'))
997
	{
998 1777 Luisehahne
		$oTpl->set_var('DIR_G_W_CHECKED', $checked);
999 1356 Luisehahne
	}
1000
	if(extract_permission(STRING_DIR_MODE, 'g', 'e'))
1001
	{
1002 1777 Luisehahne
		$oTpl->set_var('DIR_G_E_CHECKED', $checked);
1003 1356 Luisehahne
	}
1004
	if(extract_permission(STRING_DIR_MODE, 'o', 'r'))
1005
	{
1006 1777 Luisehahne
		$oTpl->set_var('DIR_O_R_CHECKED', $checked);
1007 1356 Luisehahne
	}
1008
	if(extract_permission(STRING_DIR_MODE, 'o', 'w'))
1009
	{
1010 1777 Luisehahne
		$oTpl->set_var('DIR_O_W_CHECKED', $checked);
1011 1356 Luisehahne
	}
1012
	if(extract_permission(STRING_DIR_MODE, 'o', 'e'))
1013
	{
1014 1777 Luisehahne
		$oTpl->set_var('DIR_O_E_CHECKED', $checked);
1015 1356 Luisehahne
	}
1016
1017 1777 Luisehahne
	$oTpl->set_var(array(
1018
		'PAGES_DIRECTORY' => PAGES_DIRECTORY,
1019
		'MODULES_DIRECTORY' => MODULES_UPGRADE_LIST,
1020
		'PAGE_ICON_DIR'   => PAGE_ICON_DIR,
1021
		'MEDIA_DIRECTORY' => MEDIA_DIRECTORY,
1022
		'PAGE_EXTENSION' => PAGE_EXTENSION,
1023
		'PAGE_SPACER' => PAGE_SPACER,
1024
		'TABLE_PREFIX' => TABLE_PREFIX
1025
	 ));
1026 1356 Luisehahne
1027
	// Insert Server Email value into template
1028 1777 Luisehahne
	$oTpl->set_var('SERVER_EMAIL', SERVER_EMAIL);
1029 1356 Luisehahne
1030 1777 Luisehahne
// Insert language text and messages
1031
	$oTpl->set_var(array(
1032
		'TEXT_DEV_INFOS' => $TEXT['DEV_INFOS'],
1033
		'TEXT_PAGES_DIRECTORY' => $TEXT['PAGES_DIRECTORY'],
1034
		'TEXT_PAGE_ICON_DIR' => $TEXT['PAGE_ICON_DIR'],
1035
		'TEXT_MEDIA_DIRECTORY' => $TEXT['MEDIA_DIRECTORY'],
1036
		'TEXT_PAGE_EXTENSION' => $TEXT['PAGE_EXTENSION'],
1037
		'TEXT_PAGE_SPACER' => $TEXT['PAGE_SPACER'],
1038
		'TEXT_RENAME_FILES_ON_UPLOAD' => $TEXT['RENAME_FILES_ON_UPLOAD'],
1039
		'TEXT_APP_NAME' => $TEXT['APP_NAME'],
1040
		'TEXT_SESSION_IDENTIFIER' => $TEXT['SESSION_IDENTIFIER'],
1041
		'TEXT_SEC_ANCHOR' => $TEXT['SEC_ANCHOR'],
1042
		'TEXT_SERVER_OPERATING_SYSTEM' => $TEXT['SERVER_OPERATING_SYSTEM'],
1043
		'TEXT_LINUX_UNIX_BASED' => $TEXT['LINUX_UNIX_BASED'],
1044
		'TEXT_WINDOWS' => $TEXT['WINDOWS'],
1045
		'TEXT_ADMIN' => $TEXT['ADMIN'],
1046
		'TEXT_TYPE' => $TEXT['TYPE'],
1047
		'TEXT_DATABASE' => $TEXT['DATABASE'],
1048
		'TEXT_HOST' => $TEXT['HOST'],
1049
		'TEXT_USERNAME' => $TEXT['USERNAME'],
1050
		'TEXT_PASSWORD' => $TEXT['PASSWORD'],
1051
		'TEXT_NAME' => $TEXT['NAME'],
1052
		'TEXT_TABLE_PREFIX' => $TEXT['TABLE_PREFIX'],
1053
		'TEXT_CHANGES' => $TEXT['CHANGES'],
1054
		'TEXT_FILES' => strtoupper(substr($TEXT['FILES'], 0, 1)).substr($TEXT['FILES'], 1),
1055
		'TEXT_DIRECTORIES' => $TEXT['DIRECTORIES'],
1056
		'TEXT_FILESYSTEM_PERMISSIONS' => $TEXT['FILESYSTEM_PERMISSIONS'],
1057
		'TEXT_USER' => $TEXT['USER'],
1058
		'TEXT_GROUP' => $TEXT['GROUP'],
1059
		'TEXT_OTHERS' => $TEXT['OTHERS'],
1060
		'TEXT_READ' => $TEXT['READ'],
1061
		'TEXT_WRITE' => $TEXT['WRITE'],
1062
		'TEXT_EXECUTE' => $TEXT['EXECUTE'],
1063
		'TEXT_WARN_PAGE_LEAVE' => '',
1064
		'TEXT_WORLD_WRITEABLE_FILE_PERMISSIONS' => $TEXT['WORLD_WRITEABLE_FILE_PERMISSIONS'],
1065
		'MODE_SWITCH_WARNING' => $MESSAGE['SETTINGS_MODE_SWITCH_WARNING'],
1066
		'WORLD_WRITEABLE_WARNING' => $MESSAGE['SETTINGS_WORLD_WRITEABLE_WARNING'],
1067
		));
1068 1356 Luisehahne
1069 1572 Luisehahne
if($is_advanced && $admin->get_user_id()=='1')
1070
{
1071 1777 Luisehahne
	$oTpl->parse('show_access', 'show_access_block');
1072 1572 Luisehahne
}else {
1073 1777 Luisehahne
	$oTpl->parse('show_access' , '');
1074 1572 Luisehahne
}
1075 1356 Luisehahne
1076
// Parse template objects output
1077 1777 Luisehahne
$oTpl->parse('main', 'main_block',false);
1078
$oTpl->pparse('output', 'page');
1079
//$oTpl->p('page');
1080
unset($oTpl);
1081 1356 Luisehahne
$admin->print_footer();