Project

General

Profile

1
<?php
2
/****************************************************************************
3
* SVN Version information:
4
*
5
* $Id: index.php 1241 2010-01-12 17:14:06Z Luisehahne $
6
*
7
*****************************************************************************
8
*                          WebsiteBaker
9
*
10
* WebsiteBaker Project <http://www.websitebaker2.org/>
11
* Copyright (C) 2009, Website Baker Org. e.V.
12
*         http://start.websitebaker2.org/impressum-datenschutz.php
13
* Copyright (C) 2004-2009, Ryan Djurovich
14
*
15
*                        About WebsiteBaker
16
*
17
* Website Baker is a PHP-based Content Management System (CMS)
18
* designed with one goal in mind: to enable its users to produce websites
19
* with ease.
20
*
21
*****************************************************************************
22
*
23
*****************************************************************************
24
*                        LICENSE INFORMATION
25
*
26
* WebsiteBaker is free software; you can redistribute it and/or
27
* modify it under the terms of the GNU General Public License
28
* as published by the Free Software Foundation; either version 2
29
* of the License, or (at your option) any later version.
30
*
31
* WebsiteBaker is distributed in the hope that it will be useful,
32
* but WITHOUT ANY WARRANTY; without even the implied warranty of
33
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
34
* See the GNU General Public License for more details.
35
*
36
* You should have received a copy of the GNU General Public License
37
* along with this program; if not, write to the Free Software
38
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
39
****************************************************************************
40
*
41
*                   WebsiteBaker Extra Information
42
*
43
*
44
*
45
*
46
*****************************************************************************/
47
/**
48
 *
49
 * @category     admin
50
 * @package      settings
51
 * @author       Ryan Djurovich
52
 * @copyright    2004-2009, Ryan Djurovich
53
 * @copyright    2009-2010, Website Baker Org. e.V.
54
 * @version      $Id: index.php 1241 2010-01-12 17:14:06Z Luisehahne $
55
 * @platform     WebsiteBaker 2.8.x
56
 * @requirements >= PHP 4.3.4
57
 * @license      http://www.gnu.org/licenses/gpl.html
58
 *
59
 */
60

    
61
require('../../config.php');
62
require_once(WB_PATH.'/framework/class.admin.php');
63
if(isset($_GET['advanced']) AND $_GET['advanced'] == 'yes') {
64
	$admin = new admin('Settings', 'settings_advanced');
65
} else {
66
	$admin = new admin('Settings', 'settings_basic');
67
}
68

    
69
// Include the WB functions file
70
require_once(WB_PATH.'/framework/functions.php');
71
require_once(WB_PATH.'/framework/functions-utf8.php');
72

    
73
// Create new template object
74
$template = new Template(THEME_PATH.'/templates');
75
$template->set_file('page', 'settings.htt');
76
$template->set_block('page', 'main_block', 'main');
77

    
78
// Query current settings in the db, then loop through them and print them
79
$query = "SELECT * FROM ".TABLE_PREFIX."settings";
80
$results = $database->query($query);
81
while($setting = $results->fetchRow())
82
{
83
	$setting_name = $setting['name'];
84
	$setting_value = ( $setting_name != 'wbmailer_smtp_password' ) ? htmlspecialchars($setting['value']) : $setting['value'];
85
	$template->set_var(strtoupper($setting_name),$setting_value);
86
}
87

    
88
// Query current settings in the db, then loop through them and print them
89
$query = "SELECT * FROM ".TABLE_PREFIX."search WHERE extra = ''";
90
$results = $database->query($query);
91
while($setting = $results->fetchRow()) {
92
	$setting_name = $setting['name'];
93
	$setting_value = htmlspecialchars(($setting['value']));
94
	switch($setting_name) {
95
		// Search header
96
		case 'header':
97
			$template->set_var('SEARCH_HEADER', $setting_value);
98
		break;
99
		// Search results header
100
		case 'results_header':
101
			$template->set_var('SEARCH_RESULTS_HEADER', $setting_value);
102
		break;
103
		// Search results loop
104
		case 'results_loop':
105
			$template->set_var('SEARCH_RESULTS_LOOP', $setting_value);
106
		break;
107
		// Search results footer
108
		case 'results_footer':
109
			$template->set_var('SEARCH_RESULTS_FOOTER', $setting_value);
110
		break;
111
		// Search no results
112
		case 'no_results':
113
			$template->set_var('SEARCH_NO_RESULTS', $setting_value);
114
		break;
115
		// Search footer
116
		case 'footer':
117
			$template->set_var('SEARCH_FOOTER', $setting_value);
118
		break;
119
		// Search module-order
120
		case 'module_order':
121
			$template->set_var('SEARCH_MODULE_ORDER', $setting_value);
122
		break;
123
		// Search max lines of excerpt
124
		case 'max_excerpt':
125
			$template->set_var('SEARCH_MAX_EXCERPT', $setting_value);
126
		break;
127
		// time-limit
128
		case 'time_limit':
129
			$template->set_var('SEARCH_TIME_LIMIT', $setting_value);
130
		break;
131
		// Search template
132
		case 'template':
133
			$search_template = $setting_value;
134
		break;
135
	}
136
}
137

    
138
// Do the same for settings stored in config file as with ones in db
139
$database_type = '';
140

    
141
// Tell the browser whether or not to show advanced options
142
if(isset($_GET['advanced']) AND $_GET['advanced'] == 'yes') {
143
	$template->set_var('DISPLAY_ADVANCED', '');
144
	$template->set_var('ADVANCED', 'yes');
145
	$template->set_var('ADVANCED_BUTTON', '&lt;&lt; '.$TEXT['HIDE_ADVANCED']);
146
	$template->set_var('ADVANCED_LINK', 'index.php?advanced=no');
147
	$template->set_var('BASIC_FILE_PERMS_ID', 'hide');
148
	$template->set_var('ADVANCED_FILE_PERMS_ID', 'file_perms_box');
149
} else {
150
	$template->set_var('DISPLAY_ADVANCED', ' style="display: none;"');
151
	$template->set_var('ADVANCED', 'no');
152
	$template->set_var('ADVANCED_BUTTON', $TEXT['SHOW_ADVANCED'].' &gt;&gt;');
153
	$template->set_var('ADVANCED_LINK', 'index.php?advanced=yes');
154
	$template->set_var('BASIC_FILE_PERMS_ID', 'file_perms_box');
155
	$template->set_var('ADVANCED_FILE_PERMS_ID', 'hide');
156
}
157

    
158
$template->set_var(array(	
159
									'PAGES_DIRECTORY' => PAGES_DIRECTORY,
160
									'MEDIA_DIRECTORY' => MEDIA_DIRECTORY,
161
									'PAGE_EXTENSION' => PAGE_EXTENSION,
162
									'PAGE_SPACER' => PAGE_SPACER,
163
									'WB_PATH' => WB_PATH,
164
									'WB_URL' => WB_URL,
165
									'THEME_URL' => THEME_URL,
166
									'ADMIN_PATH' => ADMIN_PATH,
167
									'ADMIN_URL' => ADMIN_URL,
168
									'DATABASE_TYPE' => DB_TYPE,
169
									'DATABASE_HOST' => DB_HOST,
170
									'DATABASE_USERNAME' => DB_USERNAME,
171
									'DATABASE_NAME' => DB_NAME,
172
									'TABLE_PREFIX' => TABLE_PREFIX
173
								 )
174
						 );
175

    
176
// Insert language values
177
$template->set_block('main_block', 'language_list_block', 'language_list');
178
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'language' order by name");
179
if($result->numRows() > 0) {
180
	while($addon = $result->fetchRow()) {
181
		$l_codes[$addon['name']] = $addon['directory'];
182
		$l_names[$addon['name']] = entities_to_7bit($addon['name']); // sorting-problem workaround
183
	}
184
	asort($l_names);
185
	foreach($l_names as $l_name=>$v) {
186
		// Insert code and name
187
		$template->set_var(array(
188
								'CODE' => $l_codes[$l_name],
189
								'NAME' => $l_name,
190
								'FLAG' => THEME_URL.'/images/flags/'.strtolower($l_codes[$l_name]),
191
								));
192
		// Check if it is selected
193
		if(DEFAULT_LANGUAGE == $l_codes[$l_name]) {
194
			$template->set_var('SELECTED', ' selected="selected"');
195
		} else {
196
			$template->set_var('SELECTED', '');
197
		}
198
		$template->parse('language_list', 'language_list_block', true);
199
	}
200
}
201

    
202
// Insert default timezone values
203
require(ADMIN_PATH.'/interface/timezones.php');
204
$template->set_block('main_block', 'timezone_list_block', 'timezone_list');
205
foreach($TIMEZONES AS $hour_offset => $title) {
206
	// Make sure we dont list "System Default" as we are setting this value!
207
	if($hour_offset != '-20') {
208
		$template->set_var('VALUE', $hour_offset);
209
		$template->set_var('NAME', $title);
210
		if(DEFAULT_TIMEZONE == $hour_offset*60*60) {
211
			$template->set_var('SELECTED', ' selected="selected"');
212
		} else {
213
			$template->set_var('SELECTED', '');
214
		}
215
		$template->parse('timezone_list', 'timezone_list_block', true);
216
	}
217
}
218

    
219
// Insert default charset values
220
require(ADMIN_PATH.'/interface/charsets.php');
221
$template->set_block('main_block', 'charset_list_block', 'charset_list');
222
foreach($CHARSETS AS $code => $title) {
223
	$template->set_var('VALUE', $code);
224
	$template->set_var('NAME', $title);
225
	if(DEFAULT_CHARSET == $code) {
226
		$template->set_var('SELECTED', ' selected="selected"');
227
	} else {
228
		$template->set_var('SELECTED', '');
229
	}
230
	$template->parse('charset_list', 'charset_list_block', true);
231
}
232

    
233
// Insert date format list
234
require(ADMIN_PATH.'/interface/date_formats.php');
235
$template->set_block('main_block', 'date_format_list_block', 'date_format_list');
236
foreach($DATE_FORMATS AS $format => $title) {
237
	$format = str_replace('|', ' ', $format); // Add's white-spaces (not able to be stored in array key)
238
	if($format != 'system_default') {
239
		$template->set_var('VALUE', $format);
240
	} else {
241
		$template->set_var('VALUE', '');
242
	}
243
	$template->set_var('NAME', $title);
244
	if(DEFAULT_DATE_FORMAT == $format) {
245
		$template->set_var('SELECTED', ' selected="selected"');
246
	} else {
247
		$template->set_var('SELECTED', '');
248
	}
249
	$template->parse('date_format_list', 'date_format_list_block', true);
250
}
251

    
252
// Insert time format list
253
require(ADMIN_PATH.'/interface/time_formats.php');
254
$template->set_block('main_block', 'time_format_list_block', 'time_format_list');
255
foreach($TIME_FORMATS AS $format => $title) {
256
	$format = str_replace('|', ' ', $format); // Add's white-spaces (not able to be stored in array key)
257
	if($format != 'system_default') {
258
		$template->set_var('VALUE', $format);
259
	} else {
260
		$template->set_var('VALUE', '');
261
	}
262
	$template->set_var('NAME', $title);
263
	if(DEFAULT_TIME_FORMAT == $format) {
264
		$template->set_var('SELECTED', ' selected="selected"');
265
	} else {
266
		$template->set_var('SELECTED', '');
267
	}
268
	$template->parse('time_format_list', 'time_format_list_block', true);
269
}
270

    
271
// Insert templates
272
$template->set_block('main_block', 'template_list_block', 'template_list');
273
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'template' AND function != 'theme' order by name");
274
if($result->numRows() > 0) {
275
	while($addon = $result->fetchRow()) {
276
		$template->set_var('FILE', $addon['directory']);
277
		$template->set_var('NAME', $addon['name']);
278
		if(($addon['directory'] == DEFAULT_TEMPLATE) ? $selected = ' selected="selected"' : $selected = '');
279
		$template->set_var('SELECTED', $selected);
280
		$template->parse('template_list', 'template_list_block', true);
281
	}
282
}
283

    
284
// Insert backend theme
285
$template->set_block('main_block', 'theme_list_block', 'theme_list');
286
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'template' AND function = 'theme' order by name");
287
if($result->numRows() > 0) {
288
	while($addon = $result->fetchRow()) {
289
		$template->set_var('FILE', $addon['directory']);
290
		$template->set_var('NAME', $addon['name']);
291
		if(($addon['directory'] == DEFAULT_THEME) ? $selected = ' selected="selected"' : $selected = '');
292
		$template->set_var('SELECTED', $selected);
293
		$template->parse('theme_list', 'theme_list_block', true);
294
	}
295
}
296

    
297
// Insert WYSIWYG modules
298
$template->set_block('main_block', 'editor_list_block', 'editor_list');
299
$file='none';  
300
$module_name=$TEXT['NONE'];  
301
$template->set_var('FILE', $file);  
302
$template->set_var('NAME', $module_name);  
303
if((!defined('WYSIWYG_EDITOR') OR $file == WYSIWYG_EDITOR) ? $selected = ' selected="selected"' : $selected = '');
304
$template->set_var('SELECTED', $selected);
305
$template->parse('editor_list', 'editor_list_block', true);  
306
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'module' AND function = 'wysiwyg'");
307
if($result->numRows() > 0) {
308
	while($addon = $result->fetchRow()) {
309
		$template->set_var('FILE', $addon['directory']);
310
		$template->set_var('NAME', $addon['name']);
311
		if((defined('WYSIWYG_EDITOR') AND $addon['directory'] == WYSIWYG_EDITOR) ? $selected = ' selected="selected"' : $selected = '');
312
		$template->set_var('SELECTED', $selected);
313
		$template->parse('editor_list', 'editor_list_block', true);
314
	}
315
}
316

    
317
// Insert templates for search settings
318
$template->set_block('main_block', 'search_template_list_block', 'search_template_list');
319
$search_template = ($search_template == DEFAULT_TEMPLATE) ? '' : $search_template;
320
if( $search_template == '')
321
{
322
    $selected = ' selected="selected"';
323
}
324
else
325
{
326
  $selected = '';
327
}
328

    
329
$template->set_var(array(
330
        'FILE' => DEFAULT_TEMPLATE,
331
        'NAME' => $TEXT['SYSTEM_DEFAULT'],
332
        'SELECTED' => $selected
333
    ));
334

    
335
$template->parse('search_template_list', 'search_template_list_block', true);
336
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'template' AND function = 'template' order by name");
337

    
338
if($result->numRows() > 0)
339
{
340
	while($addon = $result->fetchRow())
341
    {
342
		$template->set_var('FILE', $addon['directory']);
343
		$template->set_var('NAME', $addon['name']);
344

    
345
		if($addon['directory'] == $search_template)
346
        {
347
            $selected = ' selected="selected"';
348
        }
349
        else
350
        {
351
            $selected = '';
352
        }
353

    
354
		$template->set_var('SELECTED', $selected);
355
		$template->parse('search_template_list', 'search_template_list_block', true);
356
	}
357
}
358

    
359
// Insert default error reporting values
360
require(ADMIN_PATH.'/interface/er_levels.php');
361
$template->set_block('main_block', 'error_reporting_list_block', 'error_reporting_list');
362
foreach($ER_LEVELS AS $value => $title) {
363
	$template->set_var('VALUE', $value);
364
	$template->set_var('NAME', $title);
365
	if(ER_LEVEL == $value) {
366
		$template->set_var('SELECTED', ' selected="selected"');
367
	} else {
368
		$template->set_var('SELECTED', '');
369
	}
370
	$template->parse('error_reporting_list', 'error_reporting_list_block', true);
371
}
372

    
373
// Insert permissions values
374
if($admin->get_permission('settings_advanced') != true) {
375
	$template->set_var('DISPLAY_ADVANCED_BUTTON', 'hide');
376
}
377

    
378
// Insert page level limits
379
$template->set_block('main_block', 'page_level_limit_list_block', 'page_level_limit_list');
380
for($i = 1; $i <= 10; $i++) {
381
	$template->set_var('NUMBER', $i);
382
	if(PAGE_LEVEL_LIMIT == $i) {
383
		$template->set_var('SELECTED', ' selected="selected"');
384
	} else {
385
		$template->set_var('SELECTED', '');
386
	}
387
	$template->parse('page_level_limit_list', 'page_level_limit_list_block', true);
388
}
389

    
390
// Work-out if multiple menus feature is enabled
391
if(defined('MULTIPLE_MENUS') AND MULTIPLE_MENUS == true) {
392
	$template->set_var('MULTIPLE_MENUS_ENABLED', ' checked="checked"');
393
} else {
394
	$template->set_var('MULTIPLE_MENUS_DISABLED', ' checked="checked"');
395
}
396

    
397
// Work-out if page languages feature is enabled
398
if(defined('PAGE_LANGUAGES') AND PAGE_LANGUAGES == true) {
399
        $template->set_var('PAGE_LANGUAGES_ENABLED', ' checked="checked"');
400
} else {
401
        $template->set_var('PAGE_LANGUAGES_DISABLED', ' checked="checked"');
402
}
403

    
404
// Work-out if smart login feature is enabled
405
if(defined('SMART_LOGIN') AND SMART_LOGIN == true) {
406
	$template->set_var('SMART_LOGIN_ENABLED', ' checked="checked"');
407
} else {
408
	$template->set_var('SMART_LOGIN_DISABLED', ' checked="checked"');
409
}
410

    
411
if(extension_loaded('gd') AND function_exists('imageCreateFromJpeg')) { /* Make's sure GD library is installed */
412
	$template->set_var('GD_EXTENSION_ENABLED', '');
413
} else {
414
	$template->set_var('GD_EXTENSION_ENABLED', 'none');
415
}
416

    
417
// Work-out if section blocks feature is enabled
418
if(defined('SECTION_BLOCKS') AND SECTION_BLOCKS == true) {
419
	$template->set_var('SECTION_BLOCKS_ENABLED', ' checked="checked"');
420
} else {
421
	$template->set_var('SECTION_BLOCKS_DISABLED', ' checked="checked"');
422
}
423

    
424
// Work-out if homepage redirection feature is enabled
425
if(defined('HOMEPAGE_REDIRECTION') AND HOMEPAGE_REDIRECTION == true) {
426
	$template->set_var('HOMEPAGE_REDIRECTION_ENABLED', ' checked="checked"');
427
} else {
428
	$template->set_var('HOMEPAGE_REDIRECTION_DISABLED', ' checked="checked"');
429
}
430

    
431
// Work-out which server os should be checked
432
if(OPERATING_SYSTEM == 'linux') {
433
	$template->set_var('LINUX_SELECTED', ' checked="checked"');
434
} elseif(OPERATING_SYSTEM == 'windows') {
435
	$template->set_var('WINDOWS_SELECTED', ' checked="checked"');
436
}
437

    
438
// Work-out if manage sections feature is enabled
439
if(MANAGE_SECTIONS) {
440
	$template->set_var('MANAGE_SECTIONS_ENABLED', ' checked="checked"');
441
} else {
442
	$template->set_var('MANAGE_SECTIONS_DISABLED', ' checked="checked"');
443
}
444

    
445
// Work-out which wbmailer routine should be checked
446
if(WBMAILER_ROUTINE == 'phpmail') {
447
	$template->set_var('PHPMAIL_SELECTED', ' checked="checked"');
448
	$template->set_var('SMTP_VISIBILITY', 'none');
449
	$template->set_var('SMTP_VISIBILITY_AUTH', 'none');
450
} elseif(WBMAILER_ROUTINE == 'smtp') {
451
	$template->set_var('SMTPMAIL_SELECTED', ' checked="checked"');
452
	$template->set_var('SMTP_VISIBILITY', '');
453
}
454

    
455
// Work-out if SMTP authentification should be checked
456
if(WBMAILER_SMTP_AUTH) {
457
	$template->set_var('SMTP_AUTH_SELECTED', ' checked="checked"');
458
	if(WBMAILER_ROUTINE == 'smtp') {
459
		$template->set_var('SMTP_VISIBILITY_AUTH', '');
460
	} else {
461
		$template->set_var('SMTP_VISIBILITY_AUTH', 'none');
462
	}
463
} else {
464
	$template->set_var('SMTP_VISIBILITY_AUTH', 'none');
465
}
466

    
467
// Work-out if intro feature is enabled
468
if(INTRO_PAGE) {
469
	$template->set_var('INTRO_PAGE_ENABLED', ' checked="checked"');
470
} else {
471
	$template->set_var('INTRO_PAGE_DISABLED', ' checked="checked"');
472
}
473

    
474
// Work-out if frontend login feature is enabled
475
if(FRONTEND_LOGIN) {
476
	$template->set_var('PRIVATE_ENABLED', ' checked="checked"');
477
} else {
478
	$template->set_var('PRIVATE_DISABLED', ' checked="checked"');
479
}
480

    
481
// Work-out if page trash feature is disabled, in-line, or separate
482
if(PAGE_TRASH == 'disabled') {
483
	$template->set_var('PAGE_TRASH_DISABLED', ' checked="checked"');
484
	$template->set_var('DISPLAY_PAGE_TRASH_SEPARATE', ' display: none;');
485
} elseif(PAGE_TRASH == 'inline') {
486
	$template->set_var('PAGE_TRASH_INLINE', ' checked="checked"');
487
	$template->set_var('DISPLAY_PAGE_TRASH_SEPARATE', ' display: none;');
488
} elseif(PAGE_TRASH == 'separate') {
489
	$template->set_var('PAGE_TRASH_SEPARATE', ' checked="checked"');
490
	$template->set_var('DISPLAY_PAGE_TRASH_SEPARATE', ' display: inline;');
491
}
492

    
493
// Work-out if media home folde feature is enabled
494
if(HOME_FOLDERS) {
495
	$template->set_var('HOME_FOLDERS_ENABLED', ' checked="checked"');
496
} else {
497
	$template->set_var('HOME_FOLDERS_DISABLED', ' checked="checked"');
498
}
499

    
500
// Insert search select
501
if(SEARCH == 'private') {
502
	$template->set_var('PRIVATE_SEARCH', ' selected="selected"');
503
} elseif(SEARCH == 'registered') {
504
	$template->set_var('REGISTERED_SEARCH', ' selected="selected"');
505
} elseif(SEARCH == 'none') {
506
	$template->set_var('NONE_SEARCH', ' selected="selected"');
507
}
508

    
509
// Work-out if 777 permissions are set
510
if(STRING_FILE_MODE == '0777' AND STRING_DIR_MODE == '0777') {
511
	$template->set_var('WORLD_WRITEABLE_SELECTED', ' checked="checked"');
512
}
513

    
514
// Work-out which file mode boxes are checked
515
if(extract_permission(STRING_FILE_MODE, 'u', 'r')) {
516
	$template->set_var('FILE_U_R_CHECKED', ' checked="checked"');
517
}
518
if(extract_permission(STRING_FILE_MODE, 'u', 'w')) {
519
	$template->set_var('FILE_U_W_CHECKED', ' checked="checked"');
520
}
521
if(extract_permission(STRING_FILE_MODE, 'u', 'e')) {
522
	$template->set_var('FILE_U_E_CHECKED', ' checked="checked"');
523
}
524
if(extract_permission(STRING_FILE_MODE, 'g', 'r')) {
525
	$template->set_var('FILE_G_R_CHECKED', ' checked="checked"');
526
}
527
if(extract_permission(STRING_FILE_MODE, 'g', 'w')) {
528
	$template->set_var('FILE_G_W_CHECKED', ' checked="checked"');
529
}
530
if(extract_permission(STRING_FILE_MODE, 'g', 'e')) {
531
	$template->set_var('FILE_G_E_CHECKED', ' checked="checked"');
532
}
533
if(extract_permission(STRING_FILE_MODE, 'o', 'r')) {
534
	$template->set_var('FILE_O_R_CHECKED', ' checked="checked"');
535
}
536
if(extract_permission(STRING_FILE_MODE, 'o', 'w')) {
537
	$template->set_var('FILE_O_W_CHECKED', ' checked="checked"');
538
}
539
if(extract_permission(STRING_FILE_MODE, 'o', 'e')) {
540
	$template->set_var('FILE_O_E_CHECKED', ' checked="checked"');
541
}
542
// Work-out which dir mode boxes are checked
543
if(extract_permission(STRING_DIR_MODE, 'u', 'r')) {
544
	$template->set_var('DIR_U_R_CHECKED', ' checked="checked"');
545
}
546
if(extract_permission(STRING_DIR_MODE, 'u', 'w')) {
547
	$template->set_var('DIR_U_W_CHECKED', ' checked="checked"');
548
}
549
if(extract_permission(STRING_DIR_MODE, 'u', 'e')) {
550
	$template->set_var('DIR_U_E_CHECKED', ' checked="checked"');
551
}
552
if(extract_permission(STRING_DIR_MODE, 'g', 'r')) {
553
	$template->set_var('DIR_G_R_CHECKED', ' checked="checked"');
554
}
555
if(extract_permission(STRING_DIR_MODE, 'g', 'w')) {
556
	$template->set_var('DIR_G_W_CHECKED', ' checked="checked"');
557
}
558
if(extract_permission(STRING_DIR_MODE, 'g', 'e')) {
559
	$template->set_var('DIR_G_E_CHECKED', ' checked="checked"');
560
}
561
if(extract_permission(STRING_DIR_MODE, 'o', 'r')) {
562
	$template->set_var('DIR_O_R_CHECKED', ' checked="checked"');
563
}
564
if(extract_permission(STRING_DIR_MODE, 'o', 'w')) {
565
	$template->set_var('DIR_O_W_CHECKED', ' checked="checked"');
566
}
567
if(extract_permission(STRING_DIR_MODE, 'o', 'e')) {
568
	$template->set_var('DIR_O_E_CHECKED', ' checked="checked"');
569
}
570

    
571
// Insert Server Email value into template
572
$template->set_var('SERVER_EMAIL', SERVER_EMAIL);
573

    
574
// Insert groups into signup list
575
$template->set_block('main_block', 'group_list_block', 'group_list');
576
$results = $database->query("SELECT group_id, name FROM ".TABLE_PREFIX."groups WHERE group_id != '1'");
577
if($results->numRows() > 0) {
578
	while($group = $results->fetchRow()) {
579
		$template->set_var('ID', $group['group_id']);
580
		$template->set_var('NAME', $group['name']);
581
		if(FRONTEND_SIGNUP == $group['group_id']) {
582
			$template->set_var('SELECTED', ' selected="selected"');
583
		} else {
584
			$template->set_var('SELECTED', '');
585
		}
586
		$template->parse('group_list', 'group_list_block', true);
587
	}
588
} else {
589
	$template->set_var('ID', 'disabled');
590
	$template->set_var('NAME', $MESSAGE['GROUPS']['NO_GROUPS_FOUND']);
591
	$template->parse('group_list', 'group_list_block', true);
592
}
593

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

    
707
// Parse template objects output
708
$template->parse('main', 'main_block', false);
709
$template->pparse('output', 'page');
710

    
711
$admin->print_footer();
712

    
713
?>
(1-1/3)