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