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