1
|
<?php
|
2
|
/*
|
3
|
*
|
4
|
* About WebsiteBaker
|
5
|
*
|
6
|
* Website Baker is a PHP-based Content Management System (CMS)
|
7
|
* designed with one goal in mind: to enable its users to produce websites
|
8
|
* with ease.
|
9
|
*
|
10
|
* LICENSE INFORMATION
|
11
|
*
|
12
|
* WebsiteBaker is free software; you can redistribute it and/or
|
13
|
* modify it under the terms of the GNU General Public License
|
14
|
* as published by the Free Software Foundation; either version 2
|
15
|
* of the License, or (at your option) any later version.
|
16
|
*
|
17
|
* WebsiteBaker is distributed in the hope that it will be useful,
|
18
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
19
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
20
|
* See the GNU General Public License for more details.
|
21
|
*
|
22
|
* You should have received a copy of the GNU General Public License
|
23
|
* along with this program; if not, write to the Free Software
|
24
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
25
|
*
|
26
|
* WebsiteBaker Extra Information
|
27
|
*
|
28
|
*
|
29
|
*/
|
30
|
/**
|
31
|
*
|
32
|
* @category admin
|
33
|
* @package pages
|
34
|
* @author WebsiteBaker Project
|
35
|
* @copyright 2004-2009, Ryan Djurovich
|
36
|
* @copyright 2009-2010, Website Baker Org. e.V.
|
37
|
* @link http://www.websitebaker2.org/
|
38
|
* @license http://www.gnu.org/licenses/gpl.html
|
39
|
* @platform WebsiteBaker 2.8.x
|
40
|
* @requirements PHP 4.3.4 and higher
|
41
|
* @version $Id: settings.php 1271 2010-01-23 02:30:24Z Luisehahne $
|
42
|
* @filesource $HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/admin/pages/settings.php $
|
43
|
* @lastmodified $Date: 2010-01-23 03:30:24 +0100 (Sat, 23 Jan 2010) $
|
44
|
*
|
45
|
*/
|
46
|
|
47
|
// Get page id
|
48
|
if(!isset($_GET['page_id']) OR !is_numeric($_GET['page_id'])) {
|
49
|
header("Location: index.php");
|
50
|
exit(0);
|
51
|
} else {
|
52
|
$page_id = $_GET['page_id'];
|
53
|
}
|
54
|
|
55
|
// Create new admin object
|
56
|
require('../../config.php');
|
57
|
require_once(WB_PATH.'/framework/class.admin.php');
|
58
|
$admin = new admin('Pages', 'pages_settings');
|
59
|
|
60
|
// Include the WB functions file
|
61
|
require_once(WB_PATH.'/framework/functions-utf8.php');
|
62
|
|
63
|
// Get perms
|
64
|
$database = new database();
|
65
|
$results = $database->query("SELECT * FROM ".TABLE_PREFIX."pages WHERE page_id = '$page_id'");
|
66
|
$results_array = $results->fetchRow();
|
67
|
$old_admin_groups = explode(',', $results_array['admin_groups']);
|
68
|
$old_admin_users = explode(',', $results_array['admin_users']);
|
69
|
|
70
|
// Work-out if we should check for existing page_code
|
71
|
$field_sql = $database->query("DESCRIBE ".TABLE_PREFIX."pages page_code");
|
72
|
$field_set = $field_sql->numRows();
|
73
|
$in_old_group = FALSE;
|
74
|
foreach($admin->get_groups_id() as $cur_gid){
|
75
|
if (in_array($cur_gid, $old_admin_groups)) {
|
76
|
$in_old_group = TRUE;
|
77
|
}
|
78
|
}
|
79
|
if((!$in_old_group) AND !is_numeric(array_search($admin->get_user_id(), $old_admin_users))) {
|
80
|
$admin->print_error($MESSAGE['PAGES']['INSUFFICIENT_PERMISSIONS']);
|
81
|
}
|
82
|
|
83
|
// Get page details
|
84
|
/* $database = new database(); */
|
85
|
$query = "SELECT * FROM ".TABLE_PREFIX."pages WHERE page_id = '$page_id'";
|
86
|
$results = $database->query($query);
|
87
|
if($database->is_error()) {
|
88
|
$admin->print_header();
|
89
|
$admin->print_error($database->get_error());
|
90
|
}
|
91
|
if($results->numRows() == 0) {
|
92
|
$admin->print_header();
|
93
|
$admin->print_error($MESSAGE['PAGES']['NOT_FOUND']);
|
94
|
}
|
95
|
$results_array = $results->fetchRow();
|
96
|
|
97
|
// Get display name of person who last modified the page
|
98
|
$user=$admin->get_user_details($results_array['modified_by']);
|
99
|
|
100
|
// Convert the unix ts for modified_when to human a readable form
|
101
|
if($results_array['modified_when'] != 0) {
|
102
|
$modified_ts = gmdate(TIME_FORMAT.', '.DATE_FORMAT, $results_array['modified_when']+TIMEZONE);
|
103
|
} else {
|
104
|
$modified_ts = 'Unknown';
|
105
|
}
|
106
|
|
107
|
// Setup template object, parse vars to it, then parse it
|
108
|
$template = new Template(THEME_PATH.'/templates');
|
109
|
$template->set_file('page', 'pages_settings.htt');
|
110
|
$template->set_block('page', 'main_block', 'main');
|
111
|
|
112
|
$template->set_var(array(
|
113
|
'PAGE_ID' => $results_array['page_id'],
|
114
|
'PAGE_TITLE' => ($results_array['page_title']),
|
115
|
'MENU_TITLE' => ($results_array['menu_title']),
|
116
|
'DESCRIPTION' => ($results_array['description']),
|
117
|
'KEYWORDS' => ($results_array['keywords']),
|
118
|
'MODIFIED_BY' => $user['display_name'],
|
119
|
'MODIFIED_BY_USERNAME' => $user['username'],
|
120
|
'MODIFIED_WHEN' => $modified_ts,
|
121
|
'ADMIN_URL' => ADMIN_URL,
|
122
|
'WB_URL' => WB_URL,
|
123
|
'WB_PATH' => WB_PATH,
|
124
|
'THEME_URL' => THEME_URL
|
125
|
)
|
126
|
);
|
127
|
|
128
|
// Work-out if we should show the "manage sections" link
|
129
|
$query_sections = $database->query("SELECT section_id FROM ".TABLE_PREFIX."sections WHERE page_id = '$page_id' AND module = 'menu_link'");
|
130
|
if($query_sections->numRows() > 0) {
|
131
|
$template->set_var('DISPLAY_MANAGE_SECTIONS', 'display:none;');
|
132
|
} elseif(MANAGE_SECTIONS == 'enabled') {
|
133
|
$template->set_var('TEXT_MANAGE_SECTIONS', $HEADING['MANAGE_SECTIONS']);
|
134
|
} else {
|
135
|
$template->set_var('DISPLAY_MANAGE_SECTIONS', 'display:none;');
|
136
|
}
|
137
|
|
138
|
// Visibility
|
139
|
if($results_array['visibility'] == 'public') {
|
140
|
$template->set_var('PUBLIC_SELECTED', ' selected="selected"');
|
141
|
} elseif($results_array['visibility'] == 'private') {
|
142
|
$template->set_var('PRIVATE_SELECTED', ' selected="selected"');
|
143
|
} elseif($results_array['visibility'] == 'registered') {
|
144
|
$template->set_var('REGISTERED_SELECTED', ' selected="selected"');
|
145
|
} elseif($results_array['visibility'] == 'hidden') {
|
146
|
$template->set_var('HIDDEN_SELECTED', ' selected="selected"');
|
147
|
} elseif($results_array['visibility'] == 'display:none;') {
|
148
|
$template->set_var('NO_VIS_SELECTED', ' selected="selected"');
|
149
|
}
|
150
|
// Group list 1 (admin_groups)
|
151
|
$admin_groups = explode(',', str_replace('_', '', $results_array['admin_groups']));
|
152
|
|
153
|
$query = "SELECT * FROM ".TABLE_PREFIX."groups";
|
154
|
|
155
|
$get_groups = $database->query($query);
|
156
|
$template->set_block('main_block', 'group_list_block', 'group_list');
|
157
|
// Insert admin group and current group first
|
158
|
$admin_group_name = $get_groups->fetchRow();
|
159
|
$template->set_var(array(
|
160
|
'ID' => 1,
|
161
|
'TOGGLE' => '',
|
162
|
'DISABLED' => ' disabled="disabled"',
|
163
|
'LINK_COLOR' => '000000',
|
164
|
'CURSOR' => 'default',
|
165
|
'NAME' => $admin_group_name['name'],
|
166
|
'CHECKED' => ' checked="checked"'
|
167
|
)
|
168
|
);
|
169
|
$template->parse('group_list', 'group_list_block', true);
|
170
|
while($group = $get_groups->fetchRow()) {
|
171
|
// check if the user is a member of this group
|
172
|
$flag_disabled = '';
|
173
|
$flag_checked = '';
|
174
|
$flag_cursor = 'pointer';
|
175
|
$flag_color = '';
|
176
|
if (in_array($group["group_id"], $admin->get_groups_id())) {
|
177
|
$flag_disabled = ''; //' disabled';
|
178
|
$flag_checked = ''; //' checked';
|
179
|
$flag_cursor = 'default';
|
180
|
$flag_color = '000000';
|
181
|
}
|
182
|
|
183
|
// Check if the group is allowed to edit pages
|
184
|
$system_permissions = explode(',', $group['system_permissions']);
|
185
|
if(is_numeric(array_search('pages_modify', $system_permissions))) {
|
186
|
$template->set_var(array(
|
187
|
'ID' => $group['group_id'],
|
188
|
'TOGGLE' => $group['group_id'],
|
189
|
'DISABLED' => $flag_disabled,
|
190
|
'LINK_COLOR' => $flag_color,
|
191
|
'CURSOR' => $flag_cursor,
|
192
|
'NAME' => $group['name'],
|
193
|
'CHECKED' => $flag_checked
|
194
|
)
|
195
|
);
|
196
|
if(is_numeric(array_search($group['group_id'], $admin_groups))) {
|
197
|
$template->set_var('CHECKED', ' checked="checked"');
|
198
|
} else {
|
199
|
if (!$flag_checked) $template->set_var('CHECKED', '');
|
200
|
}
|
201
|
$template->parse('group_list', 'group_list_block', true);
|
202
|
}
|
203
|
}
|
204
|
// Group list 2 (viewing_groups)
|
205
|
$viewing_groups = explode(',', str_replace('_', '', $results_array['viewing_groups']));
|
206
|
|
207
|
$query = "SELECT * FROM ".TABLE_PREFIX."groups";
|
208
|
|
209
|
$get_groups = $database->query($query);
|
210
|
$template->set_block('main_block', 'group_list_block2', 'group_list2');
|
211
|
// Insert admin group and current group first
|
212
|
$admin_group_name = $get_groups->fetchRow();
|
213
|
$template->set_var(array(
|
214
|
'ID' => 1,
|
215
|
'TOGGLE' => '',
|
216
|
'DISABLED' => ' disabled="disabled"',
|
217
|
'LINK_COLOR' => '000000',
|
218
|
'CURSOR' => 'default',
|
219
|
'NAME' => $admin_group_name['name'],
|
220
|
'CHECKED' => ' checked="checked"'
|
221
|
)
|
222
|
);
|
223
|
$template->parse('group_list2', 'group_list_block2', true);
|
224
|
|
225
|
while($group = $get_groups->fetchRow()) {
|
226
|
// check if the user is a member of this group
|
227
|
$flag_disabled = '';
|
228
|
$flag_checked = '';
|
229
|
$flag_cursor = 'pointer';
|
230
|
$flag_color = '';
|
231
|
if (in_array($group["group_id"], $admin->get_groups_id())) {
|
232
|
$flag_disabled = ''; //' disabled';
|
233
|
$flag_checked = ''; //' checked';
|
234
|
$flag_cursor = 'default';
|
235
|
$flag_color = '000000';
|
236
|
}
|
237
|
|
238
|
$template->set_var(array(
|
239
|
'ID' => $group['group_id'],
|
240
|
'TOGGLE' => $group['group_id'],
|
241
|
'DISABLED' => $flag_disabled,
|
242
|
'LINK_COLOR' => $flag_color,
|
243
|
'CURSOR' => $flag_cursor,
|
244
|
'NAME' => $group['name'],
|
245
|
'CHECKED' => $flag_checked
|
246
|
)
|
247
|
);
|
248
|
if(is_numeric(array_search($group['group_id'], $viewing_groups))) {
|
249
|
$template->set_var('CHECKED', 'checked="checked"');
|
250
|
} else {
|
251
|
if (!$flag_checked) $template->set_var('CHECKED', '');
|
252
|
}
|
253
|
$template->parse('group_list2', 'group_list_block2', true);
|
254
|
}
|
255
|
// Show private viewers
|
256
|
if($results_array['visibility'] == 'private' OR $results_array['visibility'] == 'registered') {
|
257
|
$template->set_var('DISPLAY_VIEWERS', '');
|
258
|
} else {
|
259
|
$template->set_var('DISPLAY_VIEWERS', 'display:none;');
|
260
|
}
|
261
|
|
262
|
//-- insert page_code 20090904-->
|
263
|
$template->set_var('DISPLAY_CODE_PAGE_LIST', ' id="multi_lingual" style="display:none;"');
|
264
|
// Work-out if page languages feature is enabled
|
265
|
if((defined('PAGE_LANGUAGES') && PAGE_LANGUAGES) && $field_set && file_exists(WB_PATH.'/modules/mod_multilingual/update_keys.php') )
|
266
|
{
|
267
|
// workout field is set but module missing
|
268
|
$TEXT['PAGE_CODE'] = empty($TEXT['PAGE_CODE']) ? 'Pagecode' : $TEXT['PAGE_CODE'];
|
269
|
$template->set_var( array(
|
270
|
'DISPLAY_CODE_PAGE_LIST' => ' id="multi_lingual"',
|
271
|
'TEXT_PAGE_CODE' => '<a href="'.WB_URL.'/modules/mod_multilingual/update_keys.php?page_id='.$page_id.'">'.$TEXT['PAGE_CODE'].'</a>'
|
272
|
)
|
273
|
);
|
274
|
|
275
|
// Page_code list
|
276
|
/* $database = new database(); */
|
277
|
function page_code_list($parent) {
|
278
|
global $admin, $database, $template, $results_array, $pageCode;
|
279
|
$default_language = DEFAULT_LANGUAGE;
|
280
|
$query = "SELECT * FROM ".TABLE_PREFIX."pages WHERE parent = '$parent' AND language = '$default_language' ORDER BY position ASC";
|
281
|
$get_pages = $database->query($query);
|
282
|
while($page = $get_pages->fetchRow()) {
|
283
|
if($admin->page_is_visible($page)==false)
|
284
|
continue;
|
285
|
$template->set_var('FLAG_CODE_ICON',' none ');
|
286
|
if( $page['parent'] == 0 ) {
|
287
|
$template->set_var('FLAG_CODE_ICON','url('.THEME_URL.'/images/flags/'.strtolower($page['language']).'.png)');
|
288
|
}
|
289
|
// If the current page cannot be parent, then its children neither
|
290
|
$list_next_level = true;
|
291
|
// Stop users from adding pages with a level of more than the set page level limit
|
292
|
if($page['level']+1 < PAGE_LEVEL_LIMIT) {
|
293
|
// Get user perms
|
294
|
$admin_groups = explode(',', str_replace('_', '', $page['admin_groups']));
|
295
|
$admin_users = explode(',', str_replace('_', '', $page['admin_users']));
|
296
|
|
297
|
$in_group = FALSE;
|
298
|
foreach($admin->get_groups_id() as $cur_gid){
|
299
|
if (in_array($cur_gid, $admin_groups))
|
300
|
{
|
301
|
$in_group = TRUE;
|
302
|
}
|
303
|
}
|
304
|
|
305
|
if(($in_group) OR is_numeric(array_search($admin->get_user_id(), $admin_users))) {
|
306
|
$can_modify = true;
|
307
|
} else {
|
308
|
$can_modify = false;
|
309
|
}
|
310
|
|
311
|
$title_prefix = '';
|
312
|
for($i = 1; $i <= $page['level']; $i++) { $title_prefix .= ' - - '; }
|
313
|
// $space = str_repeat(' ', 3); $space.'<'..'>'
|
314
|
$template->set_var(array(
|
315
|
'VALUE' => $page['page_code'],
|
316
|
'PAGE_VALUE' => $title_prefix.$page['page_code'],
|
317
|
'PAGE_CODE' => $title_prefix.$page['menu_title']
|
318
|
)
|
319
|
);
|
320
|
if($results_array['page_code'] == $page['page_code']) {
|
321
|
$template->set_var('SELECTED', ' selected="selected"');
|
322
|
} elseif($results_array['page_code'] == $page['page_code']) {
|
323
|
$template->set_var('SELECTED', ' disabled="disabled" class="disabled"');
|
324
|
$list_next_level=false;
|
325
|
} elseif($can_modify != true) {
|
326
|
$template->set_var('SELECTED', ' disabled="disabled" class="disabled"');
|
327
|
} else {
|
328
|
$template->set_var('SELECTED', '');
|
329
|
}
|
330
|
$template->parse('page_code_list', 'page_code_list_block', true);
|
331
|
}
|
332
|
if ($list_next_level)
|
333
|
page_code_list($page['page_id']);
|
334
|
}
|
335
|
}
|
336
|
// Insert code_page values from page to modify
|
337
|
$template->set_block('main_block', 'page_code_list_block', 'page_code_list');
|
338
|
if($admin->get_permission('pages_add_l0') == true OR $results_array['level'] == 0) {
|
339
|
if($results_array['parent'] == 0) { $selected = ' selected'; } else { $selected = ''; }
|
340
|
$template->set_var(array(
|
341
|
'VALUE' => '',
|
342
|
'PAGE_CODE' => $TEXT['NONE'],
|
343
|
'PAGE_VALUE' => '',
|
344
|
'SELECTED' => $selected
|
345
|
)
|
346
|
);
|
347
|
$template->parse('page_code_list', 'page_code_list_block', true);
|
348
|
}
|
349
|
// get pagecode form this page_id
|
350
|
page_code_list(0);
|
351
|
}
|
352
|
//-- page code -->
|
353
|
|
354
|
// Parent page list
|
355
|
/* $database = new database(); */
|
356
|
function parent_list($parent) {
|
357
|
global $admin, $database, $template, $results_array,$field_set;
|
358
|
$query = "SELECT * FROM ".TABLE_PREFIX."pages WHERE parent = '$parent' ORDER BY position ASC";
|
359
|
$get_pages = $database->query($query);
|
360
|
while($page = $get_pages->fetchRow()) {
|
361
|
if($admin->page_is_visible($page)==false)
|
362
|
continue;
|
363
|
// if parent = 0 set flag_icon
|
364
|
$template->set_var('FLAG_ROOT_ICON',' none ');
|
365
|
if( $page['parent'] == 0 && $field_set) {
|
366
|
$template->set_var('FLAG_ROOT_ICON','url('.THEME_URL.'/images/flags/'.strtolower($page['language']).'.png)');
|
367
|
}
|
368
|
// If the current page cannot be parent, then its children neither
|
369
|
$list_next_level = true;
|
370
|
// Stop users from adding pages with a level of more than the set page level limit
|
371
|
if($page['level']+1 < PAGE_LEVEL_LIMIT) {
|
372
|
// Get user perms
|
373
|
$admin_groups = explode(',', str_replace('_', '', $page['admin_groups']));
|
374
|
$admin_users = explode(',', str_replace('_', '', $page['admin_users']));
|
375
|
$in_group = FALSE;
|
376
|
foreach($admin->get_groups_id() as $cur_gid){
|
377
|
if (in_array($cur_gid, $admin_groups)) {
|
378
|
$in_group = TRUE;
|
379
|
}
|
380
|
}
|
381
|
if(($in_group) OR is_numeric(array_search($admin->get_user_id(), $admin_users))) {
|
382
|
$can_modify = true;
|
383
|
} else {
|
384
|
$can_modify = false;
|
385
|
}
|
386
|
// Title -'s prefix
|
387
|
$title_prefix = '';
|
388
|
for($i = 1; $i <= $page['level']; $i++) { $title_prefix .= ' - '; }
|
389
|
$template->set_var(array(
|
390
|
'ID' => $page['page_id'],
|
391
|
'TITLE' => ($title_prefix.$page['menu_title']),
|
392
|
'MENU-TITLE' => ($title_prefix.$page['menu_title']),
|
393
|
'PAGE-TITLE' => ($title_prefix.$page['page_title']),
|
394
|
'FLAG_ICON' => ' none ',
|
395
|
));
|
396
|
|
397
|
if($results_array['parent'] == $page['page_id']) {
|
398
|
$template->set_var('SELECTED', ' selected="selected"');
|
399
|
} elseif($results_array['page_id'] == $page['page_id']) {
|
400
|
$template->set_var('SELECTED', ' disabled="disabled" class="disabled"');
|
401
|
$list_next_level=false;
|
402
|
} elseif($can_modify != true) {
|
403
|
$template->set_var('SELECTED', ' disabled="disabled" class="disabled"');
|
404
|
} else {
|
405
|
$template->set_var('SELECTED', '');
|
406
|
}
|
407
|
$template->parse('page_list2', 'page_list_block2', true);
|
408
|
}
|
409
|
if ($list_next_level)
|
410
|
parent_list($page['page_id']);
|
411
|
}
|
412
|
}
|
413
|
|
414
|
$template->set_block('main_block', 'page_list_block2', 'page_list2');
|
415
|
if($admin->get_permission('pages_add_l0') == true OR $results_array['level'] == 0) {
|
416
|
if($results_array['parent'] == 0) {
|
417
|
$selected = ' selected="selected"';
|
418
|
} else {
|
419
|
$selected = '';
|
420
|
}
|
421
|
$template->set_var(array(
|
422
|
'ID' => '0',
|
423
|
'TITLE' => $TEXT['NONE'],
|
424
|
'SELECTED' => $selected
|
425
|
)
|
426
|
);
|
427
|
$template->parse('page_list2', 'page_list_block2', true);
|
428
|
}
|
429
|
parent_list(0);
|
430
|
|
431
|
if($modified_ts == 'Unknown') {
|
432
|
$template->set_var('DISPLAY_MODIFIED', 'hide');
|
433
|
} else {
|
434
|
$template->set_var('DISPLAY_MODIFIED', '');
|
435
|
}
|
436
|
// Templates list
|
437
|
$template->set_block('main_block', 'template_list_block', 'template_list');
|
438
|
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'template' and function = 'template' order by name");
|
439
|
if($result->numRows() > 0) {
|
440
|
while($addon = $result->fetchRow()) {
|
441
|
// Check if the user has perms to use this template
|
442
|
if($addon['directory'] == $results_array['template'] OR $admin->get_permission($addon['directory'], 'template') == true) {
|
443
|
$template->set_var('VALUE', $addon['directory']);
|
444
|
$template->set_var('NAME', $addon['name']);
|
445
|
if($addon['directory'] == $results_array['template']) {
|
446
|
$template->set_var('SELECTED', ' selected="selected"');
|
447
|
} else {
|
448
|
$template->set_var('SELECTED', '');
|
449
|
}
|
450
|
$template->parse('template_list', 'template_list_block', true);
|
451
|
}
|
452
|
}
|
453
|
}
|
454
|
|
455
|
// Menu list
|
456
|
if(MULTIPLE_MENUS == false) {
|
457
|
$template->set_var('DISPLAY_MENU_LIST', 'display:none;');
|
458
|
}
|
459
|
// Include template info file (if it exists)
|
460
|
if($results_array['template'] != '') {
|
461
|
$template_location = WB_PATH.'/templates/'.$results_array['template'].'/info.php';
|
462
|
} else {
|
463
|
$template_location = WB_PATH.'/templates/'.DEFAULT_TEMPLATE.'/info.php';
|
464
|
}
|
465
|
if(file_exists($template_location)) {
|
466
|
require($template_location);
|
467
|
}
|
468
|
// Check if $menu is set
|
469
|
if(!isset($menu[1]) OR $menu[1] == '') {
|
470
|
// Make our own menu list
|
471
|
$menu[1] = $TEXT['MAIN'];
|
472
|
}
|
473
|
// Add menu options to the list
|
474
|
$template->set_block('main_block', 'menu_list_block', 'menu_list');
|
475
|
foreach($menu AS $number => $name) {
|
476
|
$template->set_var('NAME', $name);
|
477
|
$template->set_var('VALUE', $number);
|
478
|
if($results_array['menu'] == $number) {
|
479
|
$template->set_var('SELECTED', ' selected="selected"');
|
480
|
} else {
|
481
|
$template->set_var('SELECTED', '');
|
482
|
}
|
483
|
$template->parse('menu_list', 'menu_list_block', true);
|
484
|
}
|
485
|
|
486
|
// Insert language values
|
487
|
$template->set_block('main_block', 'language_list_block', 'language_list');
|
488
|
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'language' order by name");
|
489
|
if($result->numRows() > 0) {
|
490
|
while($addon = $result->fetchRow()) {
|
491
|
$l_codes[$addon['name']] = $addon['directory'];
|
492
|
$l_names[$addon['name']] = entities_to_7bit($addon['name']); // sorting-problem workaround
|
493
|
}
|
494
|
asort($l_names);
|
495
|
foreach($l_names as $l_name=>$v) {
|
496
|
// Insert code and name
|
497
|
$template->set_var(array(
|
498
|
'VALUE' => $l_codes[$l_name],
|
499
|
'NAME' => $l_name,
|
500
|
'FLAG_LANG_ICONS' => 'url('.THEME_URL.'/images/flags/'.strtolower($l_codes[$l_name]).'.png)',
|
501
|
));
|
502
|
// Check if it is selected
|
503
|
if($results_array['language'] == $l_codes[$l_name]) {
|
504
|
$template->set_var('SELECTED', ' selected="selected"');
|
505
|
} else {
|
506
|
$template->set_var('SELECTED', '');
|
507
|
}
|
508
|
$template->parse('language_list', 'language_list_block', true);
|
509
|
}
|
510
|
}
|
511
|
|
512
|
// Select disabled if searching is disabled
|
513
|
if($results_array['searching'] == 0) {
|
514
|
$template->set_var('SEARCHING_DISABLED', ' selected="selected"');
|
515
|
}
|
516
|
// Select what the page target is
|
517
|
switch ($results_array['target']) {
|
518
|
case '_top':
|
519
|
$template->set_var('TOP_SELECTED', ' selected="selected"');
|
520
|
break;
|
521
|
case '_self':
|
522
|
$template->set_var('SELF_SELECTED', ' selected="selected"');
|
523
|
break;
|
524
|
case '_blank':
|
525
|
$template->set_var('BLANK_SELECTED', ' selected="selected"');
|
526
|
break;
|
527
|
}
|
528
|
|
529
|
|
530
|
// Insert language text
|
531
|
$template->set_var(array(
|
532
|
'HEADING_MODIFY_PAGE_SETTINGS' => $HEADING['MODIFY_PAGE_SETTINGS'],
|
533
|
'TEXT_CURRENT_PAGE' => $TEXT['CURRENT_PAGE'],
|
534
|
'TEXT_MODIFY' => $TEXT['MODIFY'],
|
535
|
'TEXT_MODIFY_PAGE' => $HEADING['MODIFY_PAGE'],
|
536
|
'LAST_MODIFIED' => $MESSAGE['PAGES']['LAST_MODIFIED'],
|
537
|
'TEXT_PAGE_TITLE' => $TEXT['PAGE_TITLE'],
|
538
|
'TEXT_MENU_TITLE' => $TEXT['MENU_TITLE'],
|
539
|
'TEXT_TYPE' => $TEXT['TYPE'],
|
540
|
'TEXT_MENU' => $TEXT['MENU'],
|
541
|
'TEXT_PARENT' => $TEXT['PARENT'],
|
542
|
'TEXT_VISIBILITY' => $TEXT['VISIBILITY'],
|
543
|
'TEXT_PUBLIC' => $TEXT['PUBLIC'],
|
544
|
'TEXT_PRIVATE' => $TEXT['PRIVATE'],
|
545
|
'TEXT_REGISTERED' => $TEXT['REGISTERED'],
|
546
|
'TEXT_NONE' => $TEXT['NONE'],
|
547
|
'TEXT_HIDDEN' => $TEXT['HIDDEN'],
|
548
|
'TEXT_TEMPLATE' => $TEXT['TEMPLATE'],
|
549
|
'TEXT_TARGET' => $TEXT['TARGET'],
|
550
|
'TEXT_SYSTEM_DEFAULT' => $TEXT['SYSTEM_DEFAULT'],
|
551
|
'TEXT_PLEASE_SELECT' => $TEXT['PLEASE_SELECT'],
|
552
|
'TEXT_NEW_WINDOW' => $TEXT['NEW_WINDOW'],
|
553
|
'TEXT_SAME_WINDOW' => $TEXT['SAME_WINDOW'],
|
554
|
'TEXT_TOP_FRAME' => $TEXT['TOP_FRAME'],
|
555
|
'TEXT_ADMINISTRATORS' => $TEXT['ADMINISTRATORS'],
|
556
|
'TEXT_ALLOWED_VIEWERS' => $TEXT['ALLOWED_VIEWERS'],
|
557
|
'TEXT_DESCRIPTION' => $TEXT['DESCRIPTION'],
|
558
|
'TEXT_KEYWORDS' => $TEXT['KEYWORDS'],
|
559
|
'TEXT_SEARCHING' => $TEXT['SEARCHING'],
|
560
|
'TEXT_LANGUAGE' => $TEXT['LANGUAGE'],
|
561
|
'TEXT_ENABLED' => $TEXT['ENABLED'],
|
562
|
'TEXT_DISABLED' => $TEXT['DISABLED'],
|
563
|
'TEXT_SAVE' => $TEXT['SAVE'],
|
564
|
'TEXT_RESET' => $TEXT['RESET'],
|
565
|
'LAST_MODIFIED' => $MESSAGE['PAGES']['LAST_MODIFIED'],
|
566
|
'HEADING_MODIFY_PAGE' => $HEADING['MODIFY_PAGE']
|
567
|
) );
|
568
|
|
569
|
$template->parse('main', 'main_block', false);
|
570
|
$template->pparse('output', 'page');
|
571
|
|
572
|
// Print admin footer
|
573
|
$admin->print_footer();
|
574
|
|
575
|
?>
|