Project

General

Profile

1
<?php
2
/**
3
 *
4
 * @category        admin
5
 * @package         settings
6
 * @author          WebsiteBaker Project
7
 * @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
 * @version         $Id: index.php 1332 2010-04-21 09:50:17Z Luisehahne $
14
 * @filesource		$HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/admin/settings/index.php $
15
 * @lastmodified    $Date: 2010-04-21 11:50:17 +0200 (Wed, 21 Apr 2010) $
16
 *
17
 */
18

    
19
require('../../config.php');
20
require_once(WB_PATH.'/framework/class.admin.php');
21
if(isset($_GET['advanced']) AND $_GET['advanced'] == 'yes') {
22
	$admin = new admin('Settings', 'settings_advanced');
23
} else {
24
	$admin = new admin('Settings', 'settings_basic');
25
}
26

    
27
// Include the WB functions file
28
require_once(WB_PATH.'/framework/functions.php');
29
require_once(WB_PATH.'/framework/functions-utf8.php');
30

    
31
// Create new template object
32
$template = new Template(THEME_PATH.'/templates');
33
$template->set_file('page', 'settings.htt');
34
$template->set_block('page', 'main_block', 'main');
35

    
36
// Query current settings in the db, then loop through them and print them
37
$query = "SELECT * FROM ".TABLE_PREFIX."settings";
38
$results = $database->query($query);
39
while($setting = $results->fetchRow())
40
{
41
	$setting_name = $setting['name'];
42
	$setting_value = ( $setting_name != 'wbmailer_smtp_password' ) ? htmlspecialchars($setting['value']) : $setting['value'];
43
	$template->set_var(strtoupper($setting_name),$setting_value);
44
}
45

    
46
// Query current settings in the db, then loop through them and print them
47
$query = "SELECT * FROM ".TABLE_PREFIX."search WHERE extra = ''";
48
$results = $database->query($query);
49
while($setting = $results->fetchRow()) {
50
	$setting_name = $setting['name'];
51
	$setting_value = htmlspecialchars(($setting['value']));
52
	switch($setting_name) {
53
		// Search header
54
		case 'header':
55
			$template->set_var('SEARCH_HEADER', $setting_value);
56
		break;
57
		// Search results header
58
		case 'results_header':
59
			$template->set_var('SEARCH_RESULTS_HEADER', $setting_value);
60
		break;
61
		// Search results loop
62
		case 'results_loop':
63
			$template->set_var('SEARCH_RESULTS_LOOP', $setting_value);
64
		break;
65
		// Search results footer
66
		case 'results_footer':
67
			$template->set_var('SEARCH_RESULTS_FOOTER', $setting_value);
68
		break;
69
		// Search no results
70
		case 'no_results':
71
			$template->set_var('SEARCH_NO_RESULTS', $setting_value);
72
		break;
73
		// Search footer
74
		case 'footer':
75
			$template->set_var('SEARCH_FOOTER', $setting_value);
76
		break;
77
		// Search module-order
78
		case 'module_order':
79
			$template->set_var('SEARCH_MODULE_ORDER', $setting_value);
80
		break;
81
		// Search max lines of excerpt
82
		case 'max_excerpt':
83
			$template->set_var('SEARCH_MAX_EXCERPT', $setting_value);
84
		break;
85
		// time-limit
86
		case 'time_limit':
87
			$template->set_var('SEARCH_TIME_LIMIT', $setting_value);
88
		break;
89
		// Search template
90
		case 'template':
91
			$search_template = $setting_value;
92
		break;
93
	}
94
}
95

    
96
// Do the same for settings stored in config file as with ones in db
97
$database_type = '';
98

    
99
// Tell the browser whether or not to show advanced options
100
if(isset($_GET['advanced']) AND $_GET['advanced'] == 'yes') {
101
	$template->set_var('DISPLAY_ADVANCED', '');
102
	$template->set_var('ADVANCED', 'yes');
103
	$template->set_var('ADVANCED_BUTTON', '&lt;&lt; '.$TEXT['HIDE_ADVANCED']);
104
	$template->set_var('ADVANCED_LINK', 'index.php?advanced=no');
105
	$template->set_var('BASIC_FILE_PERMS_ID', 'hide');
106
	$template->set_var('ADVANCED_FILE_PERMS_ID', 'file_perms_box');
107
} else {
108
	$template->set_var('DISPLAY_ADVANCED', ' style="display: none;"');
109
	$template->set_var('ADVANCED', 'no');
110
	$template->set_var('ADVANCED_BUTTON', $TEXT['SHOW_ADVANCED'].' &gt;&gt;');
111
	$template->set_var('ADVANCED_LINK', 'index.php?advanced=yes');
112
	$template->set_var('BASIC_FILE_PERMS_ID', 'file_perms_box');
113
	$template->set_var('ADVANCED_FILE_PERMS_ID', 'hide');
114
}
115

    
116
$template->set_var(array(	
117
									'PAGES_DIRECTORY' => PAGES_DIRECTORY,
118
									'MEDIA_DIRECTORY' => MEDIA_DIRECTORY,
119
									'PAGE_EXTENSION' => PAGE_EXTENSION,
120
									'PAGE_SPACER' => PAGE_SPACER,
121
									'WB_PATH' => WB_PATH,
122
									'WB_URL' => WB_URL,
123
									'THEME_URL' => THEME_URL,
124
									'ADMIN_PATH' => ADMIN_PATH,
125
									'ADMIN_URL' => ADMIN_URL,
126
									'DATABASE_TYPE' => DB_TYPE,
127
									'DATABASE_HOST' => DB_HOST,
128
									'DATABASE_USERNAME' => DB_USERNAME,
129
									'DATABASE_NAME' => DB_NAME,
130
									'TABLE_PREFIX' => TABLE_PREFIX
131
								 )
132
						 );
133

    
134
// Insert language values
135
$template->set_block('main_block', 'language_list_block', 'language_list');
136
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'language' ORDER BY name");
137
if($result->numRows() > 0) {
138
	while($addon = $result->fetchRow()) {
139
		$l_codes[$addon['name']] = $addon['directory'];
140
		$l_names[$addon['name']] = entities_to_7bit($addon['name']); // sorting-problem workaround
141
	}
142
	asort($l_names);
143
	foreach($l_names as $l_name=>$v) {
144
		// Insert code and name
145
		$template->set_var(array(
146
								'CODE' => $l_codes[$l_name],
147
								'NAME' => $l_name,
148
								'FLAG' => THEME_URL.'/images/flags/'.strtolower($l_codes[$l_name]),
149
								));
150
		// Check if it is selected
151
		if(DEFAULT_LANGUAGE == $l_codes[$l_name]) {
152
			$template->set_var('SELECTED', ' selected="selected"');
153
		} else {
154
			$template->set_var('SELECTED', '');
155
		}
156
		$template->parse('language_list', 'language_list_block', true);
157
	}
158
}
159

    
160
// Insert default timezone values
161
require(ADMIN_PATH.'/interface/timezones.php');
162
$template->set_block('main_block', 'timezone_list_block', 'timezone_list');
163
foreach($TIMEZONES AS $hour_offset => $title) {
164
	// Make sure we dont list "System Default" as we are setting this value!
165
	if($hour_offset != '-20') {
166
		$template->set_var('VALUE', $hour_offset);
167
		$template->set_var('NAME', $title);
168
		if(DEFAULT_TIMEZONE == $hour_offset*60*60) {
169
			$template->set_var('SELECTED', ' selected="selected"');
170
		} else {
171
			$template->set_var('SELECTED', '');
172
		}
173
		$template->parse('timezone_list', 'timezone_list_block', true);
174
	}
175
}
176

    
177
// Insert default charset values
178
require(ADMIN_PATH.'/interface/charsets.php');
179
$template->set_block('main_block', 'charset_list_block', 'charset_list');
180
foreach($CHARSETS AS $code => $title) {
181
	$template->set_var('VALUE', $code);
182
	$template->set_var('NAME', $title);
183
	if(DEFAULT_CHARSET == $code) {
184
		$template->set_var('SELECTED', ' selected="selected"');
185
	} else {
186
		$template->set_var('SELECTED', '');
187
	}
188
	$template->parse('charset_list', 'charset_list_block', true);
189
}
190

    
191
// Insert date format list
192
require(ADMIN_PATH.'/interface/date_formats.php');
193
$template->set_block('main_block', 'date_format_list_block', 'date_format_list');
194
foreach($DATE_FORMATS AS $format => $title) {
195
	$format = str_replace('|', ' ', $format); // Add's white-spaces (not able to be stored in array key)
196
	if($format != 'system_default') {
197
		$template->set_var('VALUE', $format);
198
	} else {
199
		$template->set_var('VALUE', '');
200
	}
201
	$template->set_var('NAME', $title);
202
	if(DEFAULT_DATE_FORMAT == $format) {
203
		$template->set_var('SELECTED', ' selected="selected"');
204
	} else {
205
		$template->set_var('SELECTED', '');
206
	}
207
	$template->parse('date_format_list', 'date_format_list_block', true);
208
}
209

    
210
// Insert time format list
211
require(ADMIN_PATH.'/interface/time_formats.php');
212
$template->set_block('main_block', 'time_format_list_block', 'time_format_list');
213
foreach($TIME_FORMATS AS $format => $title) {
214
	$format = str_replace('|', ' ', $format); // Add's white-spaces (not able to be stored in array key)
215
	if($format != 'system_default') {
216
		$template->set_var('VALUE', $format);
217
	} else {
218
		$template->set_var('VALUE', '');
219
	}
220
	$template->set_var('NAME', $title);
221
	if(DEFAULT_TIME_FORMAT == $format) {
222
		$template->set_var('SELECTED', ' selected="selected"');
223
	} else {
224
		$template->set_var('SELECTED', '');
225
	}
226
	$template->parse('time_format_list', 'time_format_list_block', true);
227
}
228

    
229
// Insert templates
230
$template->set_block('main_block', 'template_list_block', 'template_list');
231
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'template' AND function != 'theme' ORDER BY name");
232
if($result->numRows() > 0) {
233
	while($addon = $result->fetchRow()) {
234
		$template->set_var('FILE', $addon['directory']);
235
		$template->set_var('NAME', $addon['name']);
236
		if(($addon['directory'] == DEFAULT_TEMPLATE) ? $selected = ' selected="selected"' : $selected = '');
237
		$template->set_var('SELECTED', $selected);
238
		$template->parse('template_list', 'template_list_block', true);
239
	}
240
}
241

    
242
// Insert backend theme
243
$template->set_block('main_block', 'theme_list_block', 'theme_list');
244
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'template' AND function = 'theme' ORDER BY name");
245
if($result->numRows() > 0) {
246
	while($addon = $result->fetchRow()) {
247
		$template->set_var('FILE', $addon['directory']);
248
		$template->set_var('NAME', $addon['name']);
249
		if(($addon['directory'] == DEFAULT_THEME) ? $selected = ' selected="selected"' : $selected = '');
250
		$template->set_var('SELECTED', $selected);
251
		$template->parse('theme_list', 'theme_list_block', true);
252
	}
253
}
254

    
255
// Insert WYSIWYG modules
256
$template->set_block('main_block', 'editor_list_block', 'editor_list');
257
$file='none';
258
$module_name=$TEXT['NONE'];  
259
$template->set_var('FILE', $file);  
260
$template->set_var('NAME', $module_name);  
261
if((!defined('WYSIWYG_EDITOR') || $file == WYSIWYG_EDITOR) ? $selected = ' selected="selected"' : $selected = '');
262
$template->set_var('SELECTED', $selected);
263
$template->parse('editor_list', 'editor_list_block', true);  
264
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'module' AND function = 'wysiwyg' ORDER BY name");
265
if($result->numRows() > 0)
266
{
267
	while($addon = $result->fetchRow())
268
    {
269
		$template->set_var('FILE', $addon['directory']);
270
		$template->set_var('NAME', $addon['name']);
271
		if((defined('WYSIWYG_EDITOR') AND $addon['directory'] == WYSIWYG_EDITOR) ? $selected = ' selected="selected"' : $selected = '');
272
		$template->set_var('SELECTED', $selected);
273
		$template->parse('editor_list', 'editor_list_block', true);
274
	}
275
}
276

    
277
// Insert templates for search settings
278
$template->set_block('main_block', 'search_template_list_block', 'search_template_list');
279

    
280
$search_template = ( ($search_template == DEFAULT_TEMPLATE) OR ($search_template == '') ) ? '' : $search_template;
281

    
282
$selected = ( ($search_template != DEFAULT_TEMPLATE) ) ?  ' selected="selected"' : $selected = '';
283

    
284
$template->set_var(array(
285
        'FILE' => '',
286
        'NAME' => $TEXT['SYSTEM_DEFAULT'],
287
        'SELECTED' => $selected
288
    ));
289

    
290
$template->parse('search_template_list', 'search_template_list_block', true);
291
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'template' AND function = 'template' ORDER BY name");
292

    
293
if($result->numRows() > 0)
294
{
295
	while($addon = $result->fetchRow())
296
    {
297
		$template->set_var('FILE', $addon['directory']);
298
		$template->set_var('NAME', $addon['name']);
299
        $selected = ($addon['directory'] == $search_template) ? ' selected="selected"' :  $selected = '';
300
		$template->set_var('SELECTED', $selected);
301

    
302
		$template->parse('search_template_list', 'search_template_list_block', true);
303
	}
304
}
305

    
306
// Insert default error reporting values
307
require(ADMIN_PATH.'/interface/er_levels.php');
308
$template->set_block('main_block', 'error_reporting_list_block', 'error_reporting_list');
309
foreach($ER_LEVELS AS $value => $title)
310
{
311
	$template->set_var('VALUE', $value);
312
	$template->set_var('NAME', $title);
313
    $selected = (ER_LEVEL == $value) ? ' selected="selected"' : '';
314
    $template->set_var('SELECTED', $selected);
315

    
316
	$template->parse('error_reporting_list', 'error_reporting_list_block', true);
317
}
318

    
319
// Insert permissions values
320
if($admin->get_permission('settings_advanced') != true)
321
{
322
	$template->set_var('DISPLAY_ADVANCED_BUTTON', 'hide');
323
}
324

    
325
// Insert page level limits
326
$template->set_block('main_block', 'page_level_limit_list_block', 'page_level_limit_list');
327
for($i = 1; $i <= 10; $i++)
328
{
329
	$template->set_var('NUMBER', $i);
330
	if(PAGE_LEVEL_LIMIT == $i)
331
    {
332
		$template->set_var('SELECTED', ' selected="selected"');
333
	} else {
334
		$template->set_var('SELECTED', '');
335
	}
336
	$template->parse('page_level_limit_list', 'page_level_limit_list_block', true);
337
}
338

    
339
// Work-out if multiple menus feature is enabled
340
if(defined('MULTIPLE_MENUS') AND MULTIPLE_MENUS == true)
341
{
342
	$template->set_var('MULTIPLE_MENUS_ENABLED', ' checked="checked"');
343
} else {
344
	$template->set_var('MULTIPLE_MENUS_DISABLED', ' checked="checked"');
345
}
346

    
347
// Work-out if page languages feature is enabled
348
if(defined('PAGE_LANGUAGES') AND PAGE_LANGUAGES == true)
349
{
350
        $template->set_var('PAGE_LANGUAGES_ENABLED', ' checked="checked"');
351
} else {
352
        $template->set_var('PAGE_LANGUAGES_DISABLED', ' checked="checked"');
353
}
354

    
355
// Work-out if smart login feature is enabled
356
if(defined('SMART_LOGIN') AND SMART_LOGIN == true)
357
{
358
	$template->set_var('SMART_LOGIN_ENABLED', ' checked="checked"');
359
} else {
360
	$template->set_var('SMART_LOGIN_DISABLED', ' checked="checked"');
361
}
362

    
363
/* Make's sure GD library is installed */
364
if(extension_loaded('gd') AND function_exists('imageCreateFromJpeg'))
365
{
366
	$template->set_var('GD_EXTENSION_ENABLED', '');
367
} else {
368
	$template->set_var('GD_EXTENSION_ENABLED', ' style="display: none;"');
369
}
370

    
371
// Work-out if section blocks feature is enabled
372
if(defined('SECTION_BLOCKS') AND SECTION_BLOCKS == true)
373
{
374
	$template->set_var('SECTION_BLOCKS_ENABLED', ' checked="checked"');
375
} else {
376
	$template->set_var('SECTION_BLOCKS_DISABLED', ' checked="checked"');
377
}
378

    
379
// Work-out if homepage redirection feature is enabled
380
if(defined('HOMEPAGE_REDIRECTION') AND HOMEPAGE_REDIRECTION == true)
381
{
382
	$template->set_var('HOMEPAGE_REDIRECTION_ENABLED', ' checked="checked"');
383
} else {
384
	$template->set_var('HOMEPAGE_REDIRECTION_DISABLED', ' checked="checked"');
385
}
386

    
387
// Work-out which server os should be checked
388
if(OPERATING_SYSTEM == 'linux')
389
{
390
	$template->set_var('LINUX_SELECTED', ' checked="checked"');
391
} elseif(OPERATING_SYSTEM == 'windows') {
392
	$template->set_var('WINDOWS_SELECTED', ' checked="checked"');
393
}
394

    
395
// Work-out if manage sections feature is enabled
396
if(MANAGE_SECTIONS)
397
{
398
	$template->set_var('MANAGE_SECTIONS_ENABLED', ' checked="checked"');
399
} else {
400
	$template->set_var('MANAGE_SECTIONS_DISABLED', ' checked="checked"');
401
}
402

    
403
// Work-out which wbmailer routine should be checked
404
if(WBMAILER_ROUTINE == 'phpmail')
405
{
406
	$template->set_var('PHPMAIL_SELECTED', ' checked="checked"');
407
	$template->set_var('SMTP_VISIBILITY', ' style="display: none;"');
408
	$template->set_var('SMTP_VISIBILITY_AUTH', ' style="display: none;"');
409
} elseif(WBMAILER_ROUTINE == 'smtp')
410
{
411
	$template->set_var('SMTPMAIL_SELECTED', ' checked="checked"');
412
	$template->set_var('SMTP_VISIBILITY', '');
413
}
414

    
415
// Work-out if SMTP authentification should be checked
416
if(WBMAILER_SMTP_AUTH)
417
{
418
	$template->set_var('SMTP_AUTH_SELECTED', ' checked="checked"');
419
	if(WBMAILER_ROUTINE == 'smtp')
420
    {
421
		$template->set_var('SMTP_VISIBILITY_AUTH', '');
422
	} else {
423
		$template->set_var('SMTP_VISIBILITY_AUTH', ' style="display: none;"');
424
	}
425
} else {
426
	$template->set_var('SMTP_VISIBILITY_AUTH', ' style="display: none;"');
427
}
428

    
429
// Work-out if intro feature is enabled
430
if(INTRO_PAGE)
431
{
432
	$template->set_var('INTRO_PAGE_ENABLED', ' checked="checked"');
433
} else {
434
	$template->set_var('INTRO_PAGE_DISABLED', ' checked="checked"');
435
}
436

    
437
// Work-out if frontend login feature is enabled
438
if(FRONTEND_LOGIN)
439
{
440
	$template->set_var('PRIVATE_ENABLED', ' checked="checked"');
441
} else {
442
	$template->set_var('PRIVATE_DISABLED', ' checked="checked"');
443
}
444

    
445
// Work-out if page trash feature is disabled, in-line, or separate
446
if(PAGE_TRASH == 'disabled')
447
{
448
	$template->set_var('PAGE_TRASH_DISABLED', ' checked="checked"');
449
	$template->set_var('DISPLAY_PAGE_TRASH_SEPARATE', 'display: none;');
450
} elseif(PAGE_TRASH == 'inline')
451
{
452
	$template->set_var('PAGE_TRASH_INLINE', ' checked="checked"');
453
	$template->set_var('DISPLAY_PAGE_TRASH_SEPARATE', 'display: none;');
454
} elseif(PAGE_TRASH == 'separate')
455
{
456
	$template->set_var('PAGE_TRASH_SEPARATE', ' checked="checked"');
457
	$template->set_var('DISPLAY_PAGE_TRASH_SEPARATE', 'display: inline;');
458
}
459

    
460
// Work-out if media home folde feature is enabled
461
if(HOME_FOLDERS)
462
{
463
	$template->set_var('HOME_FOLDERS_ENABLED', ' checked="checked"');
464
} else {
465
	$template->set_var('HOME_FOLDERS_DISABLED', ' checked="checked"');
466
}
467

    
468
// Insert search select
469
if(SEARCH == 'private')
470
{
471
	$template->set_var('PRIVATE_SEARCH', ' selected="selected"');
472
} elseif(SEARCH == 'registered') {
473
	$template->set_var('REGISTERED_SEARCH', ' selected="selected"');
474
} elseif(SEARCH == 'none') {
475
	$template->set_var('NONE_SEARCH', ' selected="selected"');
476
}
477

    
478
// Work-out if 777 permissions are set
479
if(STRING_FILE_MODE == '0777' AND STRING_DIR_MODE == '0777')
480
{
481
	$template->set_var('WORLD_WRITEABLE_SELECTED', ' checked="checked"');
482
}
483

    
484
// Work-out which file mode boxes are checked
485
if(extract_permission(STRING_FILE_MODE, 'u', 'r'))
486
{
487
	$template->set_var('FILE_U_R_CHECKED', ' checked="checked"');
488
}
489
if(extract_permission(STRING_FILE_MODE, 'u', 'w'))
490
{
491
	$template->set_var('FILE_U_W_CHECKED', ' checked="checked"');
492
}
493
if(extract_permission(STRING_FILE_MODE, 'u', 'e'))
494
{
495
	$template->set_var('FILE_U_E_CHECKED', ' checked="checked"');
496
}
497
if(extract_permission(STRING_FILE_MODE, 'g', 'r'))
498
{
499
	$template->set_var('FILE_G_R_CHECKED', ' checked="checked"');
500
}
501
if(extract_permission(STRING_FILE_MODE, 'g', 'w'))
502
{
503
	$template->set_var('FILE_G_W_CHECKED', ' checked="checked"');
504
}
505
if(extract_permission(STRING_FILE_MODE, 'g', 'e'))
506
{
507
	$template->set_var('FILE_G_E_CHECKED', ' checked="checked"');
508
}
509
if(extract_permission(STRING_FILE_MODE, 'o', 'r'))
510
{
511
	$template->set_var('FILE_O_R_CHECKED', ' checked="checked"');
512
}
513
if(extract_permission(STRING_FILE_MODE, 'o', 'w'))
514
{
515
	$template->set_var('FILE_O_W_CHECKED', ' checked="checked"');
516
}
517
if(extract_permission(STRING_FILE_MODE, 'o', 'e'))
518
{
519
	$template->set_var('FILE_O_E_CHECKED', ' checked="checked"');
520
}
521
// Work-out which dir mode boxes are checked
522
if(extract_permission(STRING_DIR_MODE, 'u', 'r'))
523
{
524
	$template->set_var('DIR_U_R_CHECKED', ' checked="checked"');
525
}
526
if(extract_permission(STRING_DIR_MODE, 'u', 'w'))
527
{
528
	$template->set_var('DIR_U_W_CHECKED', ' checked="checked"');
529
}
530
if(extract_permission(STRING_DIR_MODE, 'u', 'e'))
531
{
532
	$template->set_var('DIR_U_E_CHECKED', ' checked="checked"');
533
}
534
if(extract_permission(STRING_DIR_MODE, 'g', 'r'))
535
{
536
	$template->set_var('DIR_G_R_CHECKED', ' checked="checked"');
537
}
538
if(extract_permission(STRING_DIR_MODE, 'g', 'w'))
539
{
540
	$template->set_var('DIR_G_W_CHECKED', ' checked="checked"');
541
}
542
if(extract_permission(STRING_DIR_MODE, 'g', 'e'))
543
{
544
	$template->set_var('DIR_G_E_CHECKED', ' checked="checked"');
545
}
546
if(extract_permission(STRING_DIR_MODE, 'o', 'r'))
547
{
548
	$template->set_var('DIR_O_R_CHECKED', ' checked="checked"');
549
}
550
if(extract_permission(STRING_DIR_MODE, 'o', 'w'))
551
{
552
	$template->set_var('DIR_O_W_CHECKED', ' checked="checked"');
553
}
554
if(extract_permission(STRING_DIR_MODE, 'o', 'e'))
555
{
556
	$template->set_var('DIR_O_E_CHECKED', ' checked="checked"');
557
}
558

    
559
// Insert Server Email value into template
560
$template->set_var('SERVER_EMAIL', SERVER_EMAIL);
561

    
562
// Insert groups into signup list
563
$template->set_block('main_block', 'group_list_block', 'group_list');
564
$results = $database->query("SELECT group_id, name FROM ".TABLE_PREFIX."groups WHERE group_id != '1'");
565
if($results->numRows() > 0)
566
{
567
	while($group = $results->fetchRow())
568
    {
569
		$template->set_var('ID', $group['group_id']);
570
		$template->set_var('NAME', $group['name']);
571
		if(FRONTEND_SIGNUP == $group['group_id'])
572
        {
573
			$template->set_var('SELECTED', ' selected="selected"');
574
		} else {
575
			$template->set_var('SELECTED', '');
576
		}
577
		$template->parse('group_list', 'group_list_block', true);
578
	}
579
} else {
580
	$template->set_var('ID', 'disabled');
581
	$template->set_var('NAME', $MESSAGE['GROUPS']['NO_GROUPS_FOUND']);
582
	$template->parse('group_list', 'group_list_block', true);
583
}
584

    
585
// Insert language headings
586
$template->set_var(array(
587
								'HEADING_GENERAL_SETTINGS' => $HEADING['GENERAL_SETTINGS'],
588
								'HEADING_DEFAULT_SETTINGS' => $HEADING['DEFAULT_SETTINGS'],
589
								'HEADING_SEARCH_SETTINGS' => $HEADING['SEARCH_SETTINGS'],
590
								'HEADING_SERVER_SETTINGS' => $HEADING['SERVER_SETTINGS'],
591
								'HEADING_WBMAILER_SETTINGS' => $HEADING['WBMAILER_SETTINGS'],
592
								'HEADING_ADMINISTRATION_TOOLS' => $HEADING['ADMINISTRATION_TOOLS']
593
								)
594
						);
595
// Insert language text and messages
596
$template->set_var(array(
597
								'TEXT_WEBSITE_TITLE' => $TEXT['WEBSITE_TITLE'],
598
								'TEXT_WEBSITE_DESCRIPTION' => $TEXT['WEBSITE_DESCRIPTION'],
599
								'TEXT_WEBSITE_KEYWORDS' => $TEXT['WEBSITE_KEYWORDS'],
600
								'TEXT_WEBSITE_HEADER' => $TEXT['WEBSITE_HEADER'],
601
								'TEXT_WEBSITE_FOOTER' => $TEXT['WEBSITE_FOOTER'],
602
								'TEXT_HEADER' => $TEXT['HEADER'],
603
								'TEXT_FOOTER' => $TEXT['FOOTER'],
604
								'TEXT_VISIBILITY' => $TEXT['VISIBILITY'],
605
								'TEXT_RESULTS_HEADER' => $TEXT['RESULTS_HEADER'],
606
								'TEXT_RESULTS_LOOP' => $TEXT['RESULTS_LOOP'],
607
								'TEXT_RESULTS_FOOTER' => $TEXT['RESULTS_FOOTER'],
608
								'TEXT_NO_RESULTS' => $TEXT['NO_RESULTS'],
609
								'TEXT_TEXT' => $TEXT['TEXT'],
610
								'TEXT_DEFAULT' => $TEXT['DEFAULT'],
611
								'TEXT_LANGUAGE' => $TEXT['LANGUAGE'],
612
								'TEXT_TIMEZONE' => $TEXT['TIMEZONE'],
613
								'TEXT_CHARSET' => $TEXT['CHARSET'],
614
								'TEXT_DATE_FORMAT' => $TEXT['DATE_FORMAT'],
615
								'TEXT_TIME_FORMAT' => $TEXT['TIME_FORMAT'],
616
								'TEXT_TEMPLATE' => $TEXT['TEMPLATE'],
617
								'TEXT_THEME' => $TEXT['THEME'],
618
								'TEXT_WYSIWYG_EDITOR' => $TEXT['WYSIWYG_EDITOR'],
619
								'TEXT_PAGE_LEVEL_LIMIT' => $TEXT['PAGE_LEVEL_LIMIT'],
620
								'TEXT_INTRO_PAGE' => $TEXT['INTRO_PAGE'],
621
								'TEXT_FRONTEND' => $TEXT['FRONTEND'],
622
								'TEXT_LOGIN' => $TEXT['LOGIN'],
623
								'TEXT_REDIRECT_AFTER' => $TEXT['REDIRECT_AFTER'],
624
								'TEXT_SIGNUP' => $TEXT['SIGNUP'],
625
								'TEXT_PHP_ERROR_LEVEL' => $TEXT['PHP_ERROR_LEVEL'],
626
								'TEXT_PAGES_DIRECTORY' => $TEXT['PAGES_DIRECTORY'],
627
								'TEXT_MEDIA_DIRECTORY' => $TEXT['MEDIA_DIRECTORY'],
628
								'TEXT_PAGE_EXTENSION' => $TEXT['PAGE_EXTENSION'],
629
								'TEXT_PAGE_SPACER' => $TEXT['PAGE_SPACER'],
630
								'TEXT_RENAME_FILES_ON_UPLOAD' => $TEXT['RENAME_FILES_ON_UPLOAD'],
631
								'TEXT_APP_NAME' => $TEXT['APP_NAME'],
632
								'TEXT_SESSION_IDENTIFIER' => $TEXT['SESSION_IDENTIFIER'],
633
								'TEXT_SEC_ANCHOR' => $TEXT['SEC_ANCHOR'],
634
								'TEXT_SERVER_OPERATING_SYSTEM' => $TEXT['SERVER_OPERATING_SYSTEM'],
635
								'TEXT_LINUX_UNIX_BASED' => $TEXT['LINUX_UNIX_BASED'],
636
								'TEXT_WINDOWS' => $TEXT['WINDOWS'],
637
								'TEXT_ADMIN' => $TEXT['ADMIN'],
638
								'TEXT_TYPE' => $TEXT['TYPE'],
639
								'TEXT_DATABASE' => $TEXT['DATABASE'],
640
								'TEXT_HOST' => $TEXT['HOST'],
641
								'TEXT_USERNAME' => $TEXT['USERNAME'],
642
								'TEXT_PASSWORD' => $TEXT['PASSWORD'],
643
								'TEXT_NAME' => $TEXT['NAME'],
644
								'TEXT_TABLE_PREFIX' => $TEXT['TABLE_PREFIX'],
645
								'TEXT_SAVE' => $TEXT['SAVE'],
646
								'TEXT_RESET' => $TEXT['RESET'],
647
								'TEXT_CHANGES' => $TEXT['CHANGES'],
648
								'TEXT_ENABLED' => $TEXT['ENABLED'],
649
								'TEXT_DISABLED' => $TEXT['DISABLED'],
650
								'TEXT_MANAGE_SECTIONS' => $HEADING['MANAGE_SECTIONS'],
651
								'TEXT_MANAGE' => $TEXT['MANAGE'],
652
								'TEXT_SEARCH' => $TEXT['SEARCH'],
653
								'TEXT_PUBLIC' => $TEXT['PUBLIC'],
654
								'TEXT_PRIVATE' => $TEXT['PRIVATE'],
655
								'TEXT_REGISTERED' => $TEXT['REGISTERED'],
656
								'TEXT_NONE' => $TEXT['NONE'],
657
								'TEXT_FILES' => strtoupper(substr($TEXT['FILES'], 0, 1)).substr($TEXT['FILES'], 1),
658
								'TEXT_DIRECTORIES' => $TEXT['DIRECTORIES'],
659
								'TEXT_FILESYSTEM_PERMISSIONS' => $TEXT['FILESYSTEM_PERMISSIONS'],
660
								'TEXT_USER' => $TEXT['USER'],
661
								'TEXT_GROUP' => $TEXT['GROUP'],
662
								'TEXT_OTHERS' => $TEXT['OTHERS'],
663
								'TEXT_READ' => $TEXT['READ'],
664
								'TEXT_WRITE' => $TEXT['WRITE'],
665
								'TEXT_EXECUTE' => $TEXT['EXECUTE'],
666
								'TEXT_SMART_LOGIN' => $TEXT['SMART_LOGIN'],
667
								'TEXT_MULTIPLE_MENUS' => $TEXT['MULTIPLE_MENUS'],
668
								'TEXT_HOMEPAGE_REDIRECTION' => $TEXT['HOMEPAGE_REDIRECTION'],
669
								'TEXT_SECTION_BLOCKS' => $TEXT['SECTION_BLOCKS'],
670
								'TEXT_PLEASE_SELECT' => $TEXT['PLEASE_SELECT'],
671
								'TEXT_PAGE_TRASH' => $TEXT['PAGE_TRASH'],
672
								'TEXT_PAGE_LANGUAGES' => $TEXT['PAGE_LANGUAGES'],
673
								'TEXT_INLINE' => $TEXT['INLINE'],
674
								'TEXT_SEPARATE' => $TEXT['SEPARATE'],
675
								'TEXT_HOME_FOLDERS' => $TEXT['HOME_FOLDERS'],
676
								'TEXT_WYSIWYG_STYLE' => $TEXT['WYSIWYG_STYLE'],
677
								'TEXT_WORLD_WRITEABLE_FILE_PERMISSIONS' => $TEXT['WORLD_WRITEABLE_FILE_PERMISSIONS'],
678
								'TEXT_WBMAILER_DEFAULT_SETTINGS_NOTICE' => $TEXT['WBMAILER_DEFAULT_SETTINGS_NOTICE'],
679
								'TEXT_WBMAILER_DEFAULT_SENDER_MAIL' => $TEXT['WBMAILER_DEFAULT_SENDER_MAIL'],
680
								'TEXT_WBMAILER_DEFAULT_SENDER_NAME' => $TEXT['WBMAILER_DEFAULT_SENDER_NAME'],
681
								'TEXT_WBMAILER_NOTICE' => $TEXT['WBMAILER_NOTICE'],
682
								'TEXT_WBMAILER_FUNCTION' => $TEXT['WBMAILER_FUNCTION'],
683
								'TEXT_WBMAILER_SMTP_HOST' => $TEXT['WBMAILER_SMTP_HOST'],
684
								'TEXT_WBMAILER_PHP' => $TEXT['WBMAILER_PHP'],
685
								'TEXT_WBMAILER_SMTP' => $TEXT['WBMAILER_SMTP'],
686
								'TEXT_WBMAILER_SMTP_AUTH' => $TEXT['WBMAILER_SMTP_AUTH'],
687
								'TEXT_WBMAILER_SMTP_AUTH_NOTICE' => $TEXT['WBMAILER_SMTP_AUTH_NOTICE'],
688
								'TEXT_WBMAILER_SMTP_USERNAME' => $TEXT['WBMAILER_SMTP_USERNAME'],
689
								'TEXT_WBMAILER_SMTP_PASSWORD' => $TEXT['WBMAILER_SMTP_PASSWORD'],
690
								'MODE_SWITCH_WARNING' => $MESSAGE['SETTINGS']['MODE_SWITCH_WARNING'],
691
								'WORLD_WRITEABLE_WARNING' => $MESSAGE['SETTINGS']['WORLD_WRITEABLE_WARNING'],
692
								'TEXT_MODULE_ORDER' => $TEXT['MODULE_ORDER'],
693
								'TEXT_MAX_EXCERPT' => $TEXT['MAX_EXCERPT'],
694
								'TEXT_TIME_LIMIT' => $TEXT['TIME_LIMIT']
695
								)
696
						);
697

    
698
// Parse template objects output
699
$template->parse('main', 'main_block', false);
700
$template->pparse('output', 'page');
701

    
702
$admin->print_footer();
703

    
704
?>
(1-1/3)