Project

General

Profile

1
<?php
2
/**
3
 *
4
 * @category        admin
5
 * @package         settings
6
 * @author          Ryan Djurovich, WebsiteBaker Project
7
 * @copyright       2009-2012, WebsiteBaker 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
 * @requirements    PHP 5.2.2 and higher
12
 * @version         $Id: index.php 1844 2012-12-28 06:03:26Z Luisehahne $
13
 * @filesource      $HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/admin/settings/index.php $
14
 * @lastmodified    $Date: 2012-12-28 07:03:26 +0100 (Fri, 28 Dec 2012) $
15
 *
16
 */
17

    
18
// Include config file
19
if(!defined('WB_URL'))
20
{
21
    $config_file = realpath('../../config.php');
22
    if(file_exists($config_file) && !defined('WB_URL'))
23
    {
24
    	require($config_file);
25
    }
26
}
27
if(!class_exists('admin', false)){ include(WB_PATH.'/framework/class.admin.php'); }
28

    
29
if(isset($_GET['advanced']) && $_GET['advanced'] == 'yes') {
30
	$admin = new admin('Settings', 'settings_advanced');
31
} else {
32
	$admin = new admin('Settings', 'settings_basic');
33
}
34

    
35
// add new values, later in upgrade-script
36
$cfg = array(
37
	'wbmail_signature' => defined('WBMAIL_SIGNATURE') ? WBMAIL_SIGNATURE : '',
38
	'confirmed_registration' => (defined('CONFIRMED_REGISTRATION') ? CONFIRMED_REGISTRATION : '0'),
39
	'modules_upgrade_list' => (defined('MODULES_UPGRADE_LIST') ? MODULES_UPGRADE_LIST : ''),
40
	);
41
db_update_key_value( 'settings', $cfg );
42

    
43
// Include the WB functions file
44
require_once(WB_PATH.'/framework/functions.php');
45
require_once(WB_PATH.'/framework/functions-utf8.php');
46

    
47
if(!class_exists('Template', false)){ include(WB_PATH.'/include/phplib/ttemplate.inc'); }
48

    
49
// Setup template object, parse vars to it, then parse it
50
// Create new template object
51
$oTpl = new Template(dirname($admin->correct_theme_source('settings.htt')),'comment');
52
//$oTpl->debug = true;
53
//$oTpl->filename_comments = true;
54
//$oTpl->unknown_regexp = "strict";
55
//$oTpl->halt_on_error = "report" ;
56

    
57
$oTpl->set_file('page',  'settings.htt');
58
$oTpl->set_block('page', 'main_block', 'main');
59

    
60
$mLang = ModLanguage::getInstance();
61
$mLang->setLanguage(dirname(__FILE__).'/languages/', LANGUAGE, DEFAULT_LANGUAGE);
62

    
63
$oTpl->set_var('FTAN', $admin->getFTAN());
64
/*-- insert all needed vars from language files ----------------------------------------*/
65
$oTpl->set_var($mLang->getLangArray());
66

    
67
// Query current settings in the db, then loop through them and print them
68
$query = "SELECT * FROM `".TABLE_PREFIX."settings`";
69
if($results = $database->query($query)) {
70
    while($setting = $results->fetchRow(MYSQL_ASSOC)) {
71
    	$setting_name = $setting['name'];
72
    	$setting_value = ( $setting_name != 'wbmailer_smtp_password' ) ? htmlspecialchars($setting['value']) : htmlentities($setting['value'], ENT_COMPAT, 'UTF-8');
73
    	$oTpl->set_var(strtoupper($setting_name),($setting_value));
74
    }
75
}
76

    
77
$is_advanced = (isset($_GET['advanced']) && $_GET['advanced'] == 'yes');
78
// Tell the browser whether or not to show advanced options
79
    if($is_advanced)
80
    {
81
    	$oTpl->set_var('DISPLAY_ADVANCED', '');
82
    	$oTpl->set_var('ADVANCED_FILE_PERMS_ID', 'file_perms_box');
83
    	$oTpl->set_var('BASIC_FILE_PERMS_ID', 'hide');
84
    	$oTpl->set_var('ADVANCED', 'yes');
85
    	$oTpl->set_var('ADVANCED_BUTTON', '&lt;&lt; '.$TEXT['HIDE_ADVANCED']);
86
    	$oTpl->set_var('ADVANCED_LINK', 'index.php?advanced=no');
87

    
88
    } else {
89
    	$oTpl->set_var('DISPLAY_ADVANCED', ' style="display: none;"');
90
    	$oTpl->set_var('BASIC_FILE_PERMS_ID', 'file_perms_box');
91
    	$oTpl->set_var('ADVANCED_FILE_PERMS_ID', 'hide');
92

    
93
    	$oTpl->set_var('ADVANCED', 'no');
94
    	$oTpl->set_var('ADVANCED_BUTTON', $TEXT['SHOW_ADVANCED'].' &gt;&gt;');
95
    	$oTpl->set_var('ADVANCED_LINK', 'index.php?advanced=yes');
96
    }
97

    
98
	$sSelected = ' selected="selected"';
99
	$checked   = ' checked="checked"';
100

    
101
	$oTpl->set_var(array(
102
		'WB_URL' => WB_URL,
103
		'THEME_URL' => THEME_URL,
104
		'ADMIN_URL' => ADMIN_URL,
105
	 ));
106

    
107
	// Insert language headings
108
	$oTpl->set_var(array(
109
		'HEADING_GENERAL_SETTINGS' => $HEADING['GENERAL_SETTINGS'],
110
		'HEADING_DEFAULT_SETTINGS' => $HEADING['DEFAULT_SETTINGS'],
111
		'HEADING_SEARCH_SETTINGS' => $HEADING['SEARCH_SETTINGS'],
112
		'HEADING_SERVER_SETTINGS' => $HEADING['SERVER_SETTINGS'],
113
		'HEADING_WBMAILER_SETTINGS' => $HEADING['WBMAILER_SETTINGS'],
114
		'HEADING_ADMINISTRATION_TOOLS' => $HEADING['ADMINISTRATION_TOOLS']
115
		)
116
	);
117

    
118
	// Insert language textarea label
119
	$oTpl->set_var(array(
120
		'TEXT_WEBSITE_TITLE' => $TEXT['WEBSITE_TITLE'],
121
		'TEXT_WEBSITE_DESCRIPTION' => $TEXT['WEBSITE_DESCRIPTION'],
122
		'TEXT_WEBSITE_KEYWORDS' => $TEXT['WEBSITE_KEYWORDS'],
123
		'TEXT_WEBSITE_HEADER' => $TEXT['WEBSITE_HEADER'],
124
		'TEXT_WEBSITE_FOOTER' => $TEXT['WEBSITE_FOOTER'],
125
		'TEXT_HEADER' => $TEXT['HEADER'],
126
		'TEXT_FOOTER' => $TEXT['FOOTER'],
127
		'TEXT_TEXT' => $TEXT['TEXT'],
128
		'TEXT_RESULTS_HEADER' => $TEXT['RESULTS_HEADER'],
129
		'TEXT_RESULTS_LOOP' => $TEXT['RESULTS_LOOP'],
130
		'TEXT_RESULTS_FOOTER' => $TEXT['RESULTS_FOOTER'],
131
		));
132

    
133
	// Insert generell language
134
    $oTpl->set_var(array(
135
		'TEXT_SAVE' => $TEXT['SAVE'],
136
		'TEXT_RESET' => $TEXT['RESET'],
137
		'TEXT_ENABLED' => $TEXT['ENABLED'],
138
		'TEXT_DISABLED' => $TEXT['DISABLED'],
139
		'TEXT_DEFAULT' => $TEXT['DEFAULT'],
140
		'TEXT_NO_RESULTS' => $TEXT['NO_RESULTS'],
141
		'TEXT_PLEASE_SELECT' => $TEXT['PLEASE_SELECT'],
142
		));
143

    
144
// Insert language labels
145
	$oTpl->set_var(array(
146
		'TEXT_PAGE_TRASH' => $TEXT['PAGE_TRASH'],
147
		'TEXT_PAGE_LANGUAGES' => $TEXT['PAGE_LANGUAGES'],
148
		'TEXT_FRONTEND' => $TEXT['FRONTEND'],
149
		'TEXT_LOGIN' => $TEXT['LOGIN'],
150
		'TEXT_HOMEPAGE_REDIRECTION' => $TEXT['HOMEPAGE_REDIRECTION'],
151
		'TEXT_SECTION_BLOCKS' => $TEXT['SECTION_BLOCKS'],
152
		'TEXT_MANAGE' => $TEXT['MANAGE'],
153
		'TEXT_SMART_LOGIN' => $TEXT['SMART_LOGIN'],
154
		'TEXT_PHP_ERROR_LEVEL' => $TEXT['PHP_ERROR_LEVEL'],
155
		'TEXT_WYSIWYG_STYLE' => $TEXT['WYSIWYG_STYLE'],
156
		'TEXT_CHARSET' => $TEXT['CHARSET'],
157
		'TEXT_REDIRECT_AFTER' => $TEXT['REDIRECT_AFTER'],
158
		'TEXT_SIGNUP' => $TEXT['SIGNUP'].' '.$TEXT['GROUP'],
159
		'TEXT_MULTILINGUAL' => $TEXT['MULTILINGUAL'],
160
		'TEXT_HOME_FOLDERS' => $TEXT['HOME_FOLDERS'],
161
		'TEXT_MANAGE_SECTIONS' => $HEADING['MANAGE_SECTIONS'],
162
		'TEXT_MULTIPLE_MENUS' => $TEXT['MULTIPLE_MENUS'],
163
		'TEXT_INLINE' => $TEXT['INLINE'],
164
		'TEXT_SEPARATE' => $TEXT['SEPARATE'],
165
		'TEXT_LANGUAGE' => $TEXT['LANGUAGE'],
166
		'TEXT_TIMEZONE' => $TEXT['TIMEZONE'],
167
		'TEXT_DATE_FORMAT' => $TEXT['DATE_FORMAT'],
168
		'TEXT_TIME_FORMAT' => $TEXT['TIME_FORMAT'],
169
		'TEXT_TEMPLATE' => $TEXT['TEMPLATE'],
170
		'TEXT_THEME' => $TEXT['THEME'],
171
		'TEXT_WYSIWYG_EDITOR' => $TEXT['WYSIWYG_EDITOR'],
172
		'TEXT_PAGE_LEVEL_LIMIT' => $TEXT['PAGE_LEVEL_LIMIT'],
173
		'TEXT_INTRO_PAGE' => $TEXT['INTRO_PAGE'],
174
		));
175

    
176
//  Insert permissions values
177
	if($admin->get_permission('settings_advanced') != true)
178
	{
179
		$oTpl->set_var('DISPLAY_ADVANCED_BUTTON', 'hide');
180
	}
181

    
182
    /**
183
     * <!-- BEGIN show_page_level_limit_block -->
184
     * Insert page level limits
185
     */
186
    $oTpl->set_block('main_block', 'show_page_level_limit_block', 'show_page_level_limit');
187
    /**
188
     * <!-- BEGIN page_level_limit_list_block -->
189
     */
190
    $oTpl->set_block('show_page_level_limit_block', 'page_level_limit_list_block', 'page_level_limit_list');
191
	for($i = 1; $i <= 10; $i++)
192
	{
193
		$oTpl->set_var('NUMBER', $i);
194
		if(PAGE_LEVEL_LIMIT == $i)
195
	    {
196
			$oTpl->set_var('SELECTED', $sSelected);
197
		} else {
198
			$oTpl->set_var('SELECTED', '');
199
		}
200
		$oTpl->parse('page_level_limit_list', 'page_level_limit_list_block', true);
201
	}
202

    
203
    /**
204
     * <!-- END page_level_limit_list_block -->
205
     * <!-- END show_page_level_limit_block -->
206
     */
207
    if($is_advanced)
208
    {
209
    	$oTpl->parse('show_page_level_limit', 'show_page_level_limit_block', false);
210
    } else {
211
    	$oTpl->parse('show_page_level_limit', '');
212
    }
213

    
214
    /**
215
     * Work-out if page trash feature is disabled, in-line, or separate
216
     */
217
	if(PAGE_TRASH == 'disabled')
218
	{
219
    	$oTpl->set_var(array(
220
				'PAGE_TRASH_DISABLED' => $checked,
221
				'PAGE_TRASH_INLINE' => '',
222
				'DISPLAY_PAGE_TRASH_SEPARATE' => 'display: none;',
223
				));
224
	} elseif(PAGE_TRASH == 'inline')
225
	{
226
    	$oTpl->set_var(array(
227
				'PAGE_TRASH_INLINE' => $checked,
228
				'PAGE_TRASH_DISABLED' => '',
229
				'DISPLAY_PAGE_TRASH_SEPARATE' => 'display: none;',
230
				));
231
	} elseif(PAGE_TRASH == 'separate')
232
	{
233
		$oTpl->set_var('PAGE_TRASH_SEPARATE', $checked);
234
		$oTpl->set_var('DISPLAY_PAGE_TRASH_SEPARATE', 'display: inline;');
235
	}
236

    
237
    /**
238
     * <!-- BEGIN show_checkbox_1_block -->
239
     * advanced yes
240
     */
241
    $oTpl->set_block('main_block', 'show_checkbox_1_block', 'show_checkbox_1');
242
//  Work-out if page languages feature is enabled
243
	if(defined('PAGE_LANGUAGES') && PAGE_LANGUAGES == true)
244
	{
245
    	$oTpl->set_var(array(
246
				'PAGE_LANGUAGES_ENABLED' => $checked,
247
				'PAGE_LANGUAGES_DISABLED' => '',
248
				));
249
	} else {
250
    	$oTpl->set_var(array(
251
				'PAGE_LANGUAGES_DISABLED' => $checked,
252
				'PAGE_LANGUAGES_ENABLED' => '',
253
				));
254
	}
255

    
256
//  Work-out if page extended feature is enabled
257
	if(defined('PAGE_EXTENDED') && PAGE_EXTENDED == true)
258
	{
259
    	$oTpl->set_var(array(
260
				'PAGE_EXTENDED_ENABLED' => $checked,
261
				'PAGE_EXTENDED_DISABLED' => '',
262
				));
263
	} else {
264
    	$oTpl->set_var(array(
265
				'PAGE_EXTENDED_DISABLED' => $checked,
266
				'PAGE_EXTENDED_ENABLED' => '',
267
				));
268
	}
269

    
270
//  Work-out if multiple menus feature is enabled
271
	if(defined('MULTIPLE_MENUS') && MULTIPLE_MENUS == true)
272
	{
273
    	$oTpl->set_var(array(
274
				'MULTIPLE_MENUS_ENABLED' => $checked,
275
				'MULTIPLE_MENUS_DISABLED' => '',
276
				));
277
	} else {
278
    	$oTpl->set_var(array(
279
				'MULTIPLE_MENUS_DISABLED' => $checked,
280
				'MULTIPLE_MENUS_ENABLED' => '',
281
				));
282
	}
283

    
284
    /**
285
     * <!-- END show_checkbox_1_block -->
286
     * advanced yes
287
     */
288
    if($is_advanced)
289
    {
290
    	$oTpl->parse('show_checkbox_1', 'show_checkbox_1_block');
291
    } else {
292
    	$oTpl->parse('show_checkbox_1', '');
293
    }
294

    
295
//  Work-out if media home folder feature is enabled
296
    $oTpl->set_var('TEXT_HOME_FOLDERS', $TEXT['HOME_FOLDERS']);
297
	if(HOME_FOLDERS)
298
	{
299
    	$oTpl->set_var(array(
300
				'HOME_FOLDERS_ENABLED' => $checked,
301
				'HOME_FOLDERS_DISABLED' => '',
302
				));
303
	} else {
304
    	$oTpl->set_var(array(
305
				'HOME_FOLDERS_DISABLED' => $checked,
306
				'HOME_FOLDERS_ENABLED' => '',
307
				));
308
	}
309

    
310
    $oTpl->set_block('main_block', 'show_checkbox_2_block', 'show_checkbox_2');
311
//  Work-out if manage sections feature is enabled
312
	if(MANAGE_SECTIONS)
313
	{
314
    	$oTpl->set_var(array(
315
				'MANAGE_SECTIONS_ENABLED' => $checked,
316
				'MANAGE_SECTIONS_DISABLED' => '',
317
				));
318
	} else {
319
    	$oTpl->set_var(array(
320
				'MANAGE_SECTIONS_DISABLED' => $checked,
321
				'MANAGE_SECTIONS_ENABLED' => '',
322
				));
323
	}
324

    
325
	// Work-out if section blocks feature is enabled
326
	if(defined('SECTION_BLOCKS') && SECTION_BLOCKS == true)
327
	{
328
    	$oTpl->set_var(array(
329
				'SECTION_BLOCKS_ENABLED' => $checked,
330
				'SECTION_BLOCKS_DISABLED' => '',
331
				));
332
	} else {
333
    	$oTpl->set_var(array(
334
				'SECTION_BLOCKS_DISABLED' => $checked,
335
				'SECTION_BLOCKS_ENABLED' => '',
336
				));
337
	}
338

    
339
    /**
340
     *
341
     */
342
    if($is_advanced)
343
    {
344
     	$oTpl->parse('show_checkbox_2', 'show_checkbox_2_block');
345
    } else {
346
    	$oTpl->parse('show_checkbox_2', '');
347
    }
348

    
349
	// Work-out if intro feature is enabled
350
	if(INTRO_PAGE)
351
	{
352
    	$oTpl->set_var(array(
353
				'INTRO_PAGE_ENABLED' => $checked,
354
				'INTRO_PAGE_DISABLED' => '',
355
				));
356
	} else {
357
    	$oTpl->set_var(array(
358
				'INTRO_PAGE_DISABLED' => $checked,
359
				'INTRO_PAGE_ENABLED' => '',
360
				));
361
	}
362
/**
363
 * <!-- BEGIN show_checkbox_3_block -->
364
 */
365
    $oTpl->set_block('main_block', 'show_checkbox_3_block', 'show_checkbox_3');
366
//  Work-out if homepage redirection feature is enabled
367
	if(defined('HOMEPAGE_REDIRECTION') && HOMEPAGE_REDIRECTION == true)
368
	{
369
    	$oTpl->set_var(array(
370
				'HOMEPAGE_REDIRECTION_ENABLED' => $checked,
371
				'HOMEPAGE_REDIRECTION_DISABLED' => '',
372
				));
373
	} else {
374
//		$oTpl->set_var('HOMEPAGE_REDIRECTION_DISABLED', $checked);
375
    	$oTpl->set_var(array(
376
				'HOMEPAGE_REDIRECTION_DISABLED' => $checked,
377
				'HOMEPAGE_REDIRECTION_ENABLED' => '',
378
				));
379
	}
380
//  Work-out if smart login feature is enabled
381
	if(defined('SMART_LOGIN') && SMART_LOGIN == true)
382
	{
383
		$oTpl->set_var('SMART_LOGIN_ENABLED', $checked);
384
    	$oTpl->set_var(array(
385
				'SMART_LOGIN_ENABLED' => $checked,
386
				'SMART_LOGIN_DISABLED' => '',
387
				));
388
	} else {
389
		$oTpl->set_var('SMART_LOGIN_DISABLED', $checked);
390
    	$oTpl->set_var(array(
391
				'SMART_LOGIN_DISABLED' => $checked,
392
				'SMART_LOGIN_ENABLED' => '',
393
				));
394
	}
395

    
396
    /**
397
     * <!-- END show_checkbox_3_block -->
398
     */
399
    if($is_advanced)
400
    {
401
    	$oTpl->parse('show_checkbox_3', 'show_checkbox_3_block');
402
    } else {
403
    	$oTpl->parse('show_checkbox_3', 'show_checkbox_3_block', '');
404
    }
405

    
406
//  Work-out if frontend login feature is enabled
407
	if(FRONTEND_LOGIN)
408
	{
409
    	$oTpl->set_var(array(
410
				'PRIVATE_ENABLED' => $checked,
411
				'PRIVATE_DISABLED' => '',
412
				));
413
	} else {
414
    	$oTpl->set_var(array(
415
				'PRIVATE_DISABLED' => $checked,
416
				'PRIVATE_ENABLED' => '',
417
				));
418
	}
419

    
420
	if(CONFIRMED_REGISTRATION)
421
	{
422
    	$oTpl->set_var(array(
423
				'CONFIRMED_REGISTRATION_ENABLED' => $checked,
424
				'CONFIRMED_REGISTRATION_DISABLED' => '',
425
				));
426
	} else {
427
    	$oTpl->set_var(array(
428
				'CONFIRMED_REGISTRATION_DISABLED' => $checked,
429
				'CONFIRMED_REGISTRATION_ENABLED' => '',
430
				));
431
	}
432

    
433
//  Insert groups into signup list
434
    $oTpl->set_block('main_block', 'group_list_block', 'group_list');
435
    $sql = "SELECT `group_id`, `name` FROM `".TABLE_PREFIX."groups` WHERE `group_id` != '1'";
436
	if($results = $database->query($sql)) {
437
    	if($results->numRows() > 0)
438
    	{
439
    		while($group = $results->fetchRow(MYSQL_ASSOC))
440
    	    {
441
    			$oTpl->set_var('ID', $group['group_id']);
442
    			$oTpl->set_var('NAME', $group['name']);
443
    			if(FRONTEND_SIGNUP == $group['group_id'])
444
    	        {
445
    				$oTpl->set_var('SELECTED', $sSelected);
446
    			} else {
447
    				$oTpl->set_var('SELECTED', '');
448
    			}
449
    			$oTpl->parse('group_list', 'group_list_block', true);
450
    		}
451
    	} else {
452
    		$oTpl->set_var('ID', 'disabled');
453
    		$oTpl->set_var('NAME', $MESSAGE['GROUPS']['NO_GROUPS_FOUND']);
454
    		$oTpl->parse('group_list', 'group_list_block', true);
455
    	}
456
	}
457

    
458
    /**
459
     * <!-- BEGIN show_redirect_timer_block -->
460
     */
461
    $oTpl->set_block('main_block', 'show_redirect_timer_block', 'show_redirect_timer');
462

    
463
    /**
464
     * <!-- END show_redirect_timer_block -->
465
     */
466
    if($is_advanced)
467
    {
468
    	$oTpl->parse('show_redirect_timer', 'show_redirect_timer_block');
469
    } else {
470
    	$oTpl->parse('show_redirect_timer', '');
471
    }
472

    
473
    /**
474
     * <!-- BEGIN show_php_error_level_block -->
475
     */
476
	// Insert default error reporting values
477
	require(ADMIN_PATH.'/interface/er_levels.php');
478
    $oTpl->set_block('main_block', 'show_php_error_level_block',  'show_php_error_level');
479
    $oTpl->set_block('show_php_error_level_block', 'php_error_list_block',  'php_error_list');
480
	foreach($ER_LEVELS AS $value => $title)
481
	{
482
		$oTpl->set_var('VALUE', $value);
483
		$oTpl->set_var('NAME', $title);
484
	    $selected = (ER_LEVEL == $value) ? $sSelected : '';
485
	    $oTpl->set_var('SELECTED', $selected);
486
		$oTpl->parse('php_error_list', 'php_error_list_block', true);
487
	}
488

    
489
    /**
490
     * <!-- END show_php_error_level_block -->
491
     */
492
    if($is_advanced)
493
    {
494
    	$oTpl->parse('show_php_error_level',  'show_php_error_level_block');
495
    } else {
496
    	$oTpl->parse('show_php_error_level', '');
497
    }
498

    
499
    /**
500
     * <!-- BEGIN show_wysiwyg_block -->
501
     */
502
//  Insert WYSIWYG modules
503
    $oTpl->set_block('main_block', 'show_wysiwyg_block',        'show_wysiwyg');
504
    $oTpl->set_block('show_wysiwyg_block', 'editor_list_block', 'editor_list');
505
	$file='none';
506
	$module_name=$TEXT['NONE'];
507
	$oTpl->set_var('FILE', $file);
508
	$oTpl->set_var('NAME', $module_name);
509
	$selected = (!defined('WYSIWYG_EDITOR') || $file == WYSIWYG_EDITOR) ? $sSelected : '';
510
	$oTpl->set_var('SELECTED', $selected);
511
	$oTpl->parse('editor_list', 'editor_list_block', true);
512
	$sql  = 'SELECT `name`, `directory` FROM `'.TABLE_PREFIX.'addons` ';
513
	$sql .= 'WHERE `type` = \'module\' ';
514
	$sql .= 'AND `function` = \'wysiwyg\' ';
515
	$sql .= 'ORDER BY `name`';
516
	if( ($result = $database->query($sql)) && ($result->numRows() > 0) )
517
	{
518
		while($addon = $result->fetchRow(MYSQL_ASSOC))
519
	    {
520
			if( $admin->get_permission($addon['directory'],'module' ) )
521
			{
522
				$oTpl->set_var('FILE', $addon['directory']);
523
				$oTpl->set_var('NAME', $addon['name']);
524
				$selected = (!defined('WYSIWYG_EDITOR') || $addon['directory'] == WYSIWYG_EDITOR) ? $sSelected : '';
525
				$oTpl->set_var('SELECTED', $selected);
526
				$oTpl->parse('editor_list', 'editor_list_block', true);
527
			}
528
		}
529
	}
530

    
531
    /**
532
     * <!-- END show_wysiwyg_block -->
533
     */
534
    if($is_advanced)
535
    {
536
    	$oTpl->parse('show_wysiwyg','show_wysiwyg_block');
537
    } else {
538
    	$oTpl->parse('show_wysiwyg', '');
539
    }
540

    
541
//  Insert language values
542
    $oTpl->set_block('main_block', 'language_list_block', 'language_list');
543
	$sql  = 'SELECT `name`, `directory` FROM `'.TABLE_PREFIX.'addons` ';
544
	$sql .= 'WHERE `type` = \'language\' ';
545
	$sql .= 'AND `function` != \'theme\' ';
546
	$sql .= 'ORDER BY `directory`';
547
	if( ($result = $database->query($sql)) && ($result->numRows() > 0) )
548
	{
549
		while($addon = $result->fetchRow(MYSQL_ASSOC)) {
550
	        $langIcons = (empty($addon['directory'])) ? 'none' : strtolower($addon['directory']);
551

    
552
			$oTpl->set_var('CODE',        $addon['directory']);
553
			$oTpl->set_var('NAME',        $addon['name']);
554
			$oTpl->set_var('FLAG',        THEME_URL.'/images/flags/'.$langIcons);
555
			$oTpl->set_var('SELECTED',    (DEFAULT_LANGUAGE == $addon['directory'] ? $sSelected : '') );
556
			$oTpl->parse('language_list', 'language_list_block', true);
557
		}
558
	}
559
    /**
560
     * <!-- BEGIN show_charset_block -->
561
     */
562
//  Insert default charset values
563
    $oTpl->set_block('main_block', 'show_charset_block', 'show_charset');
564
	require(ADMIN_PATH.'/interface/charsets.php');
565
    $oTpl->set_block('show_charset_block', 'charset_list_block', 'charset_list');
566
	foreach($CHARSETS AS $code => $title) {
567
		$oTpl->set_var('VALUE', $code);
568
		$oTpl->set_var('NAME', $title);
569
		if(DEFAULT_CHARSET == $code) {
570
			$oTpl->set_var('SELECTED', $sSelected);
571
		} else {
572
			$oTpl->set_var('SELECTED', '');
573
		}
574
		$oTpl->parse('charset_list', 'charset_list_block', true);
575
	}
576
    /**
577
     * <!-- END show_charset_block -->
578
     */
579
    if($is_advanced)
580
    {
581
    	$oTpl->parse('show_charset', 'show_charset_block');
582
    } else {
583
    	$oTpl->parse('show_charset', '');
584
    }
585

    
586
//  nsert default timezone values
587
	require(ADMIN_PATH.'/interface/timezones.php');
588
    $oTpl->set_block('main_block', 'timezone_list_block','timezone_list');
589
	foreach($TIMEZONES AS $hour_offset => $title)
590
	{
591
//  Make sure we dont list "System Default" as we are setting this value!
592
		if($hour_offset != '-20') {
593
			$oTpl->set_var('VALUE', $hour_offset);
594
			$oTpl->set_var('NAME', $title);
595
			if(DEFAULT_TIMEZONE == $hour_offset*60*60) {
596
				$oTpl->set_var('SELECTED', $sSelected);
597
			} else {
598
				$oTpl->set_var('SELECTED', '');
599
			}
600
			$oTpl->parse('timezone_list', 'timezone_list_block', true);
601
		}
602
	}
603

    
604
//  Insert date format list
605
	require(ADMIN_PATH.'/interface/date_formats.php');
606
    $oTpl->set_block('main_block', 'date_format_list_block', 'date_format_list');
607
	foreach($DATE_FORMATS AS $format => $title) {
608
		$format = str_replace('|', ' ', $format); // Add's white-spaces (not able to be stored in array key)
609
		if($format != 'system_default') {
610
			$oTpl->set_var('VALUE', $format);
611
		} else {
612
			$oTpl->set_var('VALUE', '');
613
		}
614
		$oTpl->set_var('NAME', $title);
615
		if(DEFAULT_DATE_FORMAT == $format) {
616
			$oTpl->set_var('SELECTED', $sSelected);
617
		} else {
618
			$oTpl->set_var('SELECTED', '');
619
		}
620
		$oTpl->parse('date_format_list', 'date_format_list_block', true);
621
	}
622

    
623
//  Insert time format list
624
	require(ADMIN_PATH.'/interface/time_formats.php');
625
    $oTpl->set_block('main_block', 'time_format_list_block', 'time_format_list');
626
	foreach($TIME_FORMATS AS $format => $title) {
627
		$format = str_replace('|', ' ', $format); // Add's white-spaces (not able to be stored in array key)
628
		if($format != 'system_default') {
629
			$oTpl->set_var('VALUE', $format);
630
		} else {
631
			$oTpl->set_var('VALUE', '');
632
		}
633
		$oTpl->set_var('NAME', $title);
634
		if(DEFAULT_TIME_FORMAT == $format) {
635
			$oTpl->set_var('SELECTED', $sSelected);
636
		} else {
637
			$oTpl->set_var('SELECTED', '');
638
		}
639
		$oTpl->parse('time_format_list', 'time_format_list_block', true);
640
	}
641

    
642
// Insert templates
643
    $oTpl->set_block('main_block', 'template_list_block',         'template_list');
644
	$sql  = 'SELECT `name`, `directory` FROM `'.TABLE_PREFIX.'addons` ';
645
	$sql .= 'WHERE `type` = \'template\' ';
646
	$sql .= 'AND `function` != \'theme\' ';
647
	$sql .= 'ORDER BY `name`';
648
	if( ($result = $database->query($sql)) && ($result->numRows() > 0) )
649
	{
650
		while($addon = $result->fetchRow(MYSQL_ASSOC))
651
		{
652
			if( $admin->get_permission($addon['directory'],'template' ) )
653
			{
654
				$oTpl->set_var('FILE', $addon['directory']);
655
				$oTpl->set_var('NAME', $addon['name']);
656
				$selected = (($addon['directory'] == DEFAULT_TEMPLATE) ? $sSelected : '');
657
				$oTpl->set_var('SELECTED', $selected);
658
				$oTpl->parse('template_list', 'template_list_block', true);
659
			}
660
		}
661
	}
662

    
663
// Insert backend theme
664
    $oTpl->set_block('main_block', 'theme_list_block',            'theme_list');
665
	$sql  = 'SELECT `name`, `directory` FROM `'.TABLE_PREFIX.'addons` ';
666
	$sql .= 'WHERE `type` = \'template\' ';
667
	$sql .= 'AND `function` = \'theme\' ';
668
	$sql .= 'ORDER BY `name`';
669

    
670
	if( ($result = $database->query($sql)) && ($result->numRows() > 0) )
671
	{
672
		while($addon = $result->fetchRow(MYSQL_ASSOC))
673
		{
674
			if( $admin->get_permission($addon['directory'],'template' ) )
675
			{
676
				$oTpl->set_var('FILE', $addon['directory']);
677
				$oTpl->set_var('NAME', $addon['name']);
678
				$selected = (($addon['directory'] == DEFAULT_THEME) ? $sSelected : '');
679
				$oTpl->set_var('SELECTED', $selected);
680
				$oTpl->parse('theme_list', 'theme_list_block', true);
681
			}
682
		}
683
	}
684

    
685
//  Work-out if warn_page_leave feature is enabled
686
//	if (defined('WARN_PAGE_LEAVE') && WARN_PAGE_LEAVE == true)
687
//	{
688
//    	$oTpl->set_var(array(
689
//				'WARN_PAGE_LEAVE_ENABLED' => $checked,
690
//				'WARN_PAGE_LEAVE_DISABLED' => '',
691
//				));
692
//	} else {
693
//    	$oTpl->set_var(array(
694
//				'MANAGE_SECTIONS_DISABLED' => $checked,
695
//				'WARN_PAGE_LEAVE_DISABLED' => '',
696
//				));
697
//	}
698

    
699
/*  Make's sure GD library is installed */
700
//	if(extension_loaded('gd') && function_exists('imageCreateFromJpeg'))
701
//	{
702
//		$oTpl->set_var('GD_EXTENSION_ENABLED', '');
703
//	} else {
704
//		$oTpl->set_var('GD_EXTENSION_ENABLED', ' style="display: none;"');
705
//	}
706

    
707
//  Insert permissions values
708
//	if($admin->get_permission('settings_advanced') != true)
709
//	{
710
//		$oTpl->set_var('DISPLAY_ADVANCED_BUTTON', 'hide');
711
//	}
712

    
713
/**
714
 *
715
 *
716
 */
717
    $oTpl->set_block('main_block', 'show_search_block','show_search');
718
	$query = "SELECT * FROM `".TABLE_PREFIX."search` WHERE `extra` = '' ";
719
	if($results = $database->query($query))
720
    {
721
    	// Query current settings in the db, then loop through them and print them
722
    	while($setting = $results->fetchRow(MYSQL_ASSOC))
723
    	{
724
    		$setting_name = $setting['name'];
725
    		$setting_value = htmlspecialchars(($setting['value']));
726
    		switch($setting_name) {
727
    			// Search header
728
    			case 'header':
729
    				$oTpl->set_var('SEARCH_HEADER', $setting_value);
730
    			break;
731
    			// Search results header
732
    			case 'results_header':
733
    				$oTpl->set_var('SEARCH_RESULTS_HEADER', $setting_value);
734
    			break;
735
    			// Search results loop
736
    			case 'results_loop':
737
    				$oTpl->set_var('SEARCH_RESULTS_LOOP', $setting_value);
738
    			break;
739
    			// Search results footer
740
    			case 'results_footer':
741
    				$oTpl->set_var('SEARCH_RESULTS_FOOTER', $setting_value);
742
    			break;
743
    			// Search no results
744
    			case 'no_results':
745
    				$oTpl->set_var('SEARCH_NO_RESULTS', $setting_value);
746
    			break;
747
    			// Search footer
748
    			case 'footer':
749
    				$oTpl->set_var('SEARCH_FOOTER', $setting_value);
750
    			break;
751
    			// Search module-order
752
    			case 'module_order':
753
    				$oTpl->set_var('SEARCH_MODULE_ORDER', $setting_value);
754
    			break;
755
    			// Search max lines of excerpt
756
    			case 'max_excerpt':
757
    				$oTpl->set_var('SEARCH_MAX_EXCERPT', $setting_value);
758
    			break;
759
    			// time-limit
760
    			case 'time_limit':
761
    				$oTpl->set_var('SEARCH_TIME_LIMIT', $setting_value);
762
    			break;
763
    			// Search template
764
    			case 'template':
765
    				$search_template = $setting_value;
766
    			break;
767
    		}
768
    	}
769
	}
770

    
771
// Insert templates for search settings
772
    $oTpl->set_block('main_block', 'search_template_list_block',  'search_template_list');
773
	$search_template = ( ($search_template == DEFAULT_TEMPLATE) || ($search_template == '') ) ? '' : $search_template;
774
	$selected = ( ($search_template != DEFAULT_TEMPLATE) ) ?  $sSelected : '';
775

    
776
	$oTpl->set_var(array(
777
	        'FILE' => '',
778
			'TEXT_MODULE_ORDER' => $TEXT['MODULE_ORDER'],
779
	        'NAME' => $TEXT['SYSTEM_DEFAULT'],
780
	        'SELECTED' => $selected
781
	    ));
782
	$oTpl->parse('search_template_list', 'search_template_list_block', true);
783
	$sql  = 'SELECT `name`, `directory` FROM `'.TABLE_PREFIX.'addons` ';
784
	$sql .= 'WHERE `type` = \'template\' ';
785
	$sql .= 'AND `function` = \'template\' ';
786
	$sql .= 'ORDER BY `name`';
787
    if( ($result = $database->query($sql)) && ($result->numRows() > 0) )
788
	{
789
		while($addon = $result->fetchRow(MYSQL_ASSOC))
790
	    {
791
			if( $admin->get_permission($addon['directory'],'template' ) )
792
			{
793
				$oTpl->set_var('FILE', $addon['directory']);
794
				$oTpl->set_var('NAME', $addon['name']);
795
		        $selected = ($addon['directory'] == $search_template) ? $sSelected :  '';
796
				$oTpl->set_var('SELECTED', $selected);
797
				$oTpl->parse('search_template_list', 'search_template_list_block', true);
798
			}
799
		}
800
	}
801

    
802
	// Insert search select
803
    $oTpl->set_var(array(
804
		'TEXT_REGISTERED' => $TEXT['REGISTERED'],
805
		'TEXT_PUBLIC' => $TEXT['PUBLIC'],
806
		'TEXT_PRIVATE' => $TEXT['PRIVATE'],
807
		'TEXT_NONE' => $TEXT['NONE'],
808
		'TEXT_MAX_EXCERPT' => $TEXT['MAX_EXCERPT'],
809
		'TEXT_TIME_LIMIT' => $TEXT['TIME_LIMIT'],
810
		'TEXT_VISIBILITY' => $TEXT['VISIBILITY'],
811
		'TEXT_SEARCH' => $TEXT['SEARCH'],
812
		));
813
	if(SEARCH == 'private')
814
	{
815
    	$oTpl->set_var(array(
816
				'PRIVATE_SEARCH' => $sSelected,
817
				'REGISTERED_SEARCH' => '',
818
				'NONE_SEARCH' => '',
819
				));
820
	} elseif(SEARCH == 'public') {
821
    	$oTpl->set_var(array(
822
				'PRIVATE_SEARCH' => '',
823
				'REGISTERED_SEARCH' => '',
824
				'NONE_SEARCH' => '',
825
				));
826
	} elseif(SEARCH == 'registered') {
827
    	$oTpl->set_var(array(
828
				'PRIVATE_SEARCH' => '',
829
				'REGISTERED_SEARCH' => $sSelected,
830
				'NONE_SEARCH' => '',
831
				));
832
	} elseif(SEARCH == 'none') {
833
    	$oTpl->set_var(array(
834
				'PRIVATE_SEARCH' => '',
835
				'REGISTERED_SEARCH' => '',
836
				'NONE_SEARCH' => $sSelected,
837
				));
838
	}
839

    
840
if($is_advanced)
841
{
842
	$oTpl->parse('show_search', 'show_search_block');
843
} else {
844
	$oTpl->parse('show_search', '');
845
}
846

    
847
    $oTpl->set_block('main_block', 'show_access_block','show_access');
848
//  Work-out which wbmailer routine should be checked
849
	$oTpl->set_var(array(
850
		'TEXT_WBMAILER_DEFAULT_SETTINGS_NOTICE' => $TEXT['WBMAILER_DEFAULT_SETTINGS_NOTICE'],
851
		'TEXT_WBMAILER_DEFAULT_SENDER_MAIL' => $TEXT['WBMAILER_DEFAULT_SENDER_MAIL'],
852
		'TEXT_WBMAILER_DEFAULT_SENDER_NAME' => $TEXT['WBMAILER_DEFAULT_SENDER_NAME'],
853
		'TEXT_WBMAILER_NOTICE' => $TEXT['WBMAILER_NOTICE'],
854
		'TEXT_WBMAILER_FUNCTION' => $TEXT['WBMAILER_FUNCTION'],
855
		'TEXT_WBMAILER_SMTP_HOST' => $TEXT['WBMAILER_SMTP_HOST'],
856
		'TEXT_WBMAILER_PHP' => $TEXT['WBMAILER_PHP'],
857
		'TEXT_WBMAILER_SMTP' => $TEXT['WBMAILER_SMTP'],
858
		'TEXT_WBMAILER_SMTP_AUTH' => $TEXT['WBMAILER_SMTP_AUTH'],
859
		'TEXT_WBMAILER_SMTP_AUTH_NOTICE' => $TEXT['REQUIRED'].' '.$TEXT['WBMAILER_SMTP_AUTH'],
860
		'TEXT_WBMAILER_SMTP_USERNAME' => $TEXT['WBMAILER_SMTP_USERNAME'],
861
		'TEXT_WBMAILER_SMTP_PASSWORD' => $TEXT['WBMAILER_SMTP_PASSWORD'],
862
		'SMTP_AUTH_SELECTED' => $checked
863
		));
864

    
865
	// Work-out if developer infos feature is enabled
866
	if(defined('DEV_INFOS') && DEV_INFOS == true)
867
	{
868
    	$oTpl->set_var(array(
869
				'DEV_INFOS_ENABLED' => $checked,
870
				'DEV_INFOS_DISABLED' => '',
871
				));
872
	} else {
873
    	$oTpl->set_var(array(
874
				'DEV_INFOS_DISABLED' => $checked,
875
				'DEV_INFOS_ENABLED' => '',
876
				));
877
	}
878

    
879
//  Work-out which server os should be checked
880
	if(OPERATING_SYSTEM == 'linux')
881
	{
882
		$oTpl->set_var('LINUX_SELECTED', $checked);
883
		$oTpl->set_var('WINDOWS_SELECTED', '');
884
	} elseif(OPERATING_SYSTEM == 'windows') {
885
		$oTpl->set_var('WINDOWS_SELECTED', $checked);
886
		$oTpl->set_var('LINUX_SELECTED', '');
887
	}
888

    
889
	if(WBMAILER_ROUTINE == 'phpmail')
890
	{
891
		$oTpl->set_var('PHPMAIL_SELECTED', $checked);
892
		$oTpl->set_var('SMTP_VISIBILITY', ' style="display: none;"');
893
//		$oTpl->set_var('SMTP_VISIBILITY_AUTH', '');
894
		$oTpl->set_var('SMTP_AUTH_SELECTED', '');
895
		$oTpl->set_var('SMTPMAIL_SELECTED',  '');
896
	} elseif(WBMAILER_ROUTINE == 'smtp')
897
	{
898
		$oTpl->set_var('SMTPMAIL_SELECTED', $checked);
899
		$oTpl->set_var('PHPMAIL_SELECTED', '');
900
		$oTpl->set_var('SMTP_VISIBILITY', '');
901
//		$oTpl->set_var('SMTP_VISIBILITY_AUTH', '');
902
	}
903
/* deprecated
904
	// Work-out if SMTP authentification should be checked
905
	if(WBMAILER_SMTP_AUTH)
906
	{
907
		$oTpl->set_var('SMTP_AUTH_SELECTED', $checked);
908
		if(WBMAILER_ROUTINE == 'smtp')
909
	    {
910
			$oTpl->set_var('SMTP_VISIBILITY_AUTH', '');
911

    
912
		} else {
913
			$oTpl->set_var('SMTP_VISIBILITY_AUTH', ' style="display: none;"');
914
		}
915
	} else {
916
		$oTpl->set_var('SMTP_VISIBILITY_AUTH', ' style="display: none;"');
917
	}
918
*/
919

    
920
	// Work-out if 777 permissions are set
921
	$oTpl->set_var('WORLD_WRITEABLE_SELECTED', '');
922
	if(STRING_FILE_MODE == '0777' AND STRING_DIR_MODE == '0777')
923
	{
924
		$oTpl->set_var('WORLD_WRITEABLE_SELECTED', $checked);
925
	}
926

    
927

    
928
	$oTpl->set_var(array(
929
		'FILE_U_R_CHECKED' => '',
930
		'FILE_U_W_CHECKED' => '',
931
		'FILE_U_E_CHECKED' => '',
932
		'FILE_G_R_CHECKED' => '',
933
		'FILE_G_W_CHECKED' => '',
934
		'FILE_G_E_CHECKED' => '',
935
		'FILE_O_R_CHECKED' => '',
936
		'FILE_O_W_CHECKED' => '',
937
		'FILE_O_E_CHECKED' => '',
938
		'DIR_U_R_CHECKED' => '',
939
		'DIR_U_W_CHECKED' => '',
940
		'DIR_U_E_CHECKED' => '',
941
		'DIR_G_R_CHECKED' => '',
942
		'DIR_G_W_CHECKED' => '',
943
		'DIR_G_E_CHECKED' => '',
944
		'DIR_O_R_CHECKED' => '',
945
		'DIR_O_W_CHECKED' => '',
946
		'DIR_O_E_CHECKED' => '',
947
		));
948

    
949
//  Work-out which file mode boxes are checked
950
	if(extract_permission(STRING_FILE_MODE, 'u', 'r'))
951
	{
952
		$oTpl->set_var('FILE_U_R_CHECKED', $checked);
953
	}
954
	if(extract_permission(STRING_FILE_MODE, 'u', 'w'))
955
	{
956
		$oTpl->set_var('FILE_U_W_CHECKED', $checked);
957
	}
958
	if(extract_permission(STRING_FILE_MODE, 'u', 'e'))
959
	{
960
		$oTpl->set_var('FILE_U_E_CHECKED', $checked);
961
	}
962
	if(extract_permission(STRING_FILE_MODE, 'g', 'r'))
963
	{
964
		$oTpl->set_var('FILE_G_R_CHECKED', $checked);
965
	}
966
	if(extract_permission(STRING_FILE_MODE, 'g', 'w'))
967
	{
968
		$oTpl->set_var('FILE_G_W_CHECKED', $checked);
969
	}
970
	if(extract_permission(STRING_FILE_MODE, 'g', 'e'))
971
	{
972
		$oTpl->set_var('FILE_G_E_CHECKED', $checked);
973
	}
974
	if(extract_permission(STRING_FILE_MODE, 'o', 'r'))
975
	{
976
		$oTpl->set_var('FILE_O_R_CHECKED', $checked);
977
	}
978
	if(extract_permission(STRING_FILE_MODE, 'o', 'w'))
979
	{
980
		$oTpl->set_var('FILE_O_W_CHECKED', $checked);
981
	}
982
	if(extract_permission(STRING_FILE_MODE, 'o', 'e'))
983
	{
984
		$oTpl->set_var('FILE_O_E_CHECKED', $checked);
985
	}
986
	// Work-out which dir mode boxes are checked
987
	if(extract_permission(STRING_DIR_MODE, 'u', 'r'))
988
	{
989
		$oTpl->set_var('DIR_U_R_CHECKED', $checked);
990
	}
991
	if(extract_permission(STRING_DIR_MODE, 'u', 'w'))
992
	{
993
		$oTpl->set_var('DIR_U_W_CHECKED', $checked);
994
	}
995
	if(extract_permission(STRING_DIR_MODE, 'u', 'e'))
996
	{
997
		$oTpl->set_var('DIR_U_E_CHECKED', $checked);
998
	}
999
	if(extract_permission(STRING_DIR_MODE, 'g', 'r'))
1000
	{
1001
		$oTpl->set_var('DIR_G_R_CHECKED', $checked);
1002
	}
1003
	if(extract_permission(STRING_DIR_MODE, 'g', 'w'))
1004
	{
1005
		$oTpl->set_var('DIR_G_W_CHECKED', $checked);
1006
	}
1007
	if(extract_permission(STRING_DIR_MODE, 'g', 'e'))
1008
	{
1009
		$oTpl->set_var('DIR_G_E_CHECKED', $checked);
1010
	}
1011
	if(extract_permission(STRING_DIR_MODE, 'o', 'r'))
1012
	{
1013
		$oTpl->set_var('DIR_O_R_CHECKED', $checked);
1014
	}
1015
	if(extract_permission(STRING_DIR_MODE, 'o', 'w'))
1016
	{
1017
		$oTpl->set_var('DIR_O_W_CHECKED', $checked);
1018
	}
1019
	if(extract_permission(STRING_DIR_MODE, 'o', 'e'))
1020
	{
1021
		$oTpl->set_var('DIR_O_E_CHECKED', $checked);
1022
	}
1023
	$sReadOnly = '';
1024
	$sPagesEditType = 'text';
1025
	if( $bPagesCanModify = ($database->get_one('SELECT COUNT(*) FROM `'.TABLE_PREFIX.'pages`'))!=0 ) {
1026
		$sReadOnly = ' readonly="readonly"';
1027
		$sPagesEditType = 'grey bold';
1028
	}
1029

    
1030
	$oTpl->set_var(array(
1031
		'PAGES_DIRECTORY' => PAGES_DIRECTORY,
1032
		'PAGES_READONLY' => $sReadOnly,
1033
		'PAGES_EDIT_TYPE' => $sPagesEditType,
1034
		'MODULES_DIRECTORY' => MODULES_UPGRADE_LIST,
1035
		'PAGE_ICON_DIR'   => PAGE_ICON_DIR,
1036
		'MEDIA_DIRECTORY' => MEDIA_DIRECTORY,
1037
		'PAGE_EXTENSION' => PAGE_EXTENSION,
1038
		'PAGE_SPACER' => PAGE_SPACER,
1039
		'TABLE_PREFIX' => TABLE_PREFIX
1040
	 ));
1041

    
1042
	// Insert Server Email value into template
1043
	$oTpl->set_var('SERVER_EMAIL', SERVER_EMAIL);
1044

    
1045
// Insert language text and messages
1046
	$oTpl->set_var(array(
1047
		'TEXT_DEV_INFOS' => $TEXT['DEV_INFOS'],
1048
		'TEXT_PAGES_DIRECTORY' => $TEXT['PAGES_DIRECTORY'],
1049
		'TEXT_PAGE_ICON_DIR' => $TEXT['PAGE_ICON_DIR'],
1050
		'TEXT_MEDIA_DIRECTORY' => $TEXT['MEDIA_DIRECTORY'],
1051
		'TEXT_PAGE_EXTENSION' => $TEXT['PAGE_EXTENSION'],
1052
		'TEXT_PAGE_SPACER' => $TEXT['PAGE_SPACER'],
1053
		'TEXT_RENAME_FILES_ON_UPLOAD' => $TEXT['RENAME_FILES_ON_UPLOAD'],
1054
		'TEXT_APP_NAME' => $TEXT['APP_NAME'],
1055
		'TEXT_SESSION_IDENTIFIER' => $TEXT['SESSION_IDENTIFIER'],
1056
		'TEXT_SEC_ANCHOR' => $TEXT['SEC_ANCHOR'],
1057
		'TEXT_SERVER_OPERATING_SYSTEM' => $TEXT['SERVER_OPERATING_SYSTEM'],
1058
		'TEXT_LINUX_UNIX_BASED' => $TEXT['LINUX_UNIX_BASED'],
1059
		'TEXT_WINDOWS' => $TEXT['WINDOWS'],
1060
		'TEXT_ADMIN' => $TEXT['ADMIN'],
1061
		'TEXT_TYPE' => $TEXT['TYPE'],
1062
		'TEXT_DATABASE' => $TEXT['DATABASE'],
1063
		'TEXT_HOST' => $TEXT['HOST'],
1064
		'TEXT_USERNAME' => $TEXT['USERNAME'],
1065
		'TEXT_PASSWORD' => $TEXT['PASSWORD'],
1066
		'TEXT_NAME' => $TEXT['NAME'],
1067
		'TEXT_TABLE_PREFIX' => $TEXT['TABLE_PREFIX'],
1068
		'TEXT_CHANGES' => $TEXT['CHANGES'],
1069
		'TEXT_FILES' => strtoupper(substr($TEXT['FILES'], 0, 1)).substr($TEXT['FILES'], 1),
1070
		'TEXT_DIRECTORIES' => $TEXT['DIRECTORIES'],
1071
		'TEXT_FILESYSTEM_PERMISSIONS' => $TEXT['FILESYSTEM_PERMISSIONS'],
1072
		'TEXT_USER' => $TEXT['USER'],
1073
		'TEXT_GROUP' => $TEXT['GROUP'],
1074
		'TEXT_OTHERS' => $TEXT['OTHERS'],
1075
		'TEXT_READ' => $TEXT['READ'],
1076
		'TEXT_WRITE' => $TEXT['WRITE'],
1077
		'TEXT_EXECUTE' => $TEXT['EXECUTE'],
1078
		'TEXT_WARN_PAGE_LEAVE' => '',
1079
		'TEXT_WORLD_WRITEABLE_FILE_PERMISSIONS' => $TEXT['WORLD_WRITEABLE_FILE_PERMISSIONS'],
1080
		'MODE_SWITCH_WARNING' => $MESSAGE['SETTINGS_MODE_SWITCH_WARNING'],
1081
		'WORLD_WRITEABLE_WARNING' => $MESSAGE['SETTINGS_WORLD_WRITEABLE_WARNING'],
1082
		));
1083

    
1084
if($is_advanced && $admin->get_user_id()=='1')
1085
{
1086
	$oTpl->parse('show_access', 'show_access_block');
1087
}else {
1088
	$oTpl->parse('show_access' , '');
1089
}
1090

    
1091
// Parse template objects output
1092
$oTpl->parse('main', 'main_block',false);
1093
$oTpl->pparse('output', 'page');
1094
//$oTpl->p('page');
1095
unset($oTpl);
1096
$admin->print_footer();
(1-1/4)