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