Project

General

Profile

1 1356 Luisehahne
<?php
2
/**
3
 *
4
 * @category        admin
5
 * @package         settings
6 1529 Luisehahne
 * @author          Ryan Djurovich, WebsiteBaker Project
7 1912 Luisehahne
 * @copyright       2009-2013, WebsiteBaker Org. e.V.
8
 * @link            http://www.websitebaker.org/
9 1356 Luisehahne
 * @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 1843 Luisehahne
 * @filesource      $HeadURL$
14 1356 Luisehahne
 * @lastmodified    $Date$
15
 *
16
 */
17
18 1843 Luisehahne
// 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 1356 Luisehahne
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 1716 Luisehahne
// add new values, later in upgrade-script
36
$cfg = array(
37 1844 Luisehahne
	'wbmail_signature' => defined('WBMAIL_SIGNATURE') ? WBMAIL_SIGNATURE : '',
38 1716 Luisehahne
	'confirmed_registration' => (defined('CONFIRMED_REGISTRATION') ? CONFIRMED_REGISTRATION : '0'),
39 1849 Luisehahne
	'page_extendet' => (defined('PAGE_EXTENDET') ? PAGE_EXTENDET : 'true'),
40 1716 Luisehahne
	);
41
db_update_key_value( 'settings', $cfg );
42
43 1356 Luisehahne
// Include the WB functions file
44
require_once(WB_PATH.'/framework/functions.php');
45
require_once(WB_PATH.'/framework/functions-utf8.php');
46
47 1529 Luisehahne
// Setup template object, parse vars to it, then parse it
48 1356 Luisehahne
// Create new template object
49 1777 Luisehahne
$oTpl = new Template(dirname($admin->correct_theme_source('settings.htt')),'comment');
50
//$oTpl->debug = true;
51
//$oTpl->filename_comments = true;
52
//$oTpl->unknown_regexp = "strict";
53
//$oTpl->halt_on_error = "report" ;
54 1356 Luisehahne
55 1777 Luisehahne
$oTpl->set_file('page',  'settings.htt');
56
$oTpl->set_block('page', 'main_block', 'main');
57 1356 Luisehahne
58 1912 Luisehahne
//$mLang = ModLanguage::getInstance();
59
//$mLang->setLanguage(dirname(__FILE__).'/languages/', LANGUAGE, DEFAULT_LANGUAGE);
60
$mLang = Translate::getinstance();
61
$mLang->enableAddon('admin\settings');
62 1745 Luisehahne
/*-- insert all needed vars from language files ----------------------------------------*/
63 1777 Luisehahne
$oTpl->set_var($mLang->getLangArray());
64 1356 Luisehahne
65 1912 Luisehahne
$oTpl->set_var('FTAN', $admin->getFTAN());
66
67 1356 Luisehahne
// Query current settings in the db, then loop through them and print them
68 1777 Luisehahne
$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 1356 Luisehahne
}
76
77
$is_advanced = (isset($_GET['advanced']) && $_GET['advanced'] == 'yes');
78
// Tell the browser whether or not to show advanced options
79 1777 Luisehahne
    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 1912 Luisehahne
    	$oTpl->set_var('ADVANCED_BUTTON', '&lt;&lt; '.$mLang->TEXT_HIDE_ADVANCED);
86 1777 Luisehahne
    	$oTpl->set_var('ADVANCED_LINK', 'index.php?advanced=no');
87 1356 Luisehahne
88 1777 Luisehahne
    } 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 1356 Luisehahne
93 1777 Luisehahne
    	$oTpl->set_var('ADVANCED', 'no');
94 1912 Luisehahne
    	$oTpl->set_var('ADVANCED_BUTTON', $mLang->TEXT_SHOW_ADVANCED.' &gt;&gt;');
95 1777 Luisehahne
    	$oTpl->set_var('ADVANCED_LINK', 'index.php?advanced=yes');
96
    }
97 1356 Luisehahne
98 1777 Luisehahne
	$sSelected = ' selected="selected"';
99
	$checked   = ' checked="checked"';
100 1356 Luisehahne
101 1777 Luisehahne
	$oTpl->set_var(array(
102
		'WB_URL' => WB_URL,
103
		'THEME_URL' => THEME_URL,
104
		'ADMIN_URL' => ADMIN_URL,
105
	 ));
106
107
//  Insert permissions values
108
	if($admin->get_permission('settings_advanced') != true)
109 1356 Luisehahne
	{
110 1777 Luisehahne
		$oTpl->set_var('DISPLAY_ADVANCED_BUTTON', 'hide');
111
	}
112
113
    /**
114
     * <!-- BEGIN show_page_level_limit_block -->
115
     * Insert page level limits
116
     */
117
    $oTpl->set_block('main_block', 'show_page_level_limit_block', 'show_page_level_limit');
118
    /**
119
     * <!-- BEGIN page_level_limit_list_block -->
120
     */
121
    $oTpl->set_block('show_page_level_limit_block', 'page_level_limit_list_block', 'page_level_limit_list');
122
	for($i = 1; $i <= 10; $i++)
123
	{
124
		$oTpl->set_var('NUMBER', $i);
125
		if(PAGE_LEVEL_LIMIT == $i)
126
	    {
127
			$oTpl->set_var('SELECTED', $sSelected);
128
		} else {
129
			$oTpl->set_var('SELECTED', '');
130 1356 Luisehahne
		}
131 1777 Luisehahne
		$oTpl->parse('page_level_limit_list', 'page_level_limit_list_block', true);
132 1356 Luisehahne
	}
133
134 1777 Luisehahne
    /**
135
     * <!-- END page_level_limit_list_block -->
136
     * <!-- END show_page_level_limit_block -->
137
     */
138
    if($is_advanced)
139
    {
140
    	$oTpl->parse('show_page_level_limit', 'show_page_level_limit_block', false);
141
    } else {
142
    	$oTpl->parse('show_page_level_limit', '');
143
    }
144 1716 Luisehahne
145 1777 Luisehahne
    /**
146
     * Work-out if page trash feature is disabled, in-line, or separate
147
     */
148
	if(PAGE_TRASH == 'disabled')
149
	{
150
    	$oTpl->set_var(array(
151
				'PAGE_TRASH_DISABLED' => $checked,
152
				'PAGE_TRASH_INLINE' => '',
153
				'DISPLAY_PAGE_TRASH_SEPARATE' => 'display: none;',
154
				));
155
	} elseif(PAGE_TRASH == 'inline')
156
	{
157
    	$oTpl->set_var(array(
158
				'PAGE_TRASH_INLINE' => $checked,
159
				'PAGE_TRASH_DISABLED' => '',
160
				'DISPLAY_PAGE_TRASH_SEPARATE' => 'display: none;',
161
				));
162
	} elseif(PAGE_TRASH == 'separate')
163
	{
164
		$oTpl->set_var('PAGE_TRASH_SEPARATE', $checked);
165
		$oTpl->set_var('DISPLAY_PAGE_TRASH_SEPARATE', 'display: inline;');
166
	}
167 1356 Luisehahne
168 1777 Luisehahne
    /**
169
     * <!-- BEGIN show_checkbox_1_block -->
170
     * advanced yes
171
     */
172
    $oTpl->set_block('main_block', 'show_checkbox_1_block', 'show_checkbox_1');
173
//  Work-out if page languages feature is enabled
174
	if(defined('PAGE_LANGUAGES') && PAGE_LANGUAGES == true)
175
	{
176
    	$oTpl->set_var(array(
177
				'PAGE_LANGUAGES_ENABLED' => $checked,
178
				'PAGE_LANGUAGES_DISABLED' => '',
179
				));
180
	} else {
181
    	$oTpl->set_var(array(
182
				'PAGE_LANGUAGES_DISABLED' => $checked,
183
				'PAGE_LANGUAGES_ENABLED' => '',
184
				));
185
	}
186
187
//  Work-out if page extended feature is enabled
188 1849 Luisehahne
	if(defined('PAGE_EXTENDET') && PAGE_EXTENDET == true)
189 1777 Luisehahne
	{
190
    	$oTpl->set_var(array(
191 1849 Luisehahne
				'PAGE_EXTENDET_ENABLED' => $checked,
192
				'PAGE_EXTENDET_DISABLED' => '',
193 1777 Luisehahne
				));
194
	} else {
195
    	$oTpl->set_var(array(
196 1849 Luisehahne
				'PAGE_EXTENDET_DISABLED' => $checked,
197
				'PAGE_EXTENDET_ENABLED' => '',
198 1777 Luisehahne
				));
199
	}
200
201
//  Work-out if multiple menus feature is enabled
202
	if(defined('MULTIPLE_MENUS') && MULTIPLE_MENUS == true)
203
	{
204
    	$oTpl->set_var(array(
205
				'MULTIPLE_MENUS_ENABLED' => $checked,
206
				'MULTIPLE_MENUS_DISABLED' => '',
207
				));
208
	} else {
209
    	$oTpl->set_var(array(
210
				'MULTIPLE_MENUS_DISABLED' => $checked,
211
				'MULTIPLE_MENUS_ENABLED' => '',
212
				));
213
	}
214
215
    /**
216
     * <!-- END show_checkbox_1_block -->
217
     * advanced yes
218
     */
219
    if($is_advanced)
220
    {
221
    	$oTpl->parse('show_checkbox_1', 'show_checkbox_1_block');
222
    } else {
223
    	$oTpl->parse('show_checkbox_1', '');
224
    }
225
226
//  Work-out if media home folder feature is enabled
227 1912 Luisehahne
    $oTpl->set_var('TEXT_HOME_FOLDERS', $mLang->TEXT_HOME_FOLDERS);
228 1777 Luisehahne
	if(HOME_FOLDERS)
229
	{
230
    	$oTpl->set_var(array(
231
				'HOME_FOLDERS_ENABLED' => $checked,
232
				'HOME_FOLDERS_DISABLED' => '',
233
				));
234
	} else {
235
    	$oTpl->set_var(array(
236
				'HOME_FOLDERS_DISABLED' => $checked,
237
				'HOME_FOLDERS_ENABLED' => '',
238
				));
239
	}
240
241
    $oTpl->set_block('main_block', 'show_checkbox_2_block', 'show_checkbox_2');
242
//  Work-out if manage sections feature is enabled
243
	if(MANAGE_SECTIONS)
244
	{
245
    	$oTpl->set_var(array(
246
				'MANAGE_SECTIONS_ENABLED' => $checked,
247
				'MANAGE_SECTIONS_DISABLED' => '',
248
				));
249
	} else {
250
    	$oTpl->set_var(array(
251
				'MANAGE_SECTIONS_DISABLED' => $checked,
252
				'MANAGE_SECTIONS_ENABLED' => '',
253
				));
254
	}
255
256
	// Work-out if section blocks feature is enabled
257
	if(defined('SECTION_BLOCKS') && SECTION_BLOCKS == true)
258
	{
259
    	$oTpl->set_var(array(
260
				'SECTION_BLOCKS_ENABLED' => $checked,
261
				'SECTION_BLOCKS_DISABLED' => '',
262
				));
263
	} else {
264
    	$oTpl->set_var(array(
265
				'SECTION_BLOCKS_DISABLED' => $checked,
266
				'SECTION_BLOCKS_ENABLED' => '',
267
				));
268
	}
269
270
    /**
271
     *
272
     */
273
    if($is_advanced)
274
    {
275
     	$oTpl->parse('show_checkbox_2', 'show_checkbox_2_block');
276
    } else {
277
    	$oTpl->parse('show_checkbox_2', '');
278
    }
279
280
	// Work-out if intro feature is enabled
281
	if(INTRO_PAGE)
282
	{
283
    	$oTpl->set_var(array(
284
				'INTRO_PAGE_ENABLED' => $checked,
285
				'INTRO_PAGE_DISABLED' => '',
286
				));
287
	} else {
288
    	$oTpl->set_var(array(
289
				'INTRO_PAGE_DISABLED' => $checked,
290
				'INTRO_PAGE_ENABLED' => '',
291
				));
292
	}
293
/**
294
 * <!-- BEGIN show_checkbox_3_block -->
295
 */
296
    $oTpl->set_block('main_block', 'show_checkbox_3_block', 'show_checkbox_3');
297
//  Work-out if homepage redirection feature is enabled
298
	if(defined('HOMEPAGE_REDIRECTION') && HOMEPAGE_REDIRECTION == true)
299
	{
300
    	$oTpl->set_var(array(
301
				'HOMEPAGE_REDIRECTION_ENABLED' => $checked,
302
				'HOMEPAGE_REDIRECTION_DISABLED' => '',
303
				));
304
	} else {
305
//		$oTpl->set_var('HOMEPAGE_REDIRECTION_DISABLED', $checked);
306
    	$oTpl->set_var(array(
307
				'HOMEPAGE_REDIRECTION_DISABLED' => $checked,
308
				'HOMEPAGE_REDIRECTION_ENABLED' => '',
309
				));
310
	}
311
//  Work-out if smart login feature is enabled
312
	if(defined('SMART_LOGIN') && SMART_LOGIN == true)
313
	{
314
		$oTpl->set_var('SMART_LOGIN_ENABLED', $checked);
315
    	$oTpl->set_var(array(
316
				'SMART_LOGIN_ENABLED' => $checked,
317
				'SMART_LOGIN_DISABLED' => '',
318
				));
319
	} else {
320
		$oTpl->set_var('SMART_LOGIN_DISABLED', $checked);
321
    	$oTpl->set_var(array(
322
				'SMART_LOGIN_DISABLED' => $checked,
323
				'SMART_LOGIN_ENABLED' => '',
324
				));
325
	}
326
327
    /**
328
     * <!-- END show_checkbox_3_block -->
329
     */
330
    if($is_advanced)
331
    {
332
    	$oTpl->parse('show_checkbox_3', 'show_checkbox_3_block');
333
    } else {
334
    	$oTpl->parse('show_checkbox_3', 'show_checkbox_3_block', '');
335
    }
336
337
//  Work-out if frontend login feature is enabled
338
	if(FRONTEND_LOGIN)
339
	{
340
    	$oTpl->set_var(array(
341
				'PRIVATE_ENABLED' => $checked,
342
				'PRIVATE_DISABLED' => '',
343
				));
344
	} else {
345
    	$oTpl->set_var(array(
346
				'PRIVATE_DISABLED' => $checked,
347 1779 Luisehahne
				'PRIVATE_ENABLED' => '',
348 1777 Luisehahne
				));
349
	}
350
351
	if(CONFIRMED_REGISTRATION)
352
	{
353
    	$oTpl->set_var(array(
354
				'CONFIRMED_REGISTRATION_ENABLED' => $checked,
355
				'CONFIRMED_REGISTRATION_DISABLED' => '',
356
				));
357
	} else {
358
    	$oTpl->set_var(array(
359
				'CONFIRMED_REGISTRATION_DISABLED' => $checked,
360
				'CONFIRMED_REGISTRATION_ENABLED' => '',
361
				));
362
	}
363
364
//  Insert groups into signup list
365
    $oTpl->set_block('main_block', 'group_list_block', 'group_list');
366
    $sql = "SELECT `group_id`, `name` FROM `".TABLE_PREFIX."groups` WHERE `group_id` != '1'";
367
	if($results = $database->query($sql)) {
368
    	if($results->numRows() > 0)
369
    	{
370
    		while($group = $results->fetchRow(MYSQL_ASSOC))
371
    	    {
372
    			$oTpl->set_var('ID', $group['group_id']);
373
    			$oTpl->set_var('NAME', $group['name']);
374
    			if(FRONTEND_SIGNUP == $group['group_id'])
375
    	        {
376
    				$oTpl->set_var('SELECTED', $sSelected);
377
    			} else {
378
    				$oTpl->set_var('SELECTED', '');
379
    			}
380
    			$oTpl->parse('group_list', 'group_list_block', true);
381
    		}
382
    	} else {
383
    		$oTpl->set_var('ID', 'disabled');
384 1912 Luisehahne
    		$oTpl->set_var('NAME', $mLang->MESSAGE_GROUPS_NO_GROUPS_FOUND);
385 1777 Luisehahne
    		$oTpl->parse('group_list', 'group_list_block', true);
386
    	}
387
	}
388
389
    /**
390
     * <!-- BEGIN show_redirect_timer_block -->
391
     */
392
    $oTpl->set_block('main_block', 'show_redirect_timer_block', 'show_redirect_timer');
393
394
    /**
395
     * <!-- END show_redirect_timer_block -->
396
     */
397
    if($is_advanced)
398
    {
399
    	$oTpl->parse('show_redirect_timer', 'show_redirect_timer_block');
400
    } else {
401
    	$oTpl->parse('show_redirect_timer', '');
402
    }
403
404
    /**
405
     * <!-- BEGIN show_php_error_level_block -->
406
     */
407
	// Insert default error reporting values
408
	require(ADMIN_PATH.'/interface/er_levels.php');
409
    $oTpl->set_block('main_block', 'show_php_error_level_block',  'show_php_error_level');
410
    $oTpl->set_block('show_php_error_level_block', 'php_error_list_block',  'php_error_list');
411
	foreach($ER_LEVELS AS $value => $title)
412
	{
413
		$oTpl->set_var('VALUE', $value);
414
		$oTpl->set_var('NAME', $title);
415
	    $selected = (ER_LEVEL == $value) ? $sSelected : '';
416
	    $oTpl->set_var('SELECTED', $selected);
417
		$oTpl->parse('php_error_list', 'php_error_list_block', true);
418
	}
419
420
    /**
421
     * <!-- END show_php_error_level_block -->
422
     */
423
    if($is_advanced)
424
    {
425
    	$oTpl->parse('show_php_error_level',  'show_php_error_level_block');
426
    } else {
427
    	$oTpl->parse('show_php_error_level', '');
428
    }
429
430
    /**
431
     * <!-- BEGIN show_wysiwyg_block -->
432
     */
433
//  Insert WYSIWYG modules
434
    $oTpl->set_block('main_block', 'show_wysiwyg_block',        'show_wysiwyg');
435
    $oTpl->set_block('show_wysiwyg_block', 'editor_list_block', 'editor_list');
436
	$file='none';
437 1912 Luisehahne
	$module_name=$mLang->TEXT_NONE;
438 1777 Luisehahne
	$oTpl->set_var('FILE', $file);
439
	$oTpl->set_var('NAME', $module_name);
440
	$selected = (!defined('WYSIWYG_EDITOR') || $file == WYSIWYG_EDITOR) ? $sSelected : '';
441
	$oTpl->set_var('SELECTED', $selected);
442
	$oTpl->parse('editor_list', 'editor_list_block', true);
443 1716 Luisehahne
	$sql  = 'SELECT `name`, `directory` FROM `'.TABLE_PREFIX.'addons` ';
444 1777 Luisehahne
	$sql .= 'WHERE `type` = \'module\' ';
445
	$sql .= 'AND `function` = \'wysiwyg\' ';
446
	$sql .= 'ORDER BY `name`';
447
	if( ($result = $database->query($sql)) && ($result->numRows() > 0) )
448
	{
449
		while($addon = $result->fetchRow(MYSQL_ASSOC))
450
	    {
451
			if( $admin->get_permission($addon['directory'],'module' ) )
452
			{
453
				$oTpl->set_var('FILE', $addon['directory']);
454
				$oTpl->set_var('NAME', $addon['name']);
455
				$selected = (!defined('WYSIWYG_EDITOR') || $addon['directory'] == WYSIWYG_EDITOR) ? $sSelected : '';
456
				$oTpl->set_var('SELECTED', $selected);
457
				$oTpl->parse('editor_list', 'editor_list_block', true);
458
			}
459
		}
460
	}
461
462
    /**
463
     * <!-- END show_wysiwyg_block -->
464
     */
465
    if($is_advanced)
466
    {
467
    	$oTpl->parse('show_wysiwyg','show_wysiwyg_block');
468
    } else {
469
    	$oTpl->parse('show_wysiwyg', '');
470
    }
471
472
//  Insert language values
473
    $oTpl->set_block('main_block', 'language_list_block', 'language_list');
474
	$sql  = 'SELECT `name`, `directory` FROM `'.TABLE_PREFIX.'addons` ';
475 1716 Luisehahne
	$sql .= 'WHERE `type` = \'language\' ';
476
	$sql .= 'AND `function` != \'theme\' ';
477
	$sql .= 'ORDER BY `directory`';
478
	if( ($result = $database->query($sql)) && ($result->numRows() > 0) )
479 1356 Luisehahne
	{
480 1777 Luisehahne
		while($addon = $result->fetchRow(MYSQL_ASSOC)) {
481 1457 Luisehahne
	        $langIcons = (empty($addon['directory'])) ? 'none' : strtolower($addon['directory']);
482
483 1777 Luisehahne
			$oTpl->set_var('CODE',        $addon['directory']);
484
			$oTpl->set_var('NAME',        $addon['name']);
485
			$oTpl->set_var('FLAG',        THEME_URL.'/images/flags/'.$langIcons);
486
			$oTpl->set_var('SELECTED',    (DEFAULT_LANGUAGE == $addon['directory'] ? $sSelected : '') );
487
			$oTpl->parse('language_list', 'language_list_block', true);
488 1356 Luisehahne
		}
489
	}
490 1777 Luisehahne
    /**
491
     * <!-- BEGIN show_charset_block -->
492
     */
493
//  Insert default charset values
494
    $oTpl->set_block('main_block', 'show_charset_block', 'show_charset');
495
	require(ADMIN_PATH.'/interface/charsets.php');
496
    $oTpl->set_block('show_charset_block', 'charset_list_block', 'charset_list');
497
	foreach($CHARSETS AS $code => $title) {
498
		$oTpl->set_var('VALUE', $code);
499
		$oTpl->set_var('NAME', $title);
500
		if(DEFAULT_CHARSET == $code) {
501
			$oTpl->set_var('SELECTED', $sSelected);
502
		} else {
503
			$oTpl->set_var('SELECTED', '');
504
		}
505
		$oTpl->parse('charset_list', 'charset_list_block', true);
506
	}
507
    /**
508
     * <!-- END show_charset_block -->
509
     */
510
    if($is_advanced)
511
    {
512
    	$oTpl->parse('show_charset', 'show_charset_block');
513
    } else {
514
    	$oTpl->parse('show_charset', '');
515
    }
516 1356 Luisehahne
517 1777 Luisehahne
//  nsert default timezone values
518 1356 Luisehahne
	require(ADMIN_PATH.'/interface/timezones.php');
519 1777 Luisehahne
    $oTpl->set_block('main_block', 'timezone_list_block','timezone_list');
520 1356 Luisehahne
	foreach($TIMEZONES AS $hour_offset => $title)
521
	{
522 1777 Luisehahne
//  Make sure we dont list "System Default" as we are setting this value!
523 1356 Luisehahne
		if($hour_offset != '-20') {
524 1777 Luisehahne
			$oTpl->set_var('VALUE', $hour_offset);
525
			$oTpl->set_var('NAME', $title);
526 1356 Luisehahne
			if(DEFAULT_TIMEZONE == $hour_offset*60*60) {
527 1777 Luisehahne
				$oTpl->set_var('SELECTED', $sSelected);
528 1356 Luisehahne
			} else {
529 1777 Luisehahne
				$oTpl->set_var('SELECTED', '');
530 1356 Luisehahne
			}
531 1777 Luisehahne
			$oTpl->parse('timezone_list', 'timezone_list_block', true);
532 1356 Luisehahne
		}
533
	}
534
535 1777 Luisehahne
//  Insert date format list
536 1356 Luisehahne
	require(ADMIN_PATH.'/interface/date_formats.php');
537 1777 Luisehahne
    $oTpl->set_block('main_block', 'date_format_list_block', 'date_format_list');
538 1356 Luisehahne
	foreach($DATE_FORMATS AS $format => $title) {
539
		$format = str_replace('|', ' ', $format); // Add's white-spaces (not able to be stored in array key)
540
		if($format != 'system_default') {
541 1777 Luisehahne
			$oTpl->set_var('VALUE', $format);
542 1356 Luisehahne
		} else {
543 1777 Luisehahne
			$oTpl->set_var('VALUE', '');
544 1356 Luisehahne
		}
545 1777 Luisehahne
		$oTpl->set_var('NAME', $title);
546 1356 Luisehahne
		if(DEFAULT_DATE_FORMAT == $format) {
547 1777 Luisehahne
			$oTpl->set_var('SELECTED', $sSelected);
548 1356 Luisehahne
		} else {
549 1777 Luisehahne
			$oTpl->set_var('SELECTED', '');
550 1356 Luisehahne
		}
551 1777 Luisehahne
		$oTpl->parse('date_format_list', 'date_format_list_block', true);
552 1356 Luisehahne
	}
553
554 1777 Luisehahne
//  Insert time format list
555 1356 Luisehahne
	require(ADMIN_PATH.'/interface/time_formats.php');
556 1777 Luisehahne
    $oTpl->set_block('main_block', 'time_format_list_block', 'time_format_list');
557 1356 Luisehahne
	foreach($TIME_FORMATS AS $format => $title) {
558
		$format = str_replace('|', ' ', $format); // Add's white-spaces (not able to be stored in array key)
559
		if($format != 'system_default') {
560 1777 Luisehahne
			$oTpl->set_var('VALUE', $format);
561 1356 Luisehahne
		} else {
562 1777 Luisehahne
			$oTpl->set_var('VALUE', '');
563 1356 Luisehahne
		}
564 1777 Luisehahne
		$oTpl->set_var('NAME', $title);
565 1356 Luisehahne
		if(DEFAULT_TIME_FORMAT == $format) {
566 1777 Luisehahne
			$oTpl->set_var('SELECTED', $sSelected);
567 1356 Luisehahne
		} else {
568 1777 Luisehahne
			$oTpl->set_var('SELECTED', '');
569 1356 Luisehahne
		}
570 1777 Luisehahne
		$oTpl->parse('time_format_list', 'time_format_list_block', true);
571 1356 Luisehahne
	}
572
573 1716 Luisehahne
// Insert templates
574 1777 Luisehahne
    $oTpl->set_block('main_block', 'template_list_block',         'template_list');
575 1716 Luisehahne
	$sql  = 'SELECT `name`, `directory` FROM `'.TABLE_PREFIX.'addons` ';
576
	$sql .= 'WHERE `type` = \'template\' ';
577
	$sql .= 'AND `function` != \'theme\' ';
578
	$sql .= 'ORDER BY `name`';
579
	if( ($result = $database->query($sql)) && ($result->numRows() > 0) )
580
	{
581 1777 Luisehahne
		while($addon = $result->fetchRow(MYSQL_ASSOC))
582 1716 Luisehahne
		{
583
			if( $admin->get_permission($addon['directory'],'template' ) )
584
			{
585 1777 Luisehahne
				$oTpl->set_var('FILE', $addon['directory']);
586
				$oTpl->set_var('NAME', $addon['name']);
587 1716 Luisehahne
				$selected = (($addon['directory'] == DEFAULT_TEMPLATE) ? $sSelected : '');
588 1777 Luisehahne
				$oTpl->set_var('SELECTED', $selected);
589
				$oTpl->parse('template_list', 'template_list_block', true);
590 1716 Luisehahne
			}
591 1356 Luisehahne
		}
592
	}
593
594 1716 Luisehahne
// Insert backend theme
595 1777 Luisehahne
    $oTpl->set_block('main_block', 'theme_list_block',            'theme_list');
596 1716 Luisehahne
	$sql  = 'SELECT `name`, `directory` FROM `'.TABLE_PREFIX.'addons` ';
597
	$sql .= 'WHERE `type` = \'template\' ';
598
	$sql .= 'AND `function` = \'theme\' ';
599
	$sql .= 'ORDER BY `name`';
600
601
	if( ($result = $database->query($sql)) && ($result->numRows() > 0) )
602
	{
603 1777 Luisehahne
		while($addon = $result->fetchRow(MYSQL_ASSOC))
604 1716 Luisehahne
		{
605
			if( $admin->get_permission($addon['directory'],'template' ) )
606
			{
607 1777 Luisehahne
				$oTpl->set_var('FILE', $addon['directory']);
608
				$oTpl->set_var('NAME', $addon['name']);
609 1716 Luisehahne
				$selected = (($addon['directory'] == DEFAULT_THEME) ? $sSelected : '');
610 1777 Luisehahne
				$oTpl->set_var('SELECTED', $selected);
611
				$oTpl->parse('theme_list', 'theme_list_block', true);
612 1716 Luisehahne
			}
613 1356 Luisehahne
		}
614
	}
615
616 1777 Luisehahne
//  Work-out if warn_page_leave feature is enabled
617
//	if (defined('WARN_PAGE_LEAVE') && WARN_PAGE_LEAVE == true)
618 1716 Luisehahne
//	{
619 1777 Luisehahne
//    	$oTpl->set_var(array(
620
//				'WARN_PAGE_LEAVE_ENABLED' => $checked,
621
//				'WARN_PAGE_LEAVE_DISABLED' => '',
622
//				));
623
//	} else {
624
//    	$oTpl->set_var(array(
625
//				'MANAGE_SECTIONS_DISABLED' => $checked,
626
//				'WARN_PAGE_LEAVE_DISABLED' => '',
627
//				));
628
//	}
629
630
/*  Make's sure GD library is installed */
631
//	if(extension_loaded('gd') && function_exists('imageCreateFromJpeg'))
632
//	{
633
//		$oTpl->set_var('GD_EXTENSION_ENABLED', '');
634
//	} else {
635
//		$oTpl->set_var('GD_EXTENSION_ENABLED', ' style="display: none;"');
636
//	}
637
638
//  Insert permissions values
639
//	if($admin->get_permission('settings_advanced') != true)
640
//	{
641
//		$oTpl->set_var('DISPLAY_ADVANCED_BUTTON', 'hide');
642
//	}
643
644
/**
645
 *
646
 *
647
 */
648
    $oTpl->set_block('main_block', 'show_search_block','show_search');
649
	$query = "SELECT * FROM `".TABLE_PREFIX."search` WHERE `extra` = '' ";
650
	if($results = $database->query($query))
651
    {
652
    	// Query current settings in the db, then loop through them and print them
653
    	while($setting = $results->fetchRow(MYSQL_ASSOC))
654
    	{
655
    		$setting_name = $setting['name'];
656
    		$setting_value = htmlspecialchars(($setting['value']));
657
    		switch($setting_name) {
658
    			// Search header
659
    			case 'header':
660
    				$oTpl->set_var('SEARCH_HEADER', $setting_value);
661
    			break;
662
    			// Search results header
663
    			case 'results_header':
664
    				$oTpl->set_var('SEARCH_RESULTS_HEADER', $setting_value);
665
    			break;
666
    			// Search results loop
667
    			case 'results_loop':
668
    				$oTpl->set_var('SEARCH_RESULTS_LOOP', $setting_value);
669
    			break;
670
    			// Search results footer
671
    			case 'results_footer':
672
    				$oTpl->set_var('SEARCH_RESULTS_FOOTER', $setting_value);
673
    			break;
674
    			// Search no results
675
    			case 'no_results':
676
    				$oTpl->set_var('SEARCH_NO_RESULTS', $setting_value);
677
    			break;
678
    			// Search footer
679
    			case 'footer':
680
    				$oTpl->set_var('SEARCH_FOOTER', $setting_value);
681
    			break;
682
    			// Search module-order
683
    			case 'module_order':
684
    				$oTpl->set_var('SEARCH_MODULE_ORDER', $setting_value);
685
    			break;
686
    			// Search max lines of excerpt
687
    			case 'max_excerpt':
688
    				$oTpl->set_var('SEARCH_MAX_EXCERPT', $setting_value);
689
    			break;
690
    			// time-limit
691
    			case 'time_limit':
692
    				$oTpl->set_var('SEARCH_TIME_LIMIT', $setting_value);
693
    			break;
694
    			// Search template
695
    			case 'template':
696
    				$search_template = $setting_value;
697
    			break;
698
    		}
699
    	}
700 1356 Luisehahne
	}
701
702
// Insert templates for search settings
703 1777 Luisehahne
    $oTpl->set_block('main_block', 'search_template_list_block',  'search_template_list');
704 1366 Luisehahne
	$search_template = ( ($search_template == DEFAULT_TEMPLATE) || ($search_template == '') ) ? '' : $search_template;
705 1716 Luisehahne
	$selected = ( ($search_template != DEFAULT_TEMPLATE) ) ?  $sSelected : '';
706 1356 Luisehahne
707 1777 Luisehahne
	$oTpl->set_var(array(
708 1356 Luisehahne
	        'FILE' => '',
709 1912 Luisehahne
			'TEXT_MODULE_ORDER' => $mLang->TEXT_MODULE_ORDER,
710
	        'NAME' => $mLang->TEXT_SYSTEM_DEFAULT,
711 1356 Luisehahne
	        'SELECTED' => $selected
712
	    ));
713 1777 Luisehahne
	$oTpl->parse('search_template_list', 'search_template_list_block', true);
714 1716 Luisehahne
	$sql  = 'SELECT `name`, `directory` FROM `'.TABLE_PREFIX.'addons` ';
715
	$sql .= 'WHERE `type` = \'template\' ';
716
	$sql .= 'AND `function` = \'template\' ';
717
	$sql .= 'ORDER BY `name`';
718
    if( ($result = $database->query($sql)) && ($result->numRows() > 0) )
719 1356 Luisehahne
	{
720 1777 Luisehahne
		while($addon = $result->fetchRow(MYSQL_ASSOC))
721 1356 Luisehahne
	    {
722 1716 Luisehahne
			if( $admin->get_permission($addon['directory'],'template' ) )
723
			{
724 1777 Luisehahne
				$oTpl->set_var('FILE', $addon['directory']);
725
				$oTpl->set_var('NAME', $addon['name']);
726 1716 Luisehahne
		        $selected = ($addon['directory'] == $search_template) ? $sSelected :  '';
727 1777 Luisehahne
				$oTpl->set_var('SELECTED', $selected);
728
				$oTpl->parse('search_template_list', 'search_template_list_block', true);
729 1716 Luisehahne
			}
730 1356 Luisehahne
		}
731
	}
732
733 1777 Luisehahne
	// Insert search select
734 1912 Luisehahne
//    $oTpl->set_var(array(
735
//		'TEXT_REGISTERED' => $mLang->TEXT_REGISTERED'],
736
//		'TEXT_PUBLIC' => $mLang->TEXT_PUBLIC,
737
//		'TEXT_PRIVATE' => $mLang->TEXT_PRIVATE'],
738
//		'TEXT_NONE' => $mLang->TEXT_NONE'],
739
//		'TEXT_MAX_EXCERPT' => $mLang->TEXT_MAX_EXCERPT'],
740
//		'TEXT_TIME_LIMIT' => $mLang->TEXT_TIME_LIMIT'],
741
//		'TEXT_VISIBILITY' => $mLang->TEXT_VISIBILITY'],
742
//		'TEXT_SEARCH' => $mLang->TEXT_SEARCH'],
743
//		));
744 1777 Luisehahne
	if(SEARCH == 'private')
745 1356 Luisehahne
	{
746 1777 Luisehahne
    	$oTpl->set_var(array(
747
				'PRIVATE_SEARCH' => $sSelected,
748
				'REGISTERED_SEARCH' => '',
749
				'NONE_SEARCH' => '',
750 1721 Luisehahne
				));
751 1777 Luisehahne
	} elseif(SEARCH == 'public') {
752
    	$oTpl->set_var(array(
753
				'PRIVATE_SEARCH' => '',
754
				'REGISTERED_SEARCH' => '',
755
				'NONE_SEARCH' => '',
756 1721 Luisehahne
				));
757 1777 Luisehahne
	} elseif(SEARCH == 'registered') {
758
    	$oTpl->set_var(array(
759
				'PRIVATE_SEARCH' => '',
760
				'REGISTERED_SEARCH' => $sSelected,
761
				'NONE_SEARCH' => '',
762 1721 Luisehahne
				));
763 1777 Luisehahne
	} elseif(SEARCH == 'none') {
764
    	$oTpl->set_var(array(
765
				'PRIVATE_SEARCH' => '',
766
				'REGISTERED_SEARCH' => '',
767
				'NONE_SEARCH' => $sSelected,
768 1721 Luisehahne
				));
769 1356 Luisehahne
	}
770
771 1777 Luisehahne
if($is_advanced)
772
{
773
	$oTpl->parse('show_search', 'show_search_block');
774
} else {
775
	$oTpl->parse('show_search', '');
776
}
777 1409 FrankH
778 1777 Luisehahne
    $oTpl->set_block('main_block', 'show_access_block','show_access');
779
//  Work-out which wbmailer routine should be checked
780
	$oTpl->set_var(array(
781 1912 Luisehahne
		'TEXT_WBMAILER_SMTP_AUTH_NOTICE' => $mLang->TEXT_REQUIRED.' '.$mLang->TEXT_WBMAILER_SMTP_AUTH,
782
		'SMTP_AUTH_SELECTED' => $checked,
783
		'TEXT_WBMAILER_DEFAULT_SETTINGS_NOTICE' => $mLang->TEXT_WBMAILER_DEFAULT_SETTINGS_NOTICE,
784
		'TEXT_WBMAILER_DEFAULT_SENDER_MAIL' => $mLang->TEXT_WBMAILER_DEFAULT_SENDER_MAIL,
785
		'TEXT_WBMAILER_DEFAULT_SENDER_NAME' => $mLang->TEXT_WBMAILER_DEFAULT_SENDER_NAME,
786
		'TEXT_WBMAILER_NOTICE' => $mLang->TEXT_WBMAILER_NOTICE,
787
		'TEXT_WBMAILER_FUNCTION' => $mLang->TEXT_WBMAILER_FUNCTION,
788
		'TEXT_WBMAILER_SMTP_HOST' => $mLang->TEXT_WBMAILER_SMTP_HOST,
789
		'TEXT_WBMAILER_PHP' => $mLang->TEXT_WBMAILER_PHP,
790
		'TEXT_WBMAILER_SMTP' => $mLang->TEXT_WBMAILER_SMTP,
791
		'TEXT_WBMAILER_SMTP_AUTH' => $mLang->TEXT_WBMAILER_SMTP_AUTH,
792
		'TEXT_WBMAILER_SMTP_USERNAME' => $mLang->TEXT_WBMAILER_SMTP_USERNAME,
793
		'TEXT_WBMAILER_SMTP_PASSWORD' => $mLang->TEXT_WBMAILER_SMTP_PASSWORD,
794 1777 Luisehahne
		));
795 1356 Luisehahne
796 1668 Luisehahne
	// Work-out if developer infos feature is enabled
797
	if(defined('DEV_INFOS') && DEV_INFOS == true)
798
	{
799 1777 Luisehahne
    	$oTpl->set_var(array(
800 1721 Luisehahne
				'DEV_INFOS_ENABLED' => $checked,
801
				'DEV_INFOS_DISABLED' => '',
802
				));
803 1668 Luisehahne
	} else {
804 1777 Luisehahne
    	$oTpl->set_var(array(
805 1721 Luisehahne
				'DEV_INFOS_DISABLED' => $checked,
806
				'DEV_INFOS_ENABLED' => '',
807
				));
808 1668 Luisehahne
	}
809
810 1777 Luisehahne
//  Work-out which server os should be checked
811
	if(OPERATING_SYSTEM == 'linux')
812 1731 Luisehahne
	{
813 1777 Luisehahne
		$oTpl->set_var('LINUX_SELECTED', $checked);
814
		$oTpl->set_var('WINDOWS_SELECTED', '');
815
	} elseif(OPERATING_SYSTEM == 'windows') {
816
		$oTpl->set_var('WINDOWS_SELECTED', $checked);
817
		$oTpl->set_var('LINUX_SELECTED', '');
818 1731 Luisehahne
	}
819
820 1356 Luisehahne
	if(WBMAILER_ROUTINE == 'phpmail')
821
	{
822 1777 Luisehahne
		$oTpl->set_var('PHPMAIL_SELECTED', $checked);
823
		$oTpl->set_var('SMTP_VISIBILITY', ' style="display: none;"');
824
//		$oTpl->set_var('SMTP_VISIBILITY_AUTH', '');
825
		$oTpl->set_var('SMTP_AUTH_SELECTED', '');
826
		$oTpl->set_var('SMTPMAIL_SELECTED',  '');
827 1356 Luisehahne
	} elseif(WBMAILER_ROUTINE == 'smtp')
828
	{
829 1777 Luisehahne
		$oTpl->set_var('SMTPMAIL_SELECTED', $checked);
830
		$oTpl->set_var('PHPMAIL_SELECTED', '');
831
		$oTpl->set_var('SMTP_VISIBILITY', '');
832
//		$oTpl->set_var('SMTP_VISIBILITY_AUTH', '');
833 1356 Luisehahne
	}
834 1572 Luisehahne
/* deprecated
835 1356 Luisehahne
	// Work-out if SMTP authentification should be checked
836
	if(WBMAILER_SMTP_AUTH)
837
	{
838 1777 Luisehahne
		$oTpl->set_var('SMTP_AUTH_SELECTED', $checked);
839 1356 Luisehahne
		if(WBMAILER_ROUTINE == 'smtp')
840
	    {
841 1777 Luisehahne
			$oTpl->set_var('SMTP_VISIBILITY_AUTH', '');
842 1356 Luisehahne
843
		} else {
844 1777 Luisehahne
			$oTpl->set_var('SMTP_VISIBILITY_AUTH', ' style="display: none;"');
845 1356 Luisehahne
		}
846
	} else {
847 1777 Luisehahne
		$oTpl->set_var('SMTP_VISIBILITY_AUTH', ' style="display: none;"');
848 1356 Luisehahne
	}
849 1572 Luisehahne
*/
850 1356 Luisehahne
851 1777 Luisehahne
	// Work-out if 777 permissions are set
852
	$oTpl->set_var('WORLD_WRITEABLE_SELECTED', '');
853
	if(STRING_FILE_MODE == '0777' AND STRING_DIR_MODE == '0777')
854 1356 Luisehahne
	{
855 1777 Luisehahne
		$oTpl->set_var('WORLD_WRITEABLE_SELECTED', $checked);
856 1356 Luisehahne
	}
857
858 1716 Luisehahne
859 1777 Luisehahne
	$oTpl->set_var(array(
860
		'FILE_U_R_CHECKED' => '',
861
		'FILE_U_W_CHECKED' => '',
862
		'FILE_U_E_CHECKED' => '',
863
		'FILE_G_R_CHECKED' => '',
864
		'FILE_G_W_CHECKED' => '',
865
		'FILE_G_E_CHECKED' => '',
866
		'FILE_O_R_CHECKED' => '',
867
		'FILE_O_W_CHECKED' => '',
868
		'FILE_O_E_CHECKED' => '',
869
		'DIR_U_R_CHECKED' => '',
870
		'DIR_U_W_CHECKED' => '',
871
		'DIR_U_E_CHECKED' => '',
872
		'DIR_G_R_CHECKED' => '',
873
		'DIR_G_W_CHECKED' => '',
874
		'DIR_G_E_CHECKED' => '',
875
		'DIR_O_R_CHECKED' => '',
876
		'DIR_O_W_CHECKED' => '',
877
		'DIR_O_E_CHECKED' => '',
878
		));
879 1356 Luisehahne
880 1777 Luisehahne
//  Work-out which file mode boxes are checked
881 1356 Luisehahne
	if(extract_permission(STRING_FILE_MODE, 'u', 'r'))
882
	{
883 1777 Luisehahne
		$oTpl->set_var('FILE_U_R_CHECKED', $checked);
884 1356 Luisehahne
	}
885
	if(extract_permission(STRING_FILE_MODE, 'u', 'w'))
886
	{
887 1777 Luisehahne
		$oTpl->set_var('FILE_U_W_CHECKED', $checked);
888 1356 Luisehahne
	}
889
	if(extract_permission(STRING_FILE_MODE, 'u', 'e'))
890
	{
891 1777 Luisehahne
		$oTpl->set_var('FILE_U_E_CHECKED', $checked);
892 1356 Luisehahne
	}
893
	if(extract_permission(STRING_FILE_MODE, 'g', 'r'))
894
	{
895 1777 Luisehahne
		$oTpl->set_var('FILE_G_R_CHECKED', $checked);
896 1356 Luisehahne
	}
897
	if(extract_permission(STRING_FILE_MODE, 'g', 'w'))
898
	{
899 1777 Luisehahne
		$oTpl->set_var('FILE_G_W_CHECKED', $checked);
900 1356 Luisehahne
	}
901
	if(extract_permission(STRING_FILE_MODE, 'g', 'e'))
902
	{
903 1777 Luisehahne
		$oTpl->set_var('FILE_G_E_CHECKED', $checked);
904 1356 Luisehahne
	}
905
	if(extract_permission(STRING_FILE_MODE, 'o', 'r'))
906
	{
907 1777 Luisehahne
		$oTpl->set_var('FILE_O_R_CHECKED', $checked);
908 1356 Luisehahne
	}
909
	if(extract_permission(STRING_FILE_MODE, 'o', 'w'))
910
	{
911 1777 Luisehahne
		$oTpl->set_var('FILE_O_W_CHECKED', $checked);
912 1356 Luisehahne
	}
913
	if(extract_permission(STRING_FILE_MODE, 'o', 'e'))
914
	{
915 1777 Luisehahne
		$oTpl->set_var('FILE_O_E_CHECKED', $checked);
916 1356 Luisehahne
	}
917
	// Work-out which dir mode boxes are checked
918
	if(extract_permission(STRING_DIR_MODE, 'u', 'r'))
919
	{
920 1777 Luisehahne
		$oTpl->set_var('DIR_U_R_CHECKED', $checked);
921 1356 Luisehahne
	}
922
	if(extract_permission(STRING_DIR_MODE, 'u', 'w'))
923
	{
924 1777 Luisehahne
		$oTpl->set_var('DIR_U_W_CHECKED', $checked);
925 1356 Luisehahne
	}
926
	if(extract_permission(STRING_DIR_MODE, 'u', 'e'))
927
	{
928 1777 Luisehahne
		$oTpl->set_var('DIR_U_E_CHECKED', $checked);
929 1356 Luisehahne
	}
930
	if(extract_permission(STRING_DIR_MODE, 'g', 'r'))
931
	{
932 1777 Luisehahne
		$oTpl->set_var('DIR_G_R_CHECKED', $checked);
933 1356 Luisehahne
	}
934
	if(extract_permission(STRING_DIR_MODE, 'g', 'w'))
935
	{
936 1777 Luisehahne
		$oTpl->set_var('DIR_G_W_CHECKED', $checked);
937 1356 Luisehahne
	}
938
	if(extract_permission(STRING_DIR_MODE, 'g', 'e'))
939
	{
940 1777 Luisehahne
		$oTpl->set_var('DIR_G_E_CHECKED', $checked);
941 1356 Luisehahne
	}
942
	if(extract_permission(STRING_DIR_MODE, 'o', 'r'))
943
	{
944 1777 Luisehahne
		$oTpl->set_var('DIR_O_R_CHECKED', $checked);
945 1356 Luisehahne
	}
946
	if(extract_permission(STRING_DIR_MODE, 'o', 'w'))
947
	{
948 1777 Luisehahne
		$oTpl->set_var('DIR_O_W_CHECKED', $checked);
949 1356 Luisehahne
	}
950
	if(extract_permission(STRING_DIR_MODE, 'o', 'e'))
951
	{
952 1777 Luisehahne
		$oTpl->set_var('DIR_O_E_CHECKED', $checked);
953 1356 Luisehahne
	}
954 1843 Luisehahne
	$sReadOnly = '';
955
	$sPagesEditType = 'text';
956
	if( $bPagesCanModify = ($database->get_one('SELECT COUNT(*) FROM `'.TABLE_PREFIX.'pages`'))!=0 ) {
957
		$sReadOnly = ' readonly="readonly"';
958 1844 Luisehahne
		$sPagesEditType = 'grey bold';
959 1843 Luisehahne
	}
960 1356 Luisehahne
961 1777 Luisehahne
	$oTpl->set_var(array(
962
		'PAGES_DIRECTORY' => PAGES_DIRECTORY,
963 1843 Luisehahne
		'PAGES_READONLY' => $sReadOnly,
964
		'PAGES_EDIT_TYPE' => $sPagesEditType,
965 1777 Luisehahne
		'PAGE_ICON_DIR'   => PAGE_ICON_DIR,
966
		'MEDIA_DIRECTORY' => MEDIA_DIRECTORY,
967
		'PAGE_EXTENSION' => PAGE_EXTENSION,
968
		'PAGE_SPACER' => PAGE_SPACER,
969
		'TABLE_PREFIX' => TABLE_PREFIX
970
	 ));
971 1356 Luisehahne
972
	// Insert Server Email value into template
973 1777 Luisehahne
	$oTpl->set_var('SERVER_EMAIL', SERVER_EMAIL);
974 1356 Luisehahne
975 1777 Luisehahne
// Insert language text and messages
976
	$oTpl->set_var(array(
977 1912 Luisehahne
		'TEXT_CHANGES' => $mLang->TEXT_CHANGES,
978
		'TEXT_FILES' => strtoupper(substr($mLang->TEXT_FILES, 0, 1)).substr($mLang->TEXT_FILES, 1),
979 1777 Luisehahne
		'TEXT_WARN_PAGE_LEAVE' => '',
980 1912 Luisehahne
		'TEXT_WORLD_WRITEABLE_FILE_PERMISSIONS' => $mLang->TEXT_WORLD_WRITEABLE_FILE_PERMISSIONS,
981
		'MODE_SWITCH_WARNING' => $mLang->MESSAGE_SETTINGS_MODE_SWITCH_WARNING,
982
		'WORLD_WRITEABLE_WARNING' => $mLang->MESSAGE_SETTINGS_WORLD_WRITEABLE_WARNING
983 1777 Luisehahne
		));
984 1356 Luisehahne
985 1572 Luisehahne
if($is_advanced && $admin->get_user_id()=='1')
986
{
987 1777 Luisehahne
	$oTpl->parse('show_access', 'show_access_block');
988 1572 Luisehahne
}else {
989 1777 Luisehahne
	$oTpl->parse('show_access' , '');
990 1572 Luisehahne
}
991 1356 Luisehahne
992
// Parse template objects output
993 1777 Luisehahne
$oTpl->parse('main', 'main_block',false);
994
$oTpl->pparse('output', 'page');
995
//$oTpl->p('page');
996
unset($oTpl);
997 1923 darkviper
$mLang->disableAddon();
998 1356 Luisehahne
$admin->print_footer();