1 |
45
|
stefan
|
<?php
|
2 |
|
|
|
3 |
|
|
// $Id$
|
4 |
|
|
|
5 |
|
|
/*
|
6 |
|
|
|
7 |
|
|
Website Baker Project <http://www.websitebaker.org/>
|
8 |
|
|
Copyright (C) 2004-2005, Ryan Djurovich
|
9 |
|
|
|
10 |
|
|
Website Baker is free software; you can redistribute it and/or modify
|
11 |
|
|
it under the terms of the GNU General Public License as published by
|
12 |
|
|
the Free Software Foundation; either version 2 of the License, or
|
13 |
|
|
(at your option) any later version.
|
14 |
|
|
|
15 |
|
|
Website Baker is distributed in the hope that it will be useful,
|
16 |
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
17 |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
18 |
|
|
GNU General Public License for more details.
|
19 |
|
|
|
20 |
|
|
You should have received a copy of the GNU General Public License
|
21 |
|
|
along with Website Baker; if not, write to the Free Software
|
22 |
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
23 |
|
|
|
24 |
|
|
*/
|
25 |
|
|
|
26 |
|
|
require('../../config.php');
|
27 |
|
|
require_once(WB_PATH.'/framework/class.admin.php');
|
28 |
|
|
if(isset($_GET['advanced']) AND $_GET['advanced'] == 'yes') {
|
29 |
|
|
$admin = new admin('Settings', 'settings_advanced');
|
30 |
|
|
} else {
|
31 |
|
|
$admin = new admin('Settings', 'settings_basic');
|
32 |
|
|
}
|
33 |
|
|
|
34 |
|
|
// Create new database object
|
35 |
|
|
$database = new database();
|
36 |
|
|
|
37 |
|
|
// Include the WB functions file
|
38 |
|
|
require_once(WB_PATH.'/framework/functions.php');
|
39 |
|
|
|
40 |
|
|
// Create new template object
|
41 |
|
|
$template = new Template(ADMIN_PATH.'/settings');
|
42 |
|
|
$template->set_file('page', 'template.html');
|
43 |
|
|
$template->set_block('page', 'main_block', 'main');
|
44 |
|
|
|
45 |
|
|
// Query current settings in the db, then loop through them and print them
|
46 |
|
|
$query = "SELECT * FROM ".TABLE_PREFIX."settings";
|
47 |
|
|
$results = $database->query($query);
|
48 |
|
|
while($setting = $results->fetchRow()) {
|
49 |
|
|
$setting_name = $setting['name'];
|
50 |
|
|
$setting_value = htmlspecialchars($admin->strip_slashes_dummy($setting['value']));
|
51 |
|
|
switch($setting_name) {
|
52 |
|
|
// Website title
|
53 |
|
|
case 'title':
|
54 |
|
|
$template->set_var('TITLE', $setting_value);
|
55 |
|
|
break;
|
56 |
|
|
// Website description
|
57 |
|
|
case 'description':
|
58 |
|
|
$template->set_var('DESCRIPTION', $setting_value);
|
59 |
|
|
break;
|
60 |
|
|
// Website keywords
|
61 |
|
|
case 'keywords':
|
62 |
|
|
$template->set_var('KEYWORDS', $setting_value);
|
63 |
|
|
break;
|
64 |
|
|
// Website header
|
65 |
|
|
case 'header':
|
66 |
|
|
$template->set_var('HEADER', $setting_value);
|
67 |
|
|
break;
|
68 |
|
|
// Website header
|
69 |
|
|
case 'header':
|
70 |
|
|
$template->set_var('HEADER', $setting_value);
|
71 |
|
|
break;
|
72 |
|
|
// Website footer
|
73 |
|
|
case 'footer':
|
74 |
|
|
$template->set_var('FOOTER', $setting_value);
|
75 |
|
|
break;
|
76 |
|
|
}
|
77 |
|
|
}
|
78 |
|
|
|
79 |
|
|
// Query current settings in the db, then loop through them and print them
|
80 |
|
|
$query = "SELECT * FROM ".TABLE_PREFIX."search WHERE extra = ''";
|
81 |
|
|
$results = $database->query($query);
|
82 |
|
|
while($setting = $results->fetchRow()) {
|
83 |
|
|
$setting_name = $setting['name'];
|
84 |
|
|
$setting_value = htmlspecialchars($admin->strip_slashes_dummy($setting['value']));
|
85 |
|
|
switch($setting_name) {
|
86 |
|
|
// Search header
|
87 |
|
|
case 'header':
|
88 |
|
|
$template->set_var('SEARCH_HEADER', $setting_value);
|
89 |
|
|
break;
|
90 |
|
|
// Search results header
|
91 |
|
|
case 'results_header':
|
92 |
|
|
$template->set_var('SEARCH_RESULTS_HEADER', $setting_value);
|
93 |
|
|
break;
|
94 |
|
|
// Search results loop
|
95 |
|
|
case 'results_loop':
|
96 |
|
|
$template->set_var('SEARCH_RESULTS_LOOP', $setting_value);
|
97 |
|
|
break;
|
98 |
|
|
// Search results footer
|
99 |
|
|
case 'results_footer':
|
100 |
|
|
$template->set_var('SEARCH_RESULTS_FOOTER', $setting_value);
|
101 |
|
|
break;
|
102 |
|
|
// Search no results
|
103 |
|
|
case 'no_results':
|
104 |
|
|
$template->set_var('SEARCH_NO_RESULTS', $setting_value);
|
105 |
|
|
break;
|
106 |
|
|
// Search footer
|
107 |
|
|
case 'footer':
|
108 |
|
|
$template->set_var('SEARCH_FOOTER', $setting_value);
|
109 |
|
|
break;
|
110 |
|
|
// Search template
|
111 |
|
|
case 'template':
|
112 |
|
|
$search_template = $setting_value;
|
113 |
|
|
break;
|
114 |
|
|
}
|
115 |
|
|
}
|
116 |
|
|
|
117 |
|
|
// Do the same for settings stored in config file as with ones in db
|
118 |
|
|
$database_type = '';
|
119 |
|
|
|
120 |
|
|
// Tell the browser whether or not to show advanced options
|
121 |
|
|
if(isset($_GET['advanced']) AND $_GET['advanced'] == 'yes') {
|
122 |
|
|
$template->set_var('DISPLAY_ADVANCED', '');
|
123 |
|
|
$template->set_var('ADVANCED', 'yes');
|
124 |
|
|
$template->set_var('ADVANCED_BUTTON', '<< '.$TEXT['HIDE_ADVANCED']);
|
125 |
|
|
$template->set_var('ADVANCED_LINK', 'index.php?advanced=no');
|
126 |
|
|
$template->set_var('BASIC_FILE_PERMS_ID', 'hide');
|
127 |
|
|
$template->set_var('ADVANCED_FILE_PERMS_ID', 'file_perms_box');
|
128 |
|
|
} else {
|
129 |
|
|
$template->set_var('DISPLAY_ADVANCED', 'none');
|
130 |
|
|
$template->set_var('ADVANCED', 'no');
|
131 |
|
|
$template->set_var('ADVANCED_BUTTON', $TEXT['SHOW_ADVANCED'].' >>');
|
132 |
|
|
$template->set_var('ADVANCED_LINK', 'index.php?advanced=yes');
|
133 |
|
|
$template->set_var('BASIC_FILE_PERMS_ID', 'file_perms_box');
|
134 |
|
|
$template->set_var('ADVANCED_FILE_PERMS_ID', 'hide');
|
135 |
|
|
}
|
136 |
|
|
|
137 |
|
|
$template->set_var(array(
|
138 |
|
|
'PAGE_EXTENSION' => PAGE_EXTENSION,
|
139 |
|
|
'PAGE_SPACER' => PAGE_SPACER,
|
140 |
|
|
'WB_PATH' => WB_PATH,
|
141 |
|
|
'WB_URL' => WB_URL,
|
142 |
|
|
'ADMIN_PATH' => ADMIN_PATH,
|
143 |
|
|
'ADMIN_URL' => ADMIN_URL,
|
144 |
|
|
'DATABASE_TYPE' => DB_TYPE,
|
145 |
|
|
'DATABASE_HOST' => DB_HOST,
|
146 |
|
|
'DATABASE_USERNAME' => DB_USERNAME,
|
147 |
|
|
'DATABASE_NAME' => DB_NAME,
|
148 |
|
|
'TABLE_PREFIX' => TABLE_PREFIX
|
149 |
|
|
)
|
150 |
|
|
);
|
151 |
|
|
|
152 |
|
|
// Insert groups into signup list
|
153 |
|
|
$template->set_block('main_block', 'group_list_block', 'group_list');
|
154 |
|
|
$results = $database->query("SELECT group_id, name FROM ".TABLE_PREFIX."groups WHERE group_id != '1'");
|
155 |
|
|
if($results->numRows() > 0) {
|
156 |
|
|
while($group = $results->fetchRow()) {
|
157 |
|
|
$template->set_var('ID', $group['group_id']);
|
158 |
|
|
$template->set_var('NAME', $group['name']);
|
159 |
|
|
if(FRONTEND_SIGNUP == $group['group_id']) {
|
160 |
|
|
$template->set_var('SELECTED', 'selected');
|
161 |
|
|
} else {
|
162 |
|
|
$template->set_var('SELECTED', '');
|
163 |
|
|
}
|
164 |
|
|
$template->parse('group_list', 'group_list_block', true);
|
165 |
|
|
}
|
166 |
|
|
} else {
|
167 |
|
|
$template->set_var('ID', 'disabled');
|
168 |
|
|
$template->set_var('NAME', $MESSAGE['GROUPS']['NO_GROUPS_FOUND']);
|
169 |
|
|
$template->parse('group_list', 'group_list_block', true);
|
170 |
|
|
}
|
171 |
|
|
|
172 |
|
|
// Insert language values
|
173 |
|
|
$template->set_block('main_block', 'language_list_block', 'language_list');
|
174 |
|
|
if($handle = opendir(WB_PATH.'/languages/')) {
|
175 |
|
|
while (false !== ($file = readdir($handle))) {
|
176 |
|
|
if($file != '.' AND $file != '..' AND !is_dir($file) AND $file != 'index.php') {
|
177 |
|
|
// Get language name
|
178 |
|
|
require(WB_PATH.'/languages/'.$file);
|
179 |
|
|
// Insert code and name
|
180 |
|
|
$template->set_var(array(
|
181 |
|
|
'CODE' => $language_code,
|
182 |
|
|
'NAME' => $language_name
|
183 |
|
|
)
|
184 |
|
|
);
|
185 |
|
|
// Check if it is selected
|
186 |
|
|
if(DEFAULT_LANGUAGE == $language_code) {
|
187 |
|
|
$template->set_var('SELECTED', ' selected');
|
188 |
|
|
} else {
|
189 |
|
|
$template->set_var('SELECTED', '');
|
190 |
|
|
}
|
191 |
|
|
$template->parse('language_list', 'language_list_block', true);
|
192 |
|
|
}
|
193 |
|
|
}
|
194 |
|
|
// Restore language to original file
|
195 |
|
|
require(WB_PATH.'/languages/'.LANGUAGE.'.php');
|
196 |
|
|
}
|
197 |
|
|
|
198 |
|
|
// Insert default timezone values
|
199 |
|
|
require(ADMIN_PATH.'/interface/timezones.php');
|
200 |
|
|
$template->set_block('main_block', 'timezone_list_block', 'timezone_list');
|
201 |
|
|
foreach($TIMEZONES AS $hour_offset => $title) {
|
202 |
|
|
// Make sure we dont list "System Default" as we are setting this value!
|
203 |
|
|
if($hour_offset != '-20') {
|
204 |
|
|
$template->set_var('VALUE', $hour_offset);
|
205 |
|
|
$template->set_var('NAME', $title);
|
206 |
|
|
if(DEFAULT_TIMEZONE == $hour_offset*60*60) {
|
207 |
|
|
$template->set_var('SELECTED', 'selected');
|
208 |
|
|
} else {
|
209 |
|
|
$template->set_var('SELECTED', '');
|
210 |
|
|
}
|
211 |
|
|
$template->parse('timezone_list', 'timezone_list_block', true);
|
212 |
|
|
}
|
213 |
|
|
}
|
214 |
|
|
|
215 |
|
|
// Insert date format list
|
216 |
|
|
require(ADMIN_PATH.'/interface/date_formats.php');
|
217 |
|
|
$template->set_block('main_block', 'date_format_list_block', 'date_format_list');
|
218 |
|
|
foreach($DATE_FORMATS AS $format => $title) {
|
219 |
|
|
$format = str_replace('|', ' ', $format); // Add's white-spaces (not able to be stored in array key)
|
220 |
|
|
if($format != 'system_default') {
|
221 |
|
|
$template->set_var('VALUE', $format);
|
222 |
|
|
} else {
|
223 |
|
|
$template->set_var('VALUE', '');
|
224 |
|
|
}
|
225 |
|
|
$template->set_var('NAME', $title);
|
226 |
|
|
if(DEFAULT_DATE_FORMAT == $format) {
|
227 |
|
|
$template->set_var('SELECTED', 'selected');
|
228 |
|
|
} else {
|
229 |
|
|
$template->set_var('SELECTED', '');
|
230 |
|
|
}
|
231 |
|
|
$template->parse('date_format_list', 'date_format_list_block', true);
|
232 |
|
|
}
|
233 |
|
|
|
234 |
|
|
// Insert time format list
|
235 |
|
|
require(ADMIN_PATH.'/interface/time_formats.php');
|
236 |
|
|
$template->set_block('main_block', 'time_format_list_block', 'time_format_list');
|
237 |
|
|
foreach($TIME_FORMATS AS $format => $title) {
|
238 |
|
|
$format = str_replace('|', ' ', $format); // Add's white-spaces (not able to be stored in array key)
|
239 |
|
|
if($format != 'system_default') {
|
240 |
|
|
$template->set_var('VALUE', $format);
|
241 |
|
|
} else {
|
242 |
|
|
$template->set_var('VALUE', '');
|
243 |
|
|
}
|
244 |
|
|
$template->set_var('NAME', $title);
|
245 |
|
|
if(DEFAULT_TIME_FORMAT == $format) {
|
246 |
|
|
$template->set_var('SELECTED', 'selected');
|
247 |
|
|
} else {
|
248 |
|
|
$template->set_var('SELECTED', '');
|
249 |
|
|
}
|
250 |
|
|
$template->parse('time_format_list', 'time_format_list_block', true);
|
251 |
|
|
}
|
252 |
|
|
|
253 |
|
|
// Insert templates
|
254 |
|
|
$template->set_block('main_block', 'template_list_block', 'template_list');
|
255 |
|
|
if($handle = opendir(WB_PATH.'/templates/')) {
|
256 |
|
|
while (false !== ($file = readdir($handle))) {
|
257 |
|
|
if($file != "." AND $file != ".." AND $file != ".svn" AND is_dir(WB_PATH."/templates/$file") AND file_exists(WB_PATH."/templates/$file/info.php")) {
|
258 |
|
|
include(WB_PATH."/templates/$file/info.php");
|
259 |
|
|
$template->set_var('FILE', $file);
|
260 |
|
|
$template->set_var('NAME', $template_name);
|
261 |
|
|
if($file == DEFAULT_TEMPLATE ? $selected = ' selected' : $selected = '');
|
262 |
|
|
$template->set_var('SELECTED', $selected);
|
263 |
|
|
$template->parse('template_list', 'template_list_block', true);
|
264 |
|
|
}
|
265 |
|
|
}
|
266 |
|
|
}
|
267 |
|
|
|
268 |
|
|
// Insert templates
|
269 |
|
|
$template->set_block('main_block', 'editor_list_block', 'editor_list');
|
270 |
|
|
$file='htmlarea';
|
271 |
|
|
$module_name='HTMLArea';
|
272 |
|
|
$template->set_var('FILE', $file);
|
273 |
|
|
$template->set_var('NAME', $module_name);
|
274 |
|
|
if((!defined('WYSIWYG_EDITOR') OR $file == WYSIWYG_EDITOR) ? $selected = ' selected' : $selected = '');
|
275 |
|
|
$template->set_var('SELECTED', $selected);
|
276 |
|
|
$template->parse('editor_list', 'editor_list_block', true);
|
277 |
|
|
if($handle = opendir(WB_PATH.'/modules/')) {
|
278 |
|
|
while (false !== ($file = readdir($handle))) {
|
279 |
|
|
if($file != "." AND $file != ".." AND $file != "CVS" AND is_dir(WB_PATH."/modules/$file") AND file_exists(WB_PATH."/modules/$file/info.php")) {
|
280 |
|
|
include(WB_PATH."/modules/$file/info.php");
|
281 |
|
|
if ($module_type == 'WYSIWYG') {
|
282 |
|
|
$template->set_var('FILE', $file);
|
283 |
|
|
$template->set_var('NAME', $module_name);
|
284 |
|
|
if((defined('WYSIWYG_EDITOR') AND $file == WYSIWYG_EDITOR) ? $selected = ' selected' : $selected = '');
|
285 |
|
|
$template->set_var('SELECTED', $selected);
|
286 |
|
|
$template->parse('editor_list', 'editor_list_block', true);
|
287 |
|
|
}
|
288 |
|
|
}
|
289 |
|
|
}
|
290 |
|
|
}
|
291 |
|
|
|
292 |
|
|
|
293 |
|
|
// Insert templates for search settings
|
294 |
|
|
$template->set_block('main_block', 'search_template_list_block', 'search_template_list');
|
295 |
|
|
if($search_template == '') { $selected = ' selected'; } else { $selected = ''; }
|
296 |
|
|
$template->set_var(array('FILE' => '', 'NAME' => $TEXT['SYSTEM_DEFAULT'], 'SELECTED' => $selected));
|
297 |
|
|
$template->parse('search_template_list', 'search_template_list_block', true);
|
298 |
|
|
if($handle = opendir(WB_PATH.'/templates/')) {
|
299 |
|
|
while (false !== ($file = readdir($handle))) {
|
300 |
|
|
if($file != "." AND $file != ".." AND $file != ".svn" AND is_dir(WB_PATH."/templates/$file") AND file_exists(WB_PATH."/templates/$file/info.php")) {
|
301 |
|
|
include(WB_PATH."/templates/$file/info.php");
|
302 |
|
|
$template->set_var('FILE', $file);
|
303 |
|
|
$template->set_var('NAME', $template_name);
|
304 |
|
|
if($file == $search_template ? $selected = ' selected' : $selected = '');
|
305 |
|
|
$template->set_var('SELECTED', $selected);
|
306 |
|
|
$template->parse('search_template_list', 'search_template_list_block', true);
|
307 |
|
|
}
|
308 |
|
|
}
|
309 |
|
|
}
|
310 |
|
|
|
311 |
|
|
// Insert default error reporting values
|
312 |
|
|
require(ADMIN_PATH.'/interface/er_levels.php');
|
313 |
|
|
$template->set_block('main_block', 'error_reporting_list_block', 'error_reporting_list');
|
314 |
|
|
foreach($ER_LEVELS AS $value => $title) {
|
315 |
|
|
$template->set_var('VALUE', $value);
|
316 |
|
|
$template->set_var('NAME', $title);
|
317 |
|
|
if(ER_LEVEL == $value) {
|
318 |
|
|
$template->set_var('SELECTED', 'selected');
|
319 |
|
|
} else {
|
320 |
|
|
$template->set_var('SELECTED', '');
|
321 |
|
|
}
|
322 |
|
|
$template->parse('error_reporting_list', 'error_reporting_list_block', true);
|
323 |
|
|
}
|
324 |
|
|
|
325 |
|
|
// Insert permissions values
|
326 |
|
|
if($admin->get_permission('settings_advanced') != true) {
|
327 |
|
|
$template->set_var('DISPLAY_ADVANCED_BUTTON', 'hide');
|
328 |
|
|
}
|
329 |
|
|
|
330 |
|
|
// Insert page level limits
|
331 |
|
|
$template->set_block('main_block', 'page_level_limit_list_block', 'page_level_limit_list');
|
332 |
|
|
for($i = 1; $i <= 10; $i++) {
|
333 |
|
|
$template->set_var('NUMBER', $i);
|
334 |
|
|
if(PAGE_LEVEL_LIMIT == $i) {
|
335 |
|
|
$template->set_var('SELECTED', 'selected');
|
336 |
|
|
} else {
|
337 |
|
|
$template->set_var('SELECTED', '');
|
338 |
|
|
}
|
339 |
|
|
$template->parse('page_level_limit_list', 'page_level_limit_list_block', true);
|
340 |
|
|
}
|
341 |
|
|
|
342 |
|
|
// Work-out if multiple menus feature is enabled
|
343 |
|
|
if(defined('MULTIPLE_MENUS') AND MULTIPLE_MENUS == true) {
|
344 |
|
|
$template->set_var('MULTIPLE_MENUS_ENABLED', ' checked');
|
345 |
|
|
} else {
|
346 |
|
|
$template->set_var('MULTIPLE_MENUS_DISABLED', ' checked');
|
347 |
|
|
}
|
348 |
|
|
|
349 |
|
|
// Work-out if page languages feature is enabled
|
350 |
|
|
if(defined('PAGE_LANGUAGES') AND PAGE_LANGUAGES == true) {
|
351 |
|
|
$template->set_var('PAGE_LANGUAGES_ENABLED', ' checked');
|
352 |
|
|
} else {
|
353 |
|
|
$template->set_var('PAGE_LANGUAGES_DISABLED', ' checked');
|
354 |
|
|
}
|
355 |
|
|
|
356 |
|
|
// Work-out if smart login feature is enabled
|
357 |
|
|
if(defined('SMART_LOGIN') AND SMART_LOGIN == true) {
|
358 |
|
|
$template->set_var('SMART_LOGIN_ENABLED', ' checked');
|
359 |
|
|
} else {
|
360 |
|
|
$template->set_var('SMART_LOGIN_DISABLED', ' checked');
|
361 |
|
|
}
|
362 |
|
|
|
363 |
|
|
// Work-out if section blocks feature is enabled
|
364 |
|
|
if(defined('SECTION_BLOCKS') AND SECTION_BLOCKS == true) {
|
365 |
|
|
$template->set_var('SECTION_BLOCKS_ENABLED', ' checked');
|
366 |
|
|
} else {
|
367 |
|
|
$template->set_var('SECTION_BLOCKS_DISABLED', ' checked');
|
368 |
|
|
}
|
369 |
|
|
|
370 |
|
|
// Work-out if homepage redirection feature is enabled
|
371 |
|
|
if(defined('HOMEPAGE_REDIRECTION') AND HOMEPAGE_REDIRECTION == true) {
|
372 |
|
|
$template->set_var('HOMEPAGE_REDIRECTION_ENABLED', ' checked');
|
373 |
|
|
} else {
|
374 |
|
|
$template->set_var('HOMEPAGE_REDIRECTION_DISABLED', ' checked');
|
375 |
|
|
}
|
376 |
|
|
|
377 |
|
|
// Work-out which server os should be checked
|
378 |
|
|
if(OPERATING_SYSTEM == 'linux') {
|
379 |
|
|
$template->set_var('LINUX_SELECTED', ' checked');
|
380 |
|
|
} elseif(OPERATING_SYSTEM == 'windows') {
|
381 |
|
|
$template->set_var('WINDOWS_SELECTED', ' checked');
|
382 |
|
|
}
|
383 |
|
|
|
384 |
|
|
// Work-out if manage sections feature is enabled
|
385 |
|
|
if(MANAGE_SECTIONS) {
|
386 |
|
|
$template->set_var('MANAGE_SECTIONS_ENABLED', ' checked');
|
387 |
|
|
} else {
|
388 |
|
|
$template->set_var('MANAGE_SECTIONS_DISABLED', ' checked');
|
389 |
|
|
}
|
390 |
|
|
|
391 |
|
|
// Work-out if intro feature is enabled
|
392 |
|
|
if(INTRO_PAGE) {
|
393 |
|
|
$template->set_var('INTRO_PAGE_ENABLED', ' checked');
|
394 |
|
|
} else {
|
395 |
|
|
$template->set_var('INTRO_PAGE_DISABLED', ' checked');
|
396 |
|
|
}
|
397 |
|
|
|
398 |
|
|
// Work-out if frontend login feature is enabled
|
399 |
|
|
if(FRONTEND_LOGIN) {
|
400 |
|
|
$template->set_var('PRIVATE_ENABLED', ' checked');
|
401 |
|
|
} else {
|
402 |
|
|
$template->set_var('PRIVATE_DISABLED', ' checked');
|
403 |
|
|
}
|
404 |
|
|
|
405 |
|
|
// Work-out if page trash feature is disabled, in-line, or separate
|
406 |
|
|
if(PAGE_TRASH == 'disabled') {
|
407 |
|
|
$template->set_var('PAGE_TRASH_DISABLED', ' checked');
|
408 |
|
|
} elseif(PAGE_TRASH == 'inline') {
|
409 |
|
|
$template->set_var('PAGE_TRASH_INLINE', ' checked');
|
410 |
|
|
} elseif(PAGE_TRASH == 'separate') {
|
411 |
|
|
$template->set_var('PAGE_TRASH_SEPARATE', ' checked');
|
412 |
|
|
}
|
413 |
|
|
|
414 |
|
|
// Work-out if media home folde feature is enabled
|
415 |
|
|
if(HOME_FOLDERS) {
|
416 |
|
|
$template->set_var('HOME_FOLDERS_ENABLED', ' checked');
|
417 |
|
|
} else {
|
418 |
|
|
$template->set_var('HOME_FOLDERS_DISABLED', ' checked');
|
419 |
|
|
}
|
420 |
|
|
|
421 |
|
|
// Insert search select
|
422 |
|
|
if(SEARCH == 'private') {
|
423 |
|
|
$template->set_var('PRIVATE_SEARCH', 'selected');
|
424 |
|
|
} elseif(SEARCH == 'registered') {
|
425 |
|
|
$template->set_var('REGISTERED_SEARCH', 'selected');
|
426 |
|
|
} elseif(SEARCH == 'none') {
|
427 |
|
|
$template->set_var('NONE_SEARCH', 'selected');
|
428 |
|
|
}
|
429 |
|
|
|
430 |
|
|
// Work-out if 777 permissions are set
|
431 |
|
|
if(STRING_FILE_MODE == '0777' AND STRING_DIR_MODE == '0777') {
|
432 |
|
|
$template->set_var('WORLD_WRITEABLE_SELECTED', ' checked');
|
433 |
|
|
}
|
434 |
|
|
|
435 |
|
|
// Work-out which file mode boxes are checked
|
436 |
|
|
if(extract_permission(STRING_FILE_MODE, 'u', 'r')) {
|
437 |
|
|
$template->set_var('FILE_U_R_CHECKED', 'checked');
|
438 |
|
|
}
|
439 |
|
|
if(extract_permission(STRING_FILE_MODE, 'u', 'w')) {
|
440 |
|
|
$template->set_var('FILE_U_W_CHECKED', 'checked');
|
441 |
|
|
}
|
442 |
|
|
if(extract_permission(STRING_FILE_MODE, 'u', 'e')) {
|
443 |
|
|
$template->set_var('FILE_U_E_CHECKED', 'checked');
|
444 |
|
|
}
|
445 |
|
|
if(extract_permission(STRING_FILE_MODE, 'g', 'r')) {
|
446 |
|
|
$template->set_var('FILE_G_R_CHECKED', 'checked');
|
447 |
|
|
}
|
448 |
|
|
if(extract_permission(STRING_FILE_MODE, 'g', 'w')) {
|
449 |
|
|
$template->set_var('FILE_G_W_CHECKED', 'checked');
|
450 |
|
|
}
|
451 |
|
|
if(extract_permission(STRING_FILE_MODE, 'g', 'e')) {
|
452 |
|
|
$template->set_var('FILE_G_E_CHECKED', 'checked');
|
453 |
|
|
}
|
454 |
|
|
if(extract_permission(STRING_FILE_MODE, 'o', 'r')) {
|
455 |
|
|
$template->set_var('FILE_O_R_CHECKED', 'checked');
|
456 |
|
|
}
|
457 |
|
|
if(extract_permission(STRING_FILE_MODE, 'o', 'w')) {
|
458 |
|
|
$template->set_var('FILE_O_W_CHECKED', 'checked');
|
459 |
|
|
}
|
460 |
|
|
if(extract_permission(STRING_FILE_MODE, 'o', 'e')) {
|
461 |
|
|
$template->set_var('FILE_O_E_CHECKED', 'checked');
|
462 |
|
|
}
|
463 |
|
|
// Work-out which dir mode boxes are checked
|
464 |
|
|
if(extract_permission(STRING_DIR_MODE, 'u', 'r')) {
|
465 |
|
|
$template->set_var('DIR_U_R_CHECKED', 'checked');
|
466 |
|
|
}
|
467 |
|
|
if(extract_permission(STRING_DIR_MODE, 'u', 'w')) {
|
468 |
|
|
$template->set_var('DIR_U_W_CHECKED', 'checked');
|
469 |
|
|
}
|
470 |
|
|
if(extract_permission(STRING_DIR_MODE, 'u', 'e')) {
|
471 |
|
|
$template->set_var('DIR_U_E_CHECKED', 'checked');
|
472 |
|
|
}
|
473 |
|
|
if(extract_permission(STRING_DIR_MODE, 'g', 'r')) {
|
474 |
|
|
$template->set_var('DIR_G_R_CHECKED', 'checked');
|
475 |
|
|
}
|
476 |
|
|
if(extract_permission(STRING_DIR_MODE, 'g', 'w')) {
|
477 |
|
|
$template->set_var('DIR_G_W_CHECKED', 'checked');
|
478 |
|
|
}
|
479 |
|
|
if(extract_permission(STRING_DIR_MODE, 'g', 'e')) {
|
480 |
|
|
$template->set_var('DIR_G_E_CHECKED', 'checked');
|
481 |
|
|
}
|
482 |
|
|
if(extract_permission(STRING_DIR_MODE, 'o', 'r')) {
|
483 |
|
|
$template->set_var('DIR_O_R_CHECKED', 'checked');
|
484 |
|
|
}
|
485 |
|
|
if(extract_permission(STRING_DIR_MODE, 'o', 'w')) {
|
486 |
|
|
$template->set_var('DIR_O_W_CHECKED', 'checked');
|
487 |
|
|
}
|
488 |
|
|
if(extract_permission(STRING_DIR_MODE, 'o', 'e')) {
|
489 |
|
|
$template->set_var('DIR_O_E_CHECKED', 'checked');
|
490 |
|
|
}
|
491 |
|
|
|
492 |
|
|
// Insert WYSIWYG style value into template
|
493 |
|
|
$template->set_var('WYSIWYG_STYLE', $admin->strip_slashes_dummy(WYSIWYG_STYLE));
|
494 |
|
|
|
495 |
|
|
// Insert Server Email value into template
|
496 |
|
|
$template->set_var('SERVER_EMAIL', SERVER_EMAIL);
|
497 |
|
|
|
498 |
|
|
// Insert language headings
|
499 |
|
|
$template->set_var(array(
|
500 |
|
|
'HEADING_GENERAL_SETTINGS' => $HEADING['GENERAL_SETTINGS'],
|
501 |
|
|
'HEADING_DEFAULT_SETTINGS' => $HEADING['DEFAULT_SETTINGS'],
|
502 |
|
|
'HEADING_SEARCH_SETTINGS' => $HEADING['SEARCH_SETTINGS'],
|
503 |
|
|
'HEADING_FILESYSTEM_SETTINGS' => $HEADING['FILESYSTEM_SETTINGS']
|
504 |
|
|
)
|
505 |
|
|
);
|
506 |
|
|
// Insert language text and messages
|
507 |
|
|
$template->set_var(array(
|
508 |
|
|
'TEXT_WEBSITE_TITLE' => $TEXT['WEBSITE_TITLE'],
|
509 |
|
|
'TEXT_WEBSITE_DESCRIPTION' => $TEXT['WEBSITE_DESCRIPTION'],
|
510 |
|
|
'TEXT_WEBSITE_KEYWORDS' => $TEXT['WEBSITE_KEYWORDS'],
|
511 |
|
|
'TEXT_WEBSITE_HEADER' => $TEXT['WEBSITE_HEADER'],
|
512 |
|
|
'TEXT_WEBSITE_FOOTER' => $TEXT['WEBSITE_FOOTER'],
|
513 |
|
|
'TEXT_HEADER' => $TEXT['HEADER'],
|
514 |
|
|
'TEXT_FOOTER' => $TEXT['FOOTER'],
|
515 |
|
|
'TEXT_VISIBILITY' => $TEXT['VISIBILITY'],
|
516 |
|
|
'TEXT_RESULTS_HEADER' => $TEXT['RESULTS_HEADER'],
|
517 |
|
|
'TEXT_RESULTS_LOOP' => $TEXT['RESULTS_LOOP'],
|
518 |
|
|
'TEXT_RESULTS_FOOTER' => $TEXT['RESULTS_FOOTER'],
|
519 |
|
|
'TEXT_NO_RESULTS' => $TEXT['NO_RESULTS'],
|
520 |
|
|
'TEXT_TEXT' => $TEXT['TEXT'],
|
521 |
|
|
'TEXT_DEFAULT' => $TEXT['DEFAULT'],
|
522 |
|
|
'TEXT_LANGUAGE' => $TEXT['LANGUAGE'],
|
523 |
|
|
'TEXT_TIMEZONE' => $TEXT['TIMEZONE'],
|
524 |
|
|
'TEXT_DATE_FORMAT' => $TEXT['DATE_FORMAT'],
|
525 |
|
|
'TEXT_TIME_FORMAT' => $TEXT['TIME_FORMAT'],
|
526 |
|
|
'TEXT_TEMPLATE' => $TEXT['TEMPLATE'],
|
527 |
52
|
stefan
|
'TEXT_EDITOR' => $TEXT['WYSIWYG_EDITOR'],
|
528 |
45
|
stefan
|
'TEXT_PAGE_LEVEL_LIMIT' => $TEXT['PAGE_LEVEL_LIMIT'],
|
529 |
|
|
'TEXT_INTRO_PAGE' => $TEXT['INTRO_PAGE'],
|
530 |
|
|
'TEXT_FRONTEND' => $TEXT['FRONTEND'],
|
531 |
|
|
'TEXT_LOGIN' => $TEXT['LOGIN'],
|
532 |
|
|
'TEXT_SIGNUP' => $TEXT['SIGNUP'],
|
533 |
|
|
'TEXT_PHP_ERROR_LEVEL' => $TEXT['PHP_ERROR_LEVEL'],
|
534 |
|
|
'TEXT_PAGE_EXTENSION' => $TEXT['PAGE_EXTENSION'],
|
535 |
|
|
'TEXT_PAGE_SPACER' => $TEXT['PAGE_SPACER'],
|
536 |
|
|
'TEXT_SERVER_OPERATING_SYSTEM' => $TEXT['SERVER_OPERATING_SYSTEM'],
|
537 |
|
|
'TEXT_LINUX_UNIX_BASED' => $TEXT['LINUX_UNIX_BASED'],
|
538 |
|
|
'TEXT_WINDOWS' => $TEXT['WINDOWS'],
|
539 |
|
|
'TEXT_ADMIN' => $TEXT['ADMIN'],
|
540 |
|
|
'TEXT_TYPE' => $TEXT['TYPE'],
|
541 |
|
|
'TEXT_DATABASE' => $TEXT['DATABASE'],
|
542 |
|
|
'TEXT_HOST' => $TEXT['HOST'],
|
543 |
|
|
'TEXT_USERNAME' => $TEXT['USERNAME'],
|
544 |
|
|
'TEXT_PASSWORD' => $TEXT['PASSWORD'],
|
545 |
|
|
'TEXT_NAME' => $TEXT['NAME'],
|
546 |
|
|
'TEXT_TABLE_PREFIX' => $TEXT['TABLE_PREFIX'],
|
547 |
|
|
'TEXT_SAVE' => $TEXT['SAVE'],
|
548 |
|
|
'TEXT_RESET' => $TEXT['RESET'],
|
549 |
|
|
'TEXT_CHANGES' => $TEXT['CHANGES'],
|
550 |
|
|
'TEXT_ENABLED' => $TEXT['ENABLED'],
|
551 |
|
|
'TEXT_DISABLED' => $TEXT['DISABLED'],
|
552 |
|
|
'TEXT_MANAGE_SECTIONS' => $HEADING['MANAGE_SECTIONS'],
|
553 |
|
|
'TEXT_MANAGE' => $TEXT['MANAGE'],
|
554 |
|
|
'TEXT_SEARCH' => $TEXT['SEARCH'],
|
555 |
|
|
'TEXT_PUBLIC' => $TEXT['PUBLIC'],
|
556 |
|
|
'TEXT_PRIVATE' => $TEXT['PRIVATE'],
|
557 |
|
|
'TEXT_REGISTERED' => $TEXT['REGISTERED'],
|
558 |
|
|
'TEXT_NONE' => $TEXT['NONE'],
|
559 |
|
|
'TEXT_FILES' => strtoupper(substr($TEXT['FILES'], 0, 1)).substr($TEXT['FILES'], 1),
|
560 |
|
|
'TEXT_DIRECTORIES' => $TEXT['DIRECTORIES'],
|
561 |
|
|
'TEXT_FILESYSTEM_PERMISSIONS' => $TEXT['FILESYSTEM_PERMISSIONS'],
|
562 |
|
|
'TEXT_USER' => $TEXT['USER'],
|
563 |
|
|
'TEXT_GROUP' => $TEXT['GROUP'],
|
564 |
|
|
'TEXT_OTHERS' => $TEXT['OTHERS'],
|
565 |
|
|
'TEXT_READ' => $TEXT['READ'],
|
566 |
|
|
'TEXT_WRITE' => $TEXT['WRITE'],
|
567 |
|
|
'TEXT_EXECUTE' => $TEXT['EXECUTE'],
|
568 |
|
|
'TEXT_SMART_LOGIN' => $TEXT['SMART_LOGIN'],
|
569 |
|
|
'TEXT_MULTIPLE_MENUS' => $TEXT['MULTIPLE_MENUS'],
|
570 |
|
|
'TEXT_HOMEPAGE_REDIRECTION' => $TEXT['HOMEPAGE_REDIRECTION'],
|
571 |
|
|
'TEXT_PAGE_LANGUAGES' => $TEXT['PAGE_LANGUAGES'],
|
572 |
|
|
'TEXT_SECTION_BLOCKS' => $TEXT['SECTION_BLOCKS'],
|
573 |
|
|
'TEXT_PLEASE_SELECT' => $TEXT['PLEASE_SELECT'],
|
574 |
|
|
'TEXT_PAGE_TRASH' => $TEXT['PAGE_TRASH'],
|
575 |
|
|
'TEXT_INLINE' => $TEXT['INLINE'],
|
576 |
|
|
'TEXT_SEPARATE' => $TEXT['SEPARATE'],
|
577 |
|
|
'TEXT_HOME_FOLDERS' => $TEXT['HOME_FOLDERS'],
|
578 |
|
|
'TEXT_WYSIWYG_STYLE' => $TEXT['WYSIWYG_STYLE'],
|
579 |
|
|
'TEXT_SERVER_EMAIL' => $TEXT['SERVER_EMAIL'],
|
580 |
|
|
'TEXT_WORLD_WRITEABLE_FILE_PERMISSIONS' => $TEXT['WORLD_WRITEABLE_FILE_PERMISSIONS'],
|
581 |
|
|
'MODE_SWITCH_WARNING' => $MESSAGE['SETTINGS']['MODE_SWITCH_WARNING'],
|
582 |
|
|
'WORLD_WRITEABLE_WARNING' => $MESSAGE['SETTINGS']['WORLD_WRITEABLE_WARNING']
|
583 |
|
|
)
|
584 |
|
|
);
|
585 |
|
|
|
586 |
|
|
// Parse template objects output
|
587 |
|
|
$template->parse('main', 'main_block', false);
|
588 |
|
|
$template->pparse('output', 'page');
|
589 |
|
|
|
590 |
|
|
$admin->print_footer();
|
591 |
|
|
|
592 |
|
|
?>
|