Project

General

Profile

1 1241 Luisehahne
<?php
2
/**
3
 *
4 1255 Luisehahne
 * @category        admin
5
 * @package         settings
6 1268 Luisehahne
 * @author          WebsiteBaker Project
7 1255 Luisehahne
 * @copyright       2004-2009, Ryan Djurovich
8
 * @copyright       2009-2010, Website Baker Org. e.V.
9
 * @link			http://www.websitebaker2.org/
10
 * @license         http://www.gnu.org/licenses/gpl.html
11
 * @platform        WebsiteBaker 2.8.x
12
 * @requirements    PHP 4.3.4 and higher
13 1268 Luisehahne
 * @version         $Id$
14
 * @filesource		$HeadURL$
15 1255 Luisehahne
 * @lastmodified    $Date$
16
 *
17 1241 Luisehahne
 */
18
19
require('../../config.php');
20
require_once(WB_PATH.'/framework/class.admin.php');
21 1335 Luisehahne
22
if(isset($_GET['advanced']) && $_GET['advanced'] == 'yes') {
23 1241 Luisehahne
	$admin = new admin('Settings', 'settings_advanced');
24
} else {
25
	$admin = new admin('Settings', 'settings_basic');
26
}
27
28
// Include the WB functions file
29
require_once(WB_PATH.'/framework/functions.php');
30
require_once(WB_PATH.'/framework/functions-utf8.php');
31
32
// Create new template object
33
$template = new Template(THEME_PATH.'/templates');
34 1335 Luisehahne
// $template->debug = true;
35 1241 Luisehahne
36 1335 Luisehahne
$template->set_file('page',        'settings.htt');
37
$template->set_block('page',       'main_block', 'main');
38
39
$template->set_block('main_block', 'template_list_block',         'template_list');
40
$template->set_block('main_block', 'timezone_list_block',         'timezone_list');
41
$template->set_block('main_block', 'language_list_block',         'language_list');
42
$template->set_block('main_block', 'date_format_list_block',      'date_format_list');
43
$template->set_block('main_block', 'time_format_list_block',      'time_format_list');
44
$template->set_block('main_block', 'theme_list_block',            'theme_list');
45
$template->set_block('main_block', 'search_template_list_block',  'search_template_list');
46
$template->set_block('main_block', 'group_list_block',            'group_list');
47
$template->set_block('main_block', 'charset_list_block',          'charset_list');
48
$template->set_block('main_block', 'error_reporting_list_block',  'error_reporting_list');
49
$template->set_block('main_block', 'editor_list_block',           'editor_list');
50
$template->set_block('main_block', 'page_level_limit_list_block', 'page_level_limit_list');
51
52
$template->set_block('main_block', 'show_page_level_limit_block', 'show_page_level_limit');
53
$template->set_block('main_block', 'show_checkbox_1_block',       'show_checkbox_1');
54
$template->set_block('main_block', 'show_checkbox_2_block',       'show_checkbox_2');
55
$template->set_block('main_block', 'show_checkbox_3_block',       'show_checkbox_3');
56
$template->set_block('main_block', 'show_php_error_level_block',  'show_php_error_level');
57
$template->set_block('main_block', 'show_charset_block',          'show_charset');
58
$template->set_block('main_block', 'show_wysiwyg_block',          'show_wysiwyg');
59
$template->set_block('main_block', 'show_access_block',           'show_access');
60
$template->set_block('main_block', 'show_search_block',           'show_search');
61
$template->set_block('main_block', 'show_redirect_timer_block',   'show_redirect_timer');
62
63 1241 Luisehahne
// Query current settings in the db, then loop through them and print them
64
$query = "SELECT * FROM ".TABLE_PREFIX."settings";
65
$results = $database->query($query);
66
while($setting = $results->fetchRow())
67
{
68
	$setting_name = $setting['name'];
69
	$setting_value = ( $setting_name != 'wbmailer_smtp_password' ) ? htmlspecialchars($setting['value']) : $setting['value'];
70
	$template->set_var(strtoupper($setting_name),$setting_value);
71
}
72
73
// Do the same for settings stored in config file as with ones in db
74
$database_type = '';
75 1335 Luisehahne
$is_advanced = (isset($_GET['advanced']) && $_GET['advanced'] == 'yes');
76 1241 Luisehahne
// Tell the browser whether or not to show advanced options
77 1335 Luisehahne
if($is_advanced)
78
{
79 1241 Luisehahne
	$template->set_var('DISPLAY_ADVANCED', '');
80 1335 Luisehahne
	$template->set_var('ADVANCED_FILE_PERMS_ID', 'file_perms_box');
81
	$template->set_var('BASIC_FILE_PERMS_ID', 'hide');
82 1241 Luisehahne
	$template->set_var('ADVANCED', 'yes');
83
	$template->set_var('ADVANCED_BUTTON', '&lt;&lt; '.$TEXT['HIDE_ADVANCED']);
84
	$template->set_var('ADVANCED_LINK', 'index.php?advanced=no');
85 1335 Luisehahne
86 1241 Luisehahne
} else {
87
	$template->set_var('DISPLAY_ADVANCED', ' style="display: none;"');
88 1335 Luisehahne
	$template->set_var('BASIC_FILE_PERMS_ID', 'file_perms_box');
89
	$template->set_var('ADVANCED_FILE_PERMS_ID', 'hide');
90
91 1241 Luisehahne
	$template->set_var('ADVANCED', 'no');
92
	$template->set_var('ADVANCED_BUTTON', $TEXT['SHOW_ADVANCED'].' &gt;&gt;');
93
	$template->set_var('ADVANCED_LINK', 'index.php?advanced=yes');
94
}
95
96 1335 Luisehahne
	$query = "SELECT * FROM ".TABLE_PREFIX."search WHERE extra = ''";
97
	$results = $database->query($query);
98
99
	// Query current settings in the db, then loop through them and print them
100
	while($setting = $results->fetchRow())
101
	{
102
		$setting_name = $setting['name'];
103
		$setting_value = htmlspecialchars(($setting['value']));
104
		switch($setting_name) {
105
			// Search header
106
			case 'header':
107
				$template->set_var('SEARCH_HEADER', $setting_value);
108
			break;
109
			// Search results header
110
			case 'results_header':
111
				$template->set_var('SEARCH_RESULTS_HEADER', $setting_value);
112
			break;
113
			// Search results loop
114
			case 'results_loop':
115
				$template->set_var('SEARCH_RESULTS_LOOP', $setting_value);
116
			break;
117
			// Search results footer
118
			case 'results_footer':
119
				$template->set_var('SEARCH_RESULTS_FOOTER', $setting_value);
120
			break;
121
			// Search no results
122
			case 'no_results':
123
				$template->set_var('SEARCH_NO_RESULTS', $setting_value);
124
			break;
125
			// Search footer
126
			case 'footer':
127
				$template->set_var('SEARCH_FOOTER', $setting_value);
128
			break;
129
			// Search module-order
130
			case 'module_order':
131
				$template->set_var('SEARCH_MODULE_ORDER', $setting_value);
132
			break;
133
			// Search max lines of excerpt
134
			case 'max_excerpt':
135
				$template->set_var('SEARCH_MAX_EXCERPT', $setting_value);
136
			break;
137
			// time-limit
138
			case 'time_limit':
139
				$template->set_var('SEARCH_TIME_LIMIT', $setting_value);
140
			break;
141
			// Search template
142
			case 'template':
143
				$search_template = $setting_value;
144
			break;
145
		}
146
	}
147
148
	$template->set_var(array(
149 1241 Luisehahne
									'PAGES_DIRECTORY' => PAGES_DIRECTORY,
150
									'MEDIA_DIRECTORY' => MEDIA_DIRECTORY,
151
									'PAGE_EXTENSION' => PAGE_EXTENSION,
152
									'PAGE_SPACER' => PAGE_SPACER,
153
									'WB_PATH' => WB_PATH,
154
									'WB_URL' => WB_URL,
155
									'THEME_URL' => THEME_URL,
156
									'ADMIN_PATH' => ADMIN_PATH,
157
									'ADMIN_URL' => ADMIN_URL,
158 1335 Luisehahne
								    'DATABASE_TYPE' => '',
159
									'DATABASE_HOST' => '',
160
									'DATABASE_USERNAME' => '',
161
									'DATABASE_NAME' => '',
162 1241 Luisehahne
									'TABLE_PREFIX' => TABLE_PREFIX
163 1335 Luisehahne
								 ));
164 1241 Luisehahne
165 1335 Luisehahne
	// Insert language values
166
	$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'language' ORDER BY name");
167
	if($result->numRows() > 0)
168
	{
169
		while($addon = $result->fetchRow()) {
170
			$l_codes[$addon['name']] = $addon['directory'];
171
			$l_names[$addon['name']] = entities_to_7bit($addon['name']); // sorting-problem workaround
172
		}
173
		asort($l_names);
174
		foreach($l_names as $l_name=>$v) {
175
			// Insert code and name
176
			$template->set_var(array(
177
									'CODE' => $l_codes[$l_name],
178
									'NAME' => $l_name,
179
									'FLAG' => THEME_URL.'/images/flags/'.strtolower($l_codes[$l_name]),
180
									));
181
			// Check if it is selected
182
			if(DEFAULT_LANGUAGE == $l_codes[$l_name]) {
183
				$template->set_var('SELECTED', ' selected="selected"');
184
			} else {
185
				$template->set_var('SELECTED', '');
186
			}
187
			$template->parse('language_list', 'language_list_block', true);
188
		}
189 1241 Luisehahne
	}
190 1335 Luisehahne
191
	// Insert default timezone values
192
	require(ADMIN_PATH.'/interface/timezones.php');
193
	foreach($TIMEZONES AS $hour_offset => $title)
194
	{
195
		// Make sure we dont list "System Default" as we are setting this value!
196
		if($hour_offset != '-20') {
197
			$template->set_var('VALUE', $hour_offset);
198
			$template->set_var('NAME', $title);
199
			if(DEFAULT_TIMEZONE == $hour_offset*60*60) {
200
				$template->set_var('SELECTED', ' selected="selected"');
201
			} else {
202
				$template->set_var('SELECTED', '');
203
			}
204
			$template->parse('timezone_list', 'timezone_list_block', true);
205
		}
206
	}
207
208
	// Insert default charset values
209
	require(ADMIN_PATH.'/interface/charsets.php');
210
	foreach($CHARSETS AS $code => $title) {
211
		$template->set_var('VALUE', $code);
212
		$template->set_var('NAME', $title);
213
		if(DEFAULT_CHARSET == $code) {
214 1241 Luisehahne
			$template->set_var('SELECTED', ' selected="selected"');
215
		} else {
216
			$template->set_var('SELECTED', '');
217
		}
218 1335 Luisehahne
		$template->parse('charset_list', 'charset_list_block', true);
219 1241 Luisehahne
	}
220
221 1335 Luisehahne
222
	// Insert date format list
223
	require(ADMIN_PATH.'/interface/date_formats.php');
224
	foreach($DATE_FORMATS AS $format => $title) {
225
		$format = str_replace('|', ' ', $format); // Add's white-spaces (not able to be stored in array key)
226
		if($format != 'system_default') {
227
			$template->set_var('VALUE', $format);
228
		} else {
229
			$template->set_var('VALUE', '');
230
		}
231 1241 Luisehahne
		$template->set_var('NAME', $title);
232 1335 Luisehahne
		if(DEFAULT_DATE_FORMAT == $format) {
233 1241 Luisehahne
			$template->set_var('SELECTED', ' selected="selected"');
234
		} else {
235
			$template->set_var('SELECTED', '');
236
		}
237 1335 Luisehahne
		$template->parse('date_format_list', 'date_format_list_block', true);
238 1241 Luisehahne
	}
239
240 1335 Luisehahne
	// Insert time format list
241
	require(ADMIN_PATH.'/interface/time_formats.php');
242
	foreach($TIME_FORMATS AS $format => $title) {
243
		$format = str_replace('|', ' ', $format); // Add's white-spaces (not able to be stored in array key)
244
		if($format != 'system_default') {
245
			$template->set_var('VALUE', $format);
246
		} else {
247
			$template->set_var('VALUE', '');
248
		}
249
		$template->set_var('NAME', $title);
250
		if(DEFAULT_TIME_FORMAT == $format) {
251
			$template->set_var('SELECTED', ' selected="selected"');
252
		} else {
253
			$template->set_var('SELECTED', '');
254
		}
255
		$template->parse('time_format_list', 'time_format_list_block', true);
256 1241 Luisehahne
	}
257
258 1335 Luisehahne
	// Insert templates
259
	$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'template' AND function != 'theme' ORDER BY name");
260
	if($result->numRows() > 0) {
261
		while($addon = $result->fetchRow()) {
262
			$template->set_var('FILE', $addon['directory']);
263
			$template->set_var('NAME', $addon['name']);
264
			if(($addon['directory'] == DEFAULT_TEMPLATE) ? $selected = ' selected="selected"' : $selected = '');
265
			$template->set_var('SELECTED', $selected);
266
			$template->parse('template_list', 'template_list_block', true);
267
		}
268 1241 Luisehahne
	}
269
270 1335 Luisehahne
	// Insert backend theme
271
	$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'template' AND function = 'theme' ORDER BY name");
272
	if($result->numRows() > 0) {
273
		while($addon = $result->fetchRow()) {
274
			$template->set_var('FILE', $addon['directory']);
275
			$template->set_var('NAME', $addon['name']);
276
			if(($addon['directory'] == DEFAULT_THEME) ? $selected = ' selected="selected"' : $selected = '');
277
			$template->set_var('SELECTED', $selected);
278
			$template->parse('theme_list', 'theme_list_block', true);
279
		}
280 1241 Luisehahne
	}
281
282 1335 Luisehahne
	// Insert WYSIWYG modules
283
	$file='none';
284
	$module_name=$TEXT['NONE'];
285
	$template->set_var('FILE', $file);
286
	$template->set_var('NAME', $module_name);
287
	$selected = (!defined('WYSIWYG_EDITOR') || $file == WYSIWYG_EDITOR) ? ' selected="selected"' : '';
288
	$template->set_var('SELECTED', $selected);
289
	$template->parse('editor_list', 'editor_list_block', true);
290
	$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'module' AND function = 'wysiwyg' ORDER BY name");
291
	if($result->numRows() > 0)
292
	{
293
		while($addon = $result->fetchRow())
294
	    {
295
			$template->set_var('FILE', $addon['directory']);
296
			$template->set_var('NAME', $addon['name']);
297
			$selected = (!defined('WYSIWYG_EDITOR') || $addon['directory'] == WYSIWYG_EDITOR) ? ' selected="selected"' : '';
298
			$template->set_var('SELECTED', $selected);
299
			$template->parse('editor_list', 'editor_list_block', true);
300
		}
301 1241 Luisehahne
	}
302
303
// Insert templates for search settings
304 1335 Luisehahne
	$search_template = ( ($search_template == DEFAULT_TEMPLATE) || ($search_template == '') ) ? DEFAULT_TEMPLATE : $search_template;
305
	$selected = ( ($search_template != DEFAULT_TEMPLATE) ) ?  ' selected="selected"' : $selected = '';
306 1241 Luisehahne
307 1335 Luisehahne
	$template->set_var(array(
308
	        'FILE' => '',
309
	        'NAME' => $TEXT['SYSTEM_DEFAULT'],
310
	        'SELECTED' => $selected
311
	    ));
312 1255 Luisehahne
313 1335 Luisehahne
	$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'template' AND function = 'template' ORDER BY name");
314
	if($result->numRows() > 0)
315
	{
316
		while($addon = $result->fetchRow())
317
	    {
318
			$template->set_var('FILE', $addon['directory']);
319
			$template->set_var('NAME', $addon['name']);
320
	        $selected = ($addon['directory'] == $search_template) ? ' selected="selected"' :  $selected = '';
321
			$template->set_var('SELECTED', $selected);
322
			$template->parse('search_template_list', 'search_template_list_block', true);
323 1255 Luisehahne
324 1335 Luisehahne
		}
325
	}
326 1241 Luisehahne
327 1335 Luisehahne
	// Insert default error reporting values
328
	require(ADMIN_PATH.'/interface/er_levels.php');
329
	foreach($ER_LEVELS AS $value => $title)
330
	{
331
		$template->set_var('VALUE', $value);
332
		$template->set_var('NAME', $title);
333
	    $selected = (ER_LEVEL == $value) ? ' selected="selected"' : '';
334
	    $template->set_var('SELECTED', $selected);
335
		$template->parse('error_reporting_list', 'error_reporting_list_block', true);
336
	}
337 1241 Luisehahne
338 1335 Luisehahne
	// Insert permissions values
339
	if($admin->get_permission('settings_advanced') != true)
340
	{
341
		$template->set_var('DISPLAY_ADVANCED_BUTTON', 'hide');
342
	}
343 1241 Luisehahne
344 1335 Luisehahne
	// Insert page level limits
345
	for($i = 1; $i <= 10; $i++)
346
	{
347
		$template->set_var('NUMBER', $i);
348
		if(PAGE_LEVEL_LIMIT == $i)
349
	    {
350
			$template->set_var('SELECTED', ' selected="selected"');
351
		} else {
352
			$template->set_var('SELECTED', '');
353
		}
354
		$template->parse('page_level_limit_list', 'page_level_limit_list_block', true);
355 1241 Luisehahne
	}
356
357 1335 Luisehahne
	// Work-out if multiple menus feature is enabled
358
	if(defined('MULTIPLE_MENUS') && MULTIPLE_MENUS == true)
359
	{
360
		$template->set_var('MULTIPLE_MENUS_ENABLED', ' checked="checked"');
361
	} else {
362
		$template->set_var('MULTIPLE_MENUS_DISABLED', ' checked="checked"');
363
	}
364 1255 Luisehahne
365 1335 Luisehahne
	// Work-out if page languages feature is enabled
366
	if(defined('PAGE_LANGUAGES') && PAGE_LANGUAGES == true)
367
	{
368
	        $template->set_var('PAGE_LANGUAGES_ENABLED', ' checked="checked"');
369
	} else {
370
	        $template->set_var('PAGE_LANGUAGES_DISABLED', ' checked="checked"');
371
	}
372 1241 Luisehahne
373 1335 Luisehahne
	// Work-out if smart login feature is enabled
374
	if(defined('SMART_LOGIN') && SMART_LOGIN == true)
375
	{
376
		$template->set_var('SMART_LOGIN_ENABLED', ' checked="checked"');
377
	} else {
378
		$template->set_var('SMART_LOGIN_DISABLED', ' checked="checked"');
379
	}
380 1241 Luisehahne
381 1335 Luisehahne
	/* Make's sure GD library is installed */
382
	if(extension_loaded('gd') && function_exists('imageCreateFromJpeg'))
383
	{
384
		$template->set_var('GD_EXTENSION_ENABLED', '');
385 1241 Luisehahne
	} else {
386 1335 Luisehahne
		$template->set_var('GD_EXTENSION_ENABLED', ' style="display: none;"');
387 1241 Luisehahne
	}
388
389 1335 Luisehahne
	// Work-out if section blocks feature is enabled
390
	if(defined('SECTION_BLOCKS') && SECTION_BLOCKS == true)
391
	{
392
		$template->set_var('SECTION_BLOCKS_ENABLED', ' checked="checked"');
393
	} else {
394
		$template->set_var('SECTION_BLOCKS_DISABLED', ' checked="checked"');
395
	}
396 1241 Luisehahne
397 1335 Luisehahne
	// Work-out if homepage redirection feature is enabled
398
	if(defined('HOMEPAGE_REDIRECTION') && HOMEPAGE_REDIRECTION == true)
399
	{
400
		$template->set_var('HOMEPAGE_REDIRECTION_ENABLED', ' checked="checked"');
401
	} else {
402
		$template->set_var('HOMEPAGE_REDIRECTION_DISABLED', ' checked="checked"');
403
	}
404 1241 Luisehahne
405 1335 Luisehahne
	// Work-out which server os should be checked
406
	if(OPERATING_SYSTEM == 'linux')
407
	{
408
		$template->set_var('LINUX_SELECTED', ' checked="checked"');
409
	} elseif(OPERATING_SYSTEM == 'windows') {
410
		$template->set_var('WINDOWS_SELECTED', ' checked="checked"');
411
	}
412 1241 Luisehahne
413 1335 Luisehahne
	// Work-out if manage sections feature is enabled
414
	if(MANAGE_SECTIONS)
415
	{
416
		$template->set_var('MANAGE_SECTIONS_ENABLED', ' checked="checked"');
417
	} else {
418
		$template->set_var('MANAGE_SECTIONS_DISABLED', ' checked="checked"');
419
	}
420 1241 Luisehahne
421 1335 Luisehahne
	// Work-out which wbmailer routine should be checked
422
	if(WBMAILER_ROUTINE == 'phpmail')
423
	{
424
		$template->set_var('PHPMAIL_SELECTED', ' checked="checked"');
425
		$template->set_var('SMTP_VISIBILITY', ' style="display: none;"');
426
		$template->set_var('SMTP_VISIBILITY_AUTH', ' style="display: none;"');
427
	} elseif(WBMAILER_ROUTINE == 'smtp')
428
	{
429
		$template->set_var('SMTPMAIL_SELECTED', ' checked="checked"');
430
		$template->set_var('SMTP_VISIBILITY', '');
431
	}
432 1241 Luisehahne
433 1335 Luisehahne
	// Work-out if SMTP authentification should be checked
434
	if(WBMAILER_SMTP_AUTH)
435
	{
436
		$template->set_var('SMTP_AUTH_SELECTED', ' checked="checked"');
437
		if(WBMAILER_ROUTINE == 'smtp')
438
	    {
439
			$template->set_var('SMTP_VISIBILITY_AUTH', '');
440 1241 Luisehahne
441 1335 Luisehahne
		} else {
442
			$template->set_var('SMTP_VISIBILITY_AUTH', ' style="display: none;"');
443
		}
444 1241 Luisehahne
	} else {
445 1260 Luisehahne
		$template->set_var('SMTP_VISIBILITY_AUTH', ' style="display: none;"');
446 1241 Luisehahne
	}
447
448 1335 Luisehahne
	// Work-out if intro feature is enabled
449
	if(INTRO_PAGE)
450
	{
451
		$template->set_var('INTRO_PAGE_ENABLED', ' checked="checked"');
452
	} else {
453
		$template->set_var('INTRO_PAGE_DISABLED', ' checked="checked"');
454
	}
455 1241 Luisehahne
456 1335 Luisehahne
	// Work-out if frontend login feature is enabled
457
	if(FRONTEND_LOGIN)
458
	{
459
		$template->set_var('PRIVATE_ENABLED', ' checked="checked"');
460
	} else {
461
		$template->set_var('PRIVATE_DISABLED', ' checked="checked"');
462
	}
463 1241 Luisehahne
464 1335 Luisehahne
	// Work-out if page trash feature is disabled, in-line, or separate
465
	if(PAGE_TRASH == 'disabled')
466
	{
467
		$template->set_var('PAGE_TRASH_DISABLED', ' checked="checked"');
468
		$template->set_var('DISPLAY_PAGE_TRASH_SEPARATE', 'display: none;');
469
	} elseif(PAGE_TRASH == 'inline')
470
	{
471
		$template->set_var('PAGE_TRASH_INLINE', ' checked="checked"');
472
		$template->set_var('DISPLAY_PAGE_TRASH_SEPARATE', 'display: none;');
473
	} elseif(PAGE_TRASH == 'separate')
474
	{
475
		$template->set_var('PAGE_TRASH_SEPARATE', ' checked="checked"');
476
		$template->set_var('DISPLAY_PAGE_TRASH_SEPARATE', 'display: inline;');
477
	}
478 1241 Luisehahne
479 1335 Luisehahne
	// Work-out if media home folde feature is enabled
480
	if(HOME_FOLDERS)
481
	{
482
		$template->set_var('HOME_FOLDERS_ENABLED', ' checked="checked"');
483
	} else {
484
		$template->set_var('HOME_FOLDERS_DISABLED', ' checked="checked"');
485
	}
486 1241 Luisehahne
487 1335 Luisehahne
	// Insert search select
488
	if(SEARCH == 'private')
489
	{
490
		$template->set_var('PRIVATE_SEARCH', ' selected="selected"');
491
	} elseif(SEARCH == 'registered') {
492
		$template->set_var('REGISTERED_SEARCH', ' selected="selected"');
493
	} elseif(SEARCH == 'none') {
494
		$template->set_var('NONE_SEARCH', ' selected="selected"');
495
	}
496 1241 Luisehahne
497 1335 Luisehahne
	// Work-out if 777 permissions are set
498
	if(STRING_FILE_MODE == '0777' AND STRING_DIR_MODE == '0777')
499
	{
500
		$template->set_var('WORLD_WRITEABLE_SELECTED', ' checked="checked"');
501
	}
502 1241 Luisehahne
503 1335 Luisehahne
	// Work-out which file mode boxes are checked
504
	if(extract_permission(STRING_FILE_MODE, 'u', 'r'))
505
	{
506
		$template->set_var('FILE_U_R_CHECKED', ' checked="checked"');
507
	}
508
	if(extract_permission(STRING_FILE_MODE, 'u', 'w'))
509
	{
510
		$template->set_var('FILE_U_W_CHECKED', ' checked="checked"');
511
	}
512
	if(extract_permission(STRING_FILE_MODE, 'u', 'e'))
513
	{
514
		$template->set_var('FILE_U_E_CHECKED', ' checked="checked"');
515
	}
516
	if(extract_permission(STRING_FILE_MODE, 'g', 'r'))
517
	{
518
		$template->set_var('FILE_G_R_CHECKED', ' checked="checked"');
519
	}
520
	if(extract_permission(STRING_FILE_MODE, 'g', 'w'))
521
	{
522
		$template->set_var('FILE_G_W_CHECKED', ' checked="checked"');
523
	}
524
	if(extract_permission(STRING_FILE_MODE, 'g', 'e'))
525
	{
526
		$template->set_var('FILE_G_E_CHECKED', ' checked="checked"');
527
	}
528
	if(extract_permission(STRING_FILE_MODE, 'o', 'r'))
529
	{
530
		$template->set_var('FILE_O_R_CHECKED', ' checked="checked"');
531
	}
532
	if(extract_permission(STRING_FILE_MODE, 'o', 'w'))
533
	{
534
		$template->set_var('FILE_O_W_CHECKED', ' checked="checked"');
535
	}
536
	if(extract_permission(STRING_FILE_MODE, 'o', 'e'))
537
	{
538
		$template->set_var('FILE_O_E_CHECKED', ' checked="checked"');
539
	}
540
	// Work-out which dir mode boxes are checked
541
	if(extract_permission(STRING_DIR_MODE, 'u', 'r'))
542
	{
543
		$template->set_var('DIR_U_R_CHECKED', ' checked="checked"');
544
	}
545
	if(extract_permission(STRING_DIR_MODE, 'u', 'w'))
546
	{
547
		$template->set_var('DIR_U_W_CHECKED', ' checked="checked"');
548
	}
549
	if(extract_permission(STRING_DIR_MODE, 'u', 'e'))
550
	{
551
		$template->set_var('DIR_U_E_CHECKED', ' checked="checked"');
552
	}
553
	if(extract_permission(STRING_DIR_MODE, 'g', 'r'))
554
	{
555
		$template->set_var('DIR_G_R_CHECKED', ' checked="checked"');
556
	}
557
	if(extract_permission(STRING_DIR_MODE, 'g', 'w'))
558
	{
559
		$template->set_var('DIR_G_W_CHECKED', ' checked="checked"');
560
	}
561
	if(extract_permission(STRING_DIR_MODE, 'g', 'e'))
562
	{
563
		$template->set_var('DIR_G_E_CHECKED', ' checked="checked"');
564
	}
565
	if(extract_permission(STRING_DIR_MODE, 'o', 'r'))
566
	{
567
		$template->set_var('DIR_O_R_CHECKED', ' checked="checked"');
568
	}
569
	if(extract_permission(STRING_DIR_MODE, 'o', 'w'))
570
	{
571
		$template->set_var('DIR_O_W_CHECKED', ' checked="checked"');
572
	}
573
	if(extract_permission(STRING_DIR_MODE, 'o', 'e'))
574
	{
575
		$template->set_var('DIR_O_E_CHECKED', ' checked="checked"');
576
	}
577 1241 Luisehahne
578 1335 Luisehahne
	// Insert Server Email value into template
579
	$template->set_var('SERVER_EMAIL', SERVER_EMAIL);
580 1241 Luisehahne
581 1335 Luisehahne
	// Insert groups into signup list
582
	$results = $database->query("SELECT group_id, name FROM ".TABLE_PREFIX."groups WHERE group_id != '1'");
583
	if($results->numRows() > 0)
584
	{
585
		while($group = $results->fetchRow())
586
	    {
587
			$template->set_var('ID', $group['group_id']);
588
			$template->set_var('NAME', $group['name']);
589
			if(FRONTEND_SIGNUP == $group['group_id'])
590
	        {
591
				$template->set_var('SELECTED', ' selected="selected"');
592
			} else {
593
				$template->set_var('SELECTED', '');
594
			}
595
			$template->parse('group_list', 'group_list_block', true);
596 1241 Luisehahne
		}
597 1335 Luisehahne
	} else {
598
		$template->set_var('ID', 'disabled');
599
		$template->set_var('NAME', $MESSAGE['GROUPS']['NO_GROUPS_FOUND']);
600 1241 Luisehahne
		$template->parse('group_list', 'group_list_block', true);
601
	}
602
603 1335 Luisehahne
	// Insert language headings
604
	$template->set_var(array(
605 1241 Luisehahne
								'HEADING_GENERAL_SETTINGS' => $HEADING['GENERAL_SETTINGS'],
606
								'HEADING_DEFAULT_SETTINGS' => $HEADING['DEFAULT_SETTINGS'],
607
								'HEADING_SEARCH_SETTINGS' => $HEADING['SEARCH_SETTINGS'],
608
								'HEADING_SERVER_SETTINGS' => $HEADING['SERVER_SETTINGS'],
609
								'HEADING_WBMAILER_SETTINGS' => $HEADING['WBMAILER_SETTINGS'],
610
								'HEADING_ADMINISTRATION_TOOLS' => $HEADING['ADMINISTRATION_TOOLS']
611
								)
612
						);
613 1335 Luisehahne
	// Insert language text and messages
614
	$template->set_var(array(
615 1241 Luisehahne
								'TEXT_WEBSITE_TITLE' => $TEXT['WEBSITE_TITLE'],
616
								'TEXT_WEBSITE_DESCRIPTION' => $TEXT['WEBSITE_DESCRIPTION'],
617
								'TEXT_WEBSITE_KEYWORDS' => $TEXT['WEBSITE_KEYWORDS'],
618
								'TEXT_WEBSITE_HEADER' => $TEXT['WEBSITE_HEADER'],
619
								'TEXT_WEBSITE_FOOTER' => $TEXT['WEBSITE_FOOTER'],
620
								'TEXT_HEADER' => $TEXT['HEADER'],
621
								'TEXT_FOOTER' => $TEXT['FOOTER'],
622
								'TEXT_VISIBILITY' => $TEXT['VISIBILITY'],
623
								'TEXT_RESULTS_HEADER' => $TEXT['RESULTS_HEADER'],
624
								'TEXT_RESULTS_LOOP' => $TEXT['RESULTS_LOOP'],
625
								'TEXT_RESULTS_FOOTER' => $TEXT['RESULTS_FOOTER'],
626
								'TEXT_NO_RESULTS' => $TEXT['NO_RESULTS'],
627
								'TEXT_TEXT' => $TEXT['TEXT'],
628
								'TEXT_DEFAULT' => $TEXT['DEFAULT'],
629
								'TEXT_LANGUAGE' => $TEXT['LANGUAGE'],
630
								'TEXT_TIMEZONE' => $TEXT['TIMEZONE'],
631
								'TEXT_CHARSET' => $TEXT['CHARSET'],
632
								'TEXT_DATE_FORMAT' => $TEXT['DATE_FORMAT'],
633
								'TEXT_TIME_FORMAT' => $TEXT['TIME_FORMAT'],
634
								'TEXT_TEMPLATE' => $TEXT['TEMPLATE'],
635
								'TEXT_THEME' => $TEXT['THEME'],
636
								'TEXT_WYSIWYG_EDITOR' => $TEXT['WYSIWYG_EDITOR'],
637
								'TEXT_PAGE_LEVEL_LIMIT' => $TEXT['PAGE_LEVEL_LIMIT'],
638
								'TEXT_INTRO_PAGE' => $TEXT['INTRO_PAGE'],
639
								'TEXT_FRONTEND' => $TEXT['FRONTEND'],
640
								'TEXT_LOGIN' => $TEXT['LOGIN'],
641
								'TEXT_REDIRECT_AFTER' => $TEXT['REDIRECT_AFTER'],
642
								'TEXT_SIGNUP' => $TEXT['SIGNUP'],
643
								'TEXT_PHP_ERROR_LEVEL' => $TEXT['PHP_ERROR_LEVEL'],
644
								'TEXT_PAGES_DIRECTORY' => $TEXT['PAGES_DIRECTORY'],
645
								'TEXT_MEDIA_DIRECTORY' => $TEXT['MEDIA_DIRECTORY'],
646
								'TEXT_PAGE_EXTENSION' => $TEXT['PAGE_EXTENSION'],
647
								'TEXT_PAGE_SPACER' => $TEXT['PAGE_SPACER'],
648
								'TEXT_RENAME_FILES_ON_UPLOAD' => $TEXT['RENAME_FILES_ON_UPLOAD'],
649
								'TEXT_APP_NAME' => $TEXT['APP_NAME'],
650
								'TEXT_SESSION_IDENTIFIER' => $TEXT['SESSION_IDENTIFIER'],
651
								'TEXT_SEC_ANCHOR' => $TEXT['SEC_ANCHOR'],
652
								'TEXT_SERVER_OPERATING_SYSTEM' => $TEXT['SERVER_OPERATING_SYSTEM'],
653
								'TEXT_LINUX_UNIX_BASED' => $TEXT['LINUX_UNIX_BASED'],
654
								'TEXT_WINDOWS' => $TEXT['WINDOWS'],
655
								'TEXT_ADMIN' => $TEXT['ADMIN'],
656
								'TEXT_TYPE' => $TEXT['TYPE'],
657
								'TEXT_DATABASE' => $TEXT['DATABASE'],
658
								'TEXT_HOST' => $TEXT['HOST'],
659
								'TEXT_USERNAME' => $TEXT['USERNAME'],
660
								'TEXT_PASSWORD' => $TEXT['PASSWORD'],
661
								'TEXT_NAME' => $TEXT['NAME'],
662
								'TEXT_TABLE_PREFIX' => $TEXT['TABLE_PREFIX'],
663
								'TEXT_SAVE' => $TEXT['SAVE'],
664
								'TEXT_RESET' => $TEXT['RESET'],
665
								'TEXT_CHANGES' => $TEXT['CHANGES'],
666
								'TEXT_ENABLED' => $TEXT['ENABLED'],
667
								'TEXT_DISABLED' => $TEXT['DISABLED'],
668
								'TEXT_MANAGE_SECTIONS' => $HEADING['MANAGE_SECTIONS'],
669
								'TEXT_MANAGE' => $TEXT['MANAGE'],
670
								'TEXT_SEARCH' => $TEXT['SEARCH'],
671
								'TEXT_PUBLIC' => $TEXT['PUBLIC'],
672
								'TEXT_PRIVATE' => $TEXT['PRIVATE'],
673
								'TEXT_REGISTERED' => $TEXT['REGISTERED'],
674
								'TEXT_NONE' => $TEXT['NONE'],
675
								'TEXT_FILES' => strtoupper(substr($TEXT['FILES'], 0, 1)).substr($TEXT['FILES'], 1),
676
								'TEXT_DIRECTORIES' => $TEXT['DIRECTORIES'],
677
								'TEXT_FILESYSTEM_PERMISSIONS' => $TEXT['FILESYSTEM_PERMISSIONS'],
678
								'TEXT_USER' => $TEXT['USER'],
679
								'TEXT_GROUP' => $TEXT['GROUP'],
680
								'TEXT_OTHERS' => $TEXT['OTHERS'],
681
								'TEXT_READ' => $TEXT['READ'],
682
								'TEXT_WRITE' => $TEXT['WRITE'],
683
								'TEXT_EXECUTE' => $TEXT['EXECUTE'],
684
								'TEXT_SMART_LOGIN' => $TEXT['SMART_LOGIN'],
685
								'TEXT_MULTIPLE_MENUS' => $TEXT['MULTIPLE_MENUS'],
686
								'TEXT_HOMEPAGE_REDIRECTION' => $TEXT['HOMEPAGE_REDIRECTION'],
687
								'TEXT_SECTION_BLOCKS' => $TEXT['SECTION_BLOCKS'],
688
								'TEXT_PLEASE_SELECT' => $TEXT['PLEASE_SELECT'],
689
								'TEXT_PAGE_TRASH' => $TEXT['PAGE_TRASH'],
690
								'TEXT_PAGE_LANGUAGES' => $TEXT['PAGE_LANGUAGES'],
691
								'TEXT_INLINE' => $TEXT['INLINE'],
692
								'TEXT_SEPARATE' => $TEXT['SEPARATE'],
693
								'TEXT_HOME_FOLDERS' => $TEXT['HOME_FOLDERS'],
694
								'TEXT_WYSIWYG_STYLE' => $TEXT['WYSIWYG_STYLE'],
695
								'TEXT_WORLD_WRITEABLE_FILE_PERMISSIONS' => $TEXT['WORLD_WRITEABLE_FILE_PERMISSIONS'],
696
								'TEXT_WBMAILER_DEFAULT_SETTINGS_NOTICE' => $TEXT['WBMAILER_DEFAULT_SETTINGS_NOTICE'],
697
								'TEXT_WBMAILER_DEFAULT_SENDER_MAIL' => $TEXT['WBMAILER_DEFAULT_SENDER_MAIL'],
698
								'TEXT_WBMAILER_DEFAULT_SENDER_NAME' => $TEXT['WBMAILER_DEFAULT_SENDER_NAME'],
699
								'TEXT_WBMAILER_NOTICE' => $TEXT['WBMAILER_NOTICE'],
700
								'TEXT_WBMAILER_FUNCTION' => $TEXT['WBMAILER_FUNCTION'],
701
								'TEXT_WBMAILER_SMTP_HOST' => $TEXT['WBMAILER_SMTP_HOST'],
702
								'TEXT_WBMAILER_PHP' => $TEXT['WBMAILER_PHP'],
703
								'TEXT_WBMAILER_SMTP' => $TEXT['WBMAILER_SMTP'],
704
								'TEXT_WBMAILER_SMTP_AUTH' => $TEXT['WBMAILER_SMTP_AUTH'],
705
								'TEXT_WBMAILER_SMTP_AUTH_NOTICE' => $TEXT['WBMAILER_SMTP_AUTH_NOTICE'],
706
								'TEXT_WBMAILER_SMTP_USERNAME' => $TEXT['WBMAILER_SMTP_USERNAME'],
707
								'TEXT_WBMAILER_SMTP_PASSWORD' => $TEXT['WBMAILER_SMTP_PASSWORD'],
708
								'MODE_SWITCH_WARNING' => $MESSAGE['SETTINGS']['MODE_SWITCH_WARNING'],
709
								'WORLD_WRITEABLE_WARNING' => $MESSAGE['SETTINGS']['WORLD_WRITEABLE_WARNING'],
710
								'TEXT_MODULE_ORDER' => $TEXT['MODULE_ORDER'],
711
								'TEXT_MAX_EXCERPT' => $TEXT['MAX_EXCERPT'],
712
								'TEXT_TIME_LIMIT' => $TEXT['TIME_LIMIT']
713 1335 Luisehahne
								));
714 1241 Luisehahne
715 1335 Luisehahne
if($is_advanced)
716
{
717
	$template->parse('show_page_level_limit', 'show_page_level_limit_block', true);
718
	$template->parse('show_checkbox_1',       'show_checkbox_1_block', true);
719
 	$template->parse('show_checkbox_2',       'show_checkbox_2_block', true);
720
	$template->parse('show_checkbox_3',       'show_checkbox_3_block', true);
721
	$template->parse('show_php_error_level',  'show_php_error_level_block', true);
722
	$template->parse('show_charset',          'show_charset_block', true);
723
	$template->parse('show_access',           'show_access_block', true);
724
	$template->parse('show_wysiwyg',          'show_wysiwyg_block', true);
725
	$template->parse('show_search',           'show_search_block', false);
726
	$template->parse('show_redirect_timer',   'show_redirect_timer_block', true);
727
}else {
728
	$template->set_block('show_page_level_limit', '');
729
	$template->set_block('show_checkbox_1', '');
730
	$template->set_block('show_checkbox_2', '');
731
	$template->set_block('show_checkbox_3', '');
732
	$template->set_block('show_php_error_level', '');
733
	$template->set_block('show_charset', '');
734
	$template->set_block('show_access', '');
735
	$template->set_block('show_wysiwyg', '');
736
	$template->set_block('show_search', '');
737
	$template->set_block('show_redirect_timer', '');
738
}
739
740 1241 Luisehahne
// Parse template objects output
741
$template->parse('main', 'main_block', false);
742
$template->pparse('output', 'page');
743
744
$admin->print_footer();
745
746 1260 Luisehahne
?>