Project

General

Profile

1 238 stefan
<?php
2
3 398 Ruebenwurz
// $Id$
4
5 238 stefan
/*
6
7
 Website Baker Project <http://www.websitebaker.org/>
8 399 Ruebenwurz
 Copyright (C) 2004-2007, Ryan Djurovich
9 238 stefan
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
$admin = new admin('Pages', 'pages');
29
// Include the WB functions file
30
require_once(WB_PATH.'/framework/functions.php');
31
32
?>
33 385 Ruebenwurz
<!-- Addition for remembering expanded state of pages -->
34
<script language="JavaScript">
35
function writeSessionCookie (cookieName, cookieValue) {
36
    document.cookie = escape(cookieName) + "=" + escape(cookieValue) + ";";
37
}
38
</script>
39
<!-- End addition -->
40
41 238 stefan
<script type="text/javascript" language="javascript">
42
function toggle_viewers() {
43
	if(document.add.visibility.value == 'private') {
44
		document.getElementById('private_viewers').style.display = 'block';
45
		document.getElementById('registered_viewers').style.display = 'none';
46
	} else if(document.add.visibility.value == 'registered') {
47
		document.getElementById('private_viewers').style.display = 'none';
48
		document.getElementById('registered_viewers').style.display = 'block';
49
	} else {
50
		document.getElementById('private_viewers').style.display = 'none';
51
		document.getElementById('registered_viewers').style.display = 'none';
52
	}
53
}
54
function toggle_visibility(id){
55
	if(document.getElementById(id).style.display == "block") {
56
		document.getElementById(id).style.display = "none";
57 385 Ruebenwurz
		writeSessionCookie (id, "0");//Addition for remembering expanded state of pages
58 238 stefan
	} else {
59
		document.getElementById(id).style.display = "block";
60 385 Ruebenwurz
		writeSessionCookie (id, "1");//Addition for remembering expanded state of pages
61 238 stefan
	}
62
}
63
var plus = new Image;
64
plus.src = "<?php echo ADMIN_URL; ?>/images/plus_16.png";
65
var minus = new Image;
66
minus.src = "<?php echo ADMIN_URL; ?>/images/minus_16.png";
67
function toggle_plus_minus(id) {
68
	var img_src = document.images['plus_minus_' + id].src;
69
	if(img_src == plus.src) {
70
		document.images['plus_minus_' + id].src = minus.src;
71
	} else {
72
		document.images['plus_minus_' + id].src = plus.src;
73
	}
74
}
75
</script>
76
77
<style type="text/css">
78
.pages_list img {
79
	display: block;
80
}
81
ul, li {
82
	list-style: none;
83
	margin: 0;
84
	padding: 0;
85
}
86
.page_list {
87
	display: none;
88
}
89
</style>
90
91
<noscript>
92
	<style type="text/css">
93
	.page_list {
94
		display: block;
95
	}
96
	</style>
97
</noscript>
98
<?php
99
100
function make_list($parent, $editable_pages) {
101
	// Get objects and vars from outside this function
102
	global $admin, $template, $database, $TEXT, $MESSAGE;
103
	?>
104 385 Ruebenwurz
	<ul id="p<?php echo $parent; ?>" <?php if($parent != 0) { echo 'class="page_list" '; if($_COOKIE["p".$parent] =="1"){echo'style="display:block;"'; }} ?>>
105 238 stefan
	<?php
106
	// Get page list from database
107
	$database = new database();
108
	if(PAGE_TRASH != 'inline') {
109
		$query = "SELECT * FROM ".TABLE_PREFIX."pages WHERE parent = '$parent' AND visibility != 'deleted' ORDER BY position ASC";
110
	} else {
111
		$query = "SELECT * FROM ".TABLE_PREFIX."pages WHERE parent = '$parent' ORDER BY position ASC";
112
	}
113
	$get_pages = $database->query($query);
114
115
	// Insert values into main page list
116
	if($get_pages->numRows() > 0)	{
117
		while($page = $get_pages->fetchRow()) {
118
			// Get user perms
119
			$admin_groups = explode(',', str_replace('_', '', $page['admin_groups']));
120
			$admin_users = explode(',', str_replace('_', '', $page['admin_users']));
121
			if(is_numeric(array_search($admin->get_group_id(), $admin_groups)) OR is_numeric(array_search($admin->get_user_id(), $admin_users))) {
122
				if($page['visibility'] == 'deleted') {
123
					if(PAGE_TRASH == 'inline') {
124
						$can_modify = true;
125
						$editable_pages = $editable_pages+1;
126
					} else {
127
						$can_modify = false;
128
					}
129
				} elseif($page['visibility'] != 'deleted') {
130
					$can_modify = true;
131
					$editable_pages = $editable_pages+1;
132
				}
133
			} else {
134
				$can_modify = false;
135
			}
136
137
			// Work out if we should show a plus or not
138
			if(PAGE_TRASH != 'inline') {
139
				$get_page_subs = $database->query("SELECT page_id,admin_groups,admin_users FROM ".TABLE_PREFIX."pages WHERE parent = '".$page['page_id']."' AND visibility!='deleted'");
140
			} else {
141
				$get_page_subs = $database->query("SELECT page_id,admin_groups,admin_users FROM ".TABLE_PREFIX."pages WHERE parent = '".$page['page_id']."'");
142
			}
143
			if($get_page_subs->numRows() > 0) {
144
				$display_plus = true;
145
			} else {
146
				$display_plus = false;
147
			}
148
149
			// Work out how many pages there are for this parent
150
			$num_pages = $get_pages->numRows();
151
			?>
152
153
			<li id="p<?php echo $page['parent']; ?>" style="padding: 2px 0px 2px 0px;">
154
			<table width="720" cellpadding="1" cellspacing="0" border="0" style="background-color: #F0F0F0;">
155
			<tr>
156
				<td width="20" style="padding-left: <?php echo $page['level']*20; ?>px;">
157
					<?php
158
					if($display_plus == true) {
159
					?>
160
					<a href="javascript: toggle_visibility('p<?php echo $page['page_id']; ?>');" title="<?php echo $TEXT['EXPAND'].'/'.$TEXT['COLLAPSE']; ?>">
161 385 Ruebenwurz
						<img src="<?php echo ADMIN_URL; ?>/images/<?php if($_COOKIE["p".$page['page_id']] =="1"){echo"minus";}else{echo"plus";}?>_16.png" onclick="toggle_plus_minus('<?php echo $page['page_id']; ?>');" name="plus_minus_<?php echo $page['page_id']; ?>" border="0" alt="+" />
162 238 stefan
					</a>
163
					<?php
164
					}
165
					?>
166
				</td>
167
				<?php if($admin->get_permission('pages_modify') == true AND $can_modify == true) { ?>
168
				<td>
169 452 Ruebenwurz
					<a href="<?php echo ADMIN_URL; ?>/pages/modify.php?page_id=<?php echo $page['page_id']; ?>" title="<?php echo $TEXT['MODIFY']; ?>"><?php echo ($page['page_title']); ?></a>
170 238 stefan
				</td>
171
				<?php } else { ?>
172
				<td>
173 452 Ruebenwurz
					<?php echo ($page['page_title']); ?>
174 238 stefan
				</td>
175
				<?php } ?>
176
				<td align="left" width="232">
177 452 Ruebenwurz
					<font color="#999999"><?php echo ($page['menu_title']); ?></font>
178 238 stefan
				</td>
179
				<td align="center" valign="middle" width="90">
180
				<?php if($page['visibility'] == 'public') { ?>
181
					<img src="<?php echo ADMIN_URL; ?>/images/visible_16.png" alt="<?php echo $TEXT['VISIBILITY']; ?>: <?php echo $TEXT['PUBLIC']; ?>" border="0" />
182
				<?php } elseif($page['visibility'] == 'private') { ?>
183
					<img src="<?php echo ADMIN_URL; ?>/images/private_16.png" alt="<?php echo $TEXT['VISIBILITY']; ?>: <?php echo $TEXT['PRIVATE']; ?>" border="0" />
184
				<?php } elseif($page['visibility'] == 'registered') { ?>
185
					<img src="<?php echo ADMIN_URL; ?>/images/keys_16.png" alt="<?php echo $TEXT['VISIBILITY']; ?>: <?php echo $TEXT['REGISTERED']; ?>" border="0" />
186
				<?php } elseif($page['visibility'] == 'hidden') { ?>
187
					<img src="<?php echo ADMIN_URL; ?>/images/hidden_16.png" alt="<?php echo $TEXT['VISIBILITY']; ?>: <?php echo $TEXT['HIDDEN']; ?>" border="0" />
188
				<?php } elseif($page['visibility'] == 'none') { ?>
189
					<img src="<?php echo ADMIN_URL; ?>/images/none_16.png" alt="<?php echo $TEXT['VISIBILITY']; ?>: <?php echo $TEXT['NONE']; ?>" border="0" />
190
				<?php } elseif($page['visibility'] == 'deleted') { ?>
191
					<img src="<?php echo ADMIN_URL; ?>/images/deleted_16.png" alt="<?php echo $TEXT['VISIBILITY']; ?>: <?php echo $TEXT['DELETED']; ?>" border="0" />
192
				<?php } ?>
193
				</td>
194
				<td width="20">
195
					<?php if($page['visibility'] != 'deleted') { ?>
196
						<?php if($admin->get_permission('pages_settings') == true AND $can_modify == true) { ?>
197
						<a href="<?php echo ADMIN_URL; ?>/pages/settings.php?page_id=<?php echo $page['page_id']; ?>" title="<?php echo $TEXT['SETTINGS']; ?>">
198
							<img src="<?php echo ADMIN_URL; ?>/images/modify_16.png" border="0" alt="<?php echo $TEXT['SETTINGS']; ?>" />
199
						</a>
200
						<?php } ?>
201
					<?php } else { ?>
202
						<a href="<?php echo ADMIN_URL; ?>/pages/restore.php?page_id=<?php echo $page['page_id']; ?>" title="<?php echo $TEXT['RESTORE']; ?>">
203
							<img src="<?php echo ADMIN_URL; ?>/images/restore_16.png" border="0" alt="<?php echo $TEXT['RESTORE']; ?>" />
204
						</a>
205
					<?php } ?>
206
				</td>
207
				<td width="20">
208
				<?php if($page['position'] != 1) { ?>
209
					<?php if($page['visibility'] != 'deleted') { ?>
210
						<?php if($admin->get_permission('pages_settings') == true AND $can_modify == true) { ?>
211
						<a href="<?php echo ADMIN_URL; ?>/pages/move_up.php?page_id=<?php echo $page['page_id']; ?>" title="<?php echo $TEXT['MOVE_UP']; ?>">
212
							<img src="<?php echo ADMIN_URL; ?>/images/up_16.png" border="0" alt="^" />
213
						</a>
214
						<?php } ?>
215
					<?php } ?>
216
				<?php } ?>
217
				</td>
218
				<td width="20">
219
				<?php if($page['position'] != $num_pages) { ?>
220
					<?php if($page['visibility'] != 'deleted') { ?>
221
						<?php if($admin->get_permission('pages_settings') == true AND $can_modify == true) { ?>
222
						<a href="<?php echo ADMIN_URL; ?>/pages/move_down.php?page_id=<?php echo $page['page_id']; ?>" title="<?php echo $TEXT['MOVE_DOWN']; ?>">
223
							<img src="<?php echo ADMIN_URL; ?>/images/down_16.png" border="0" alt="v" />
224
						</a>
225
						<?php } ?>
226
					<?php } ?>
227
				<?php } ?>
228
				</td>
229
				<td width="20">
230
					<?php if($admin->get_permission('pages_delete') == true AND $can_modify == true) { ?>
231
					<a href="javascript: confirm_link('<?php echo $MESSAGE['PAGES']['DELETE_CONFIRM']; ?>?', '<?php echo ADMIN_URL; ?>/pages/delete.php?page_id=<?php echo $page['page_id']; ?>');" title="<?php echo $TEXT['DELETE']; ?>">
232
						<img src="<?php echo ADMIN_URL; ?>/images/delete_16.png" border="0" alt="X" />
233
					</a>
234
					<?php } ?>
235
				</td>
236
				<td width="20">
237
					<?php if($page['visibility'] != 'deleted' AND $page['visibility'] != 'none') { ?>
238 242 stefan
					<a href="<?php echo $admin->page_link($page['link']); ?>" target="_blank">
239 238 stefan
						<img src="<?php echo ADMIN_URL; ?>/images/view_16.png" border="0" alt="<?php echo $TEXT['VIEW']; ?>" />
240
					</a>
241
					<?php } ?>
242
				</td>
243
			</tr>
244
			</table>
245
			</li>
246
247
			<?php
248
			// Get subs
249
			$editable_pages=make_list($page['page_id'], $editable_pages);
250
		}
251
252
	}
253
	?>
254
	</ul>
255
	<?php
256
	return $editable_pages;
257
}
258
259
// Generate pages list
260
if($admin->get_permission('pages_view') == true) {
261
	?>
262
	<table cellpadding="0" cellspacing="0" width="100%" border="0">
263
	<tr>
264
		<td>
265
			<h2><?php echo $HEADING['MODIFY_DELETE_PAGE']; ?></h2>
266
		</td>
267
		<td align="right">
268
			<?php
269
				// Check if there are any pages that are in trash, and if we should show a link to the trash page
270
				if(PAGE_TRASH == 'separate') {
271
					$query_trash = $database->query("SELECT page_id FROM ".TABLE_PREFIX."pages WHERE visibility = 'deleted'");
272
					if($query_trash->numRows() > 0) {
273
						?>
274
						<a href="<?php echo ADMIN_URL; ?>/pages/trash.php">
275
						<img src="<?php echo ADMIN_URL; ?>/images/delete_16.png" alt="<?php echo $TEXT['PAGE_TRASH']; ?>" border="0" />
276
						<?php echo $TEXT['VIEW_DELETED_PAGES']; ?></a>
277
						<?php
278
					}
279
				}
280
			?>
281
		</td>
282
	</tr>
283
	</table>
284
	<div class="pages_list">
285
	<table cellpadding="1" cellspacing="0" width="720" border="0">
286
	<tr>
287
		<td width="20">
288
			&nbsp;
289
		</td>
290
		<td>
291
			<?php echo $TEXT['PAGE_TITLE']; ?>:
292
		</td>
293
		<td width="175" align="left">
294
			<?php echo $TEXT['MENU_TITLE']; ?>:
295
		</td>
296
		<td width="130" align="right">
297
			<?php echo $TEXT['VISIBILITY']; ?>:
298
		</td>
299
		<td width="125" align="center">
300
			<?php echo $TEXT['ACTIONS']; ?>:
301
		</td>
302
	</tr>
303
	</table>
304
	<?php
305
	$editable_pages = make_list(0, 0);
306
	?>
307
	</div>
308
	<div class="empty_list">
309
		<?php echo $TEXT['NONE_FOUND']; ?>
310
	</div>
311
	<?php
312
} else {
313
	$editable_pages = 0;
314
}
315
316
// Setup template object
317
$template = new Template(ADMIN_PATH.'/pages');
318
$template->set_file('page', 'template.html');
319
$template->set_block('page', 'main_block', 'main');
320
321
// Figure out if the no pages found message should be shown or not
322
if($editable_pages == 0) {
323
	?>
324
	<style type="text/css">
325
	.pages_list {
326
		display: none;
327
	}
328
	</style>
329
	<?php
330
} else {
331
	?>
332
	<style type="text/css">
333
	.empty_list {
334
		display: none;
335
	}
336
	</style>
337
	<?php
338
}
339
340
// Insert values into the add page form
341
342
// Group list 1
343
	if($admin->get_group_id() == 1) {
344
		$query = "SELECT * FROM ".TABLE_PREFIX."groups";
345
	} else {
346
		$query = "SELECT * FROM ".TABLE_PREFIX."groups WHERE group_id != '".$admin->get_group_id()."'";
347
	}
348
	$get_groups = $database->query($query);
349
	$template->set_block('main_block', 'group_list_block', 'group_list');
350
	// Insert admin group and current group first
351
	$admin_group_name = $get_groups->fetchRow();
352
	$template->set_var(array(
353
									'ID' => 1,
354
									'TOGGLE' => '',
355
									'DISABLED' => ' disabled',
356
									'LINK_COLOR' => '000000',
357
									'CURSOR' => 'default',
358
									'NAME' => $admin_group_name['name'],
359
									'CHECKED' => ' checked'
360
									)
361
							);
362
	$template->parse('group_list', 'group_list_block', true);
363
	if($admin->get_group_id() != 1) {
364
		$template->set_var(array(
365
										'ID' => $admin->get_group_id(),
366
										'TOGGLE' => '',
367
										'DISABLED' => ' disabled',
368
										'LINK_COLOR' => '000000',
369
										'CURSOR' => 'default',
370
										'NAME' => $admin->get_group_name(),
371
										'CHECKED' => ' checked'
372
										)
373
								);
374
		$template->parse('group_list', 'group_list_block', true);
375
	}
376
	while($group = $get_groups->fetchRow()) {
377
		// Check if the group is allowed to edit pages
378
		$system_permissions = explode(',', $group['system_permissions']);
379
		if(is_numeric(array_search('pages_modify', $system_permissions))) {
380
			$template->set_var(array(
381
											'ID' => $group['group_id'],
382
											'TOGGLE' => $group['group_id'],
383
											'CHECKED' => '',
384
											'DISABLED' => '',
385
											'LINK_COLOR' => '',
386
											'CURSOR' => 'pointer',
387
											'NAME' => $group['name'],
388
											'CHECKED' => ''
389
											)
390
									);
391
			$template->parse('group_list', 'group_list_block', true);
392
		}
393
	}
394
// Group list 2
395
	if($admin->get_group_id() == 1) {
396
		$query = "SELECT * FROM ".TABLE_PREFIX."groups";
397
	} else {
398
		$query = "SELECT * FROM ".TABLE_PREFIX."groups WHERE group_id != '".$admin->get_group_id()."'";
399
	}
400
	$get_groups = $database->query($query);
401
	$template->set_block('main_block', 'group_list_block2', 'group_list2');
402
	// Insert admin group and current group first
403
	$admin_group_name = $get_groups->fetchRow();
404
	$template->set_var(array(
405
									'ID' => 1,
406
									'TOGGLE' => '',
407
									'DISABLED' => ' disabled',
408
									'LINK_COLOR' => '000000',
409
									'CURSOR' => 'default',
410
									'NAME' => $admin_group_name['name'],
411
									'CHECKED' => ' checked'
412
									)
413
							);
414
	$template->parse('group_list2', 'group_list_block2', true);
415
	if($admin->get_group_id() != 1) {
416
		$template->set_var(array(
417
										'ID' => $admin->get_group_id(),
418
										'TOGGLE' => '',
419
										'DISABLED' => ' disabled',
420
										'LINK_COLOR' => '000000',
421
										'CURSOR' => 'default',
422
										'NAME' => $admin->get_group_name(),
423
										'CHECKED' => ' checked'
424
										)
425
								);
426
		$template->parse('group_list2', 'group_list_block2', true);
427
	}
428
	while($group = $get_groups->fetchRow()) {
429
		$template->set_var(array(
430
										'ID' => $group['group_id'],
431
										'TOGGLE' => $group['group_id'],
432
										'CHECKED' => '',
433
										'DISABLED' => '',
434
										'LINK_COLOR' => '',
435
										'CURSOR' => 'pointer',
436
										'NAME' => $group['name'],
437
										'CHECKED' => ''
438
										)
439
								);
440
		$template->parse('group_list2', 'group_list_block2', true);
441
	}
442
443
// Parent page list
444
$database = new database();
445
function parent_list($parent) {
446
	global $admin, $database, $template;
447
	$query = "SELECT * FROM ".TABLE_PREFIX."pages WHERE parent = '$parent' AND visibility!='deleted' ORDER BY position ASC";
448
	$get_pages = $database->query($query);
449
	while($page = $get_pages->fetchRow()) {
450
		// Stop users from adding pages with a level of more than the set page level limit
451
		if($page['level']+1 < PAGE_LEVEL_LIMIT) {
452
			// Get user perms
453
			$admin_groups = explode(',', str_replace('_', '', $page['admin_groups']));
454
			$admin_users = explode(',', str_replace('_', '', $page['admin_users']));
455
			if(is_numeric(array_search($admin->get_group_id(), $admin_groups)) OR is_numeric(array_search($admin->get_user_id(), $admin_users))) {
456
				$can_modify = true;
457
			} else {
458
				$can_modify = false;
459
			}
460
			// Title -'s prefix
461
			$title_prefix = '';
462
			for($i = 1; $i <= $page['level']; $i++) { $title_prefix .= ' - '; }
463
				$template->set_var(array(
464
												'ID' => $page['page_id'],
465 452 Ruebenwurz
												'TITLE' => ($title_prefix.$page['page_title'])
466 238 stefan
												)
467
										);
468
				if($can_modify == true) {
469
					$template->set_var('DISABLED', '');
470
				} else {
471 398 Ruebenwurz
					$template->set_var('DISABLED', ' disabled="disabled" style="color: #aaa;"');
472 238 stefan
				}
473
				$template->parse('page_list2', 'page_list_block2', true);
474
		}
475
		parent_list($page['page_id']);
476
	}
477
}
478
$template->set_block('main_block', 'page_list_block2', 'page_list2');
479
if($admin->get_permission('pages_add_l0') == true) {
480
	$template->set_var(array(
481
									'ID' => '0',
482
									'TITLE' => $TEXT['NONE'],
483
									'SELECTED' => ' selected',
484
									'DISABLED' => ''
485
									)
486
							);
487
	$template->parse('page_list2', 'page_list_block2', true);
488
}
489
parent_list(0);
490
491
// Explode module permissions
492
$module_permissions = $_SESSION['MODULE_PERMISSIONS'];
493
// Modules list
494
$template->set_block('main_block', 'module_list_block', 'module_list');
495 384 Ruebenwurz
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'module' AND function = 'page' order by name");
496 238 stefan
if($result->numRows() > 0) {
497
	while ($module = $result->fetchRow()) {
498
		// Check if user is allowed to use this module
499
		if(!is_numeric(array_search($module['directory'], $module_permissions))) {
500
			$template->set_var('VALUE', $module['directory']);
501
			$template->set_var('NAME', $module['name']);
502
			if($module['directory'] == 'wysiwyg') {
503
				$template->set_var('SELECTED', ' selected');
504
			} else {
505
				$template->set_var('SELECTED', '');
506
			}
507
			$template->parse('module_list', 'module_list_block', true);
508
		}
509
	}
510
}
511
512
// Insert language headings
513
$template->set_var(array(
514
								'HEADING_ADD_PAGE' => $HEADING['ADD_PAGE'],
515
								'HEADING_MODIFY_INTRO_PAGE' => $HEADING['MODIFY_INTRO_PAGE']
516
								)
517
						);
518
// Insert language text and messages
519
$template->set_var(array(
520
								'TEXT_TITLE' => $TEXT['TITLE'],
521
								'TEXT_TYPE' => $TEXT['TYPE'],
522
								'TEXT_PARENT' => $TEXT['PARENT'],
523
								'TEXT_VISIBILITY' => $TEXT['VISIBILITY'],
524
								'TEXT_PUBLIC' => $TEXT['PUBLIC'],
525
								'TEXT_PRIVATE' => $TEXT['PRIVATE'],
526
								'TEXT_REGISTERED' => $TEXT['REGISTERED'],
527
								'TEXT_HIDDEN' => $TEXT['HIDDEN'],
528
								'TEXT_NONE' => $TEXT['NONE'],
529
								'TEXT_NONE_FOUND' => $TEXT['NONE_FOUND'],
530
								'TEXT_ADD' => $TEXT['ADD'],
531
								'TEXT_RESET' => $TEXT['RESET'],
532
								'TEXT_ADMINISTRATORS' => $TEXT['ADMINISTRATORS'],
533
								'TEXT_PRIVATE_VIEWERS' => $TEXT['PRIVATE_VIEWERS'],
534
								'TEXT_REGISTERED_VIEWERS' => $TEXT['REGISTERED_VIEWERS'],
535
								'INTRO_LINK' => $MESSAGE['PAGES']['INTRO_LINK'],
536
								)
537
						);
538
539
// Insert permissions values
540
if($admin->get_permission('pages_add') != true) {
541
	$template->set_var('DISPLAY_ADD', 'hide');
542
} elseif($admin->get_permission('pages_add_l0') != true AND $editable_pages == 0) {
543
	$template->set_var('DISPLAY_ADD', 'hide');
544
}
545
if($admin->get_permission('pages_intro') != true OR INTRO_PAGE != 'enabled') {
546
	$template->set_var('DISPLAY_INTRO', 'hide');
547
}
548
549
550
// Parse template object
551
$template->parse('main', 'main_block', false);
552
$template->pparse('output', 'page');
553
554
// Print admin
555
$admin->print_footer();
556
557 399 Ruebenwurz
?>