Project

General

Profile

1
<?php
2

    
3
// $Id: index.php 472 2007-06-05 21:45:11Z Ruebenwurzel $
4

    
5
/*
6

    
7
 Website Baker Project <http://www.websitebaker.org/>
8
 Copyright (C) 2004-2007, 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
$admin = new admin('Pages', 'pages');
29
// Include the WB functions file
30
require_once(WB_PATH.'/framework/functions.php');
31

    
32
?>
33
<!-- 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
<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
		writeSessionCookie (id, "0");//Addition for remembering expanded state of pages
58
	} else {
59
		document.getElementById(id).style.display = "block";
60
		writeSessionCookie (id, "1");//Addition for remembering expanded state of pages
61
	}
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
	<ul id="p<?php echo $parent; ?>" <?php if($parent != 0) { echo 'class="page_list" '; if($_COOKIE["p".$parent] =="1"){echo'style="display:block;"'; }} ?>>
105
	<?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
				if($page['visibility'] == 'private') {
135
					continue;
136
				}
137
				else {
138
					$can_modify = false;
139
				}
140
			}
141
						
142
			// Work out if we should show a plus or not
143
			if(PAGE_TRASH != 'inline') {
144
				$get_page_subs = $database->query("SELECT page_id,admin_groups,admin_users FROM ".TABLE_PREFIX."pages WHERE parent = '".$page['page_id']."' AND visibility!='deleted'");
145
			} else {
146
				$get_page_subs = $database->query("SELECT page_id,admin_groups,admin_users FROM ".TABLE_PREFIX."pages WHERE parent = '".$page['page_id']."'");
147
			}
148
			if($get_page_subs->numRows() > 0) {
149
				$display_plus = true;
150
			} else {
151
				$display_plus = false;
152
			}
153
			
154
			// Work out how many pages there are for this parent
155
			$num_pages = $get_pages->numRows();
156
			?>
157
			
158
			<li id="p<?php echo $page['parent']; ?>" style="padding: 2px 0px 2px 0px;">
159
			<table width="720" cellpadding="1" cellspacing="0" border="0" style="background-color: #F0F0F0;">
160
			<tr>
161
				<td width="20" style="padding-left: <?php echo $page['level']*20; ?>px;">
162
					<?php
163
					if($display_plus == true) {
164
					?>
165
					<a href="javascript: toggle_visibility('p<?php echo $page['page_id']; ?>');" title="<?php echo $TEXT['EXPAND'].'/'.$TEXT['COLLAPSE']; ?>">
166
						<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="+" />
167
					</a>
168
					<?php
169
					}
170
					?>
171
				</td>
172
				<?php if($admin->get_permission('pages_modify') == true AND $can_modify == true) { ?>
173
				<td>
174
					<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>				
175
				</td>
176
				<?php } else { ?>
177
				<td>
178
					<?php echo ($page['page_title']); ?>
179
				</td>
180
				<?php } ?>
181
				<td align="left" width="232">
182
					<font color="#999999"><?php echo ($page['menu_title']); ?></font>
183
				</td>
184
				<td align="center" valign="middle" width="90">
185
				<?php if($page['visibility'] == 'public') { ?>
186
					<img src="<?php echo ADMIN_URL; ?>/images/visible_16.png" alt="<?php echo $TEXT['VISIBILITY']; ?>: <?php echo $TEXT['PUBLIC']; ?>" border="0" />
187
				<?php } elseif($page['visibility'] == 'private') { ?>
188
					<img src="<?php echo ADMIN_URL; ?>/images/private_16.png" alt="<?php echo $TEXT['VISIBILITY']; ?>: <?php echo $TEXT['PRIVATE']; ?>" border="0" />
189
				<?php } elseif($page['visibility'] == 'registered') { ?>
190
					<img src="<?php echo ADMIN_URL; ?>/images/keys_16.png" alt="<?php echo $TEXT['VISIBILITY']; ?>: <?php echo $TEXT['REGISTERED']; ?>" border="0" />
191
				<?php } elseif($page['visibility'] == 'hidden') { ?>
192
					<img src="<?php echo ADMIN_URL; ?>/images/hidden_16.png" alt="<?php echo $TEXT['VISIBILITY']; ?>: <?php echo $TEXT['HIDDEN']; ?>" border="0" />
193
				<?php } elseif($page['visibility'] == 'none') { ?>
194
					<img src="<?php echo ADMIN_URL; ?>/images/none_16.png" alt="<?php echo $TEXT['VISIBILITY']; ?>: <?php echo $TEXT['NONE']; ?>" border="0" />
195
				<?php } elseif($page['visibility'] == 'deleted') { ?>
196
					<img src="<?php echo ADMIN_URL; ?>/images/deleted_16.png" alt="<?php echo $TEXT['VISIBILITY']; ?>: <?php echo $TEXT['DELETED']; ?>" border="0" />
197
				<?php } ?>
198
				</td>
199
				<td width="20">
200
					<?php if($page['visibility'] != 'deleted') { ?>
201
						<?php if($admin->get_permission('pages_settings') == true AND $can_modify == true) { ?>
202
						<a href="<?php echo ADMIN_URL; ?>/pages/settings.php?page_id=<?php echo $page['page_id']; ?>" title="<?php echo $TEXT['SETTINGS']; ?>">
203
							<img src="<?php echo ADMIN_URL; ?>/images/modify_16.png" border="0" alt="<?php echo $TEXT['SETTINGS']; ?>" />
204
						</a>
205
						<?php } ?>
206
					<?php } else { ?>
207
						<a href="<?php echo ADMIN_URL; ?>/pages/restore.php?page_id=<?php echo $page['page_id']; ?>" title="<?php echo $TEXT['RESTORE']; ?>">
208
							<img src="<?php echo ADMIN_URL; ?>/images/restore_16.png" border="0" alt="<?php echo $TEXT['RESTORE']; ?>" />
209
						</a>
210
					<?php } ?>
211
				</td>
212
				<td width="20">
213
				<?php if($page['position'] != 1) { ?>
214
					<?php if($page['visibility'] != 'deleted') { ?>
215
						<?php if($admin->get_permission('pages_settings') == true AND $can_modify == true) { ?>
216
						<a href="<?php echo ADMIN_URL; ?>/pages/move_up.php?page_id=<?php echo $page['page_id']; ?>" title="<?php echo $TEXT['MOVE_UP']; ?>">
217
							<img src="<?php echo ADMIN_URL; ?>/images/up_16.png" border="0" alt="^" />
218
						</a>
219
						<?php } ?>
220
					<?php } ?>
221
				<?php } ?>
222
				</td>
223
				<td width="20">
224
				<?php if($page['position'] != $num_pages) { ?>
225
					<?php if($page['visibility'] != 'deleted') { ?>
226
						<?php if($admin->get_permission('pages_settings') == true AND $can_modify == true) { ?>
227
						<a href="<?php echo ADMIN_URL; ?>/pages/move_down.php?page_id=<?php echo $page['page_id']; ?>" title="<?php echo $TEXT['MOVE_DOWN']; ?>">
228
							<img src="<?php echo ADMIN_URL; ?>/images/down_16.png" border="0" alt="v" />
229
						</a>
230
						<?php } ?>
231
					<?php } ?>
232
				<?php } ?>
233
				</td>
234
				<td width="20">
235
					<?php if($admin->get_permission('pages_delete') == true AND $can_modify == true) { ?>
236
					<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']; ?>">
237
						<img src="<?php echo ADMIN_URL; ?>/images/delete_16.png" border="0" alt="X" />
238
					</a>
239
					<?php } ?>
240
				</td>
241
				<td width="20">
242
					<?php if($page['visibility'] != 'deleted' AND $page['visibility'] != 'none') { ?>
243
					<a href="<?php echo $admin->page_link($page['link']); ?>" target="_blank">
244
						<img src="<?php echo ADMIN_URL; ?>/images/view_16.png" border="0" alt="<?php echo $TEXT['VIEW']; ?>" />
245
					</a>
246
					<?php } ?>
247
				</td>
248
			</tr>
249
			</table>
250
			</li>
251
							
252
			<?php
253
			// Get subs
254
			$editable_pages=make_list($page['page_id'], $editable_pages);
255
		}
256

    
257
	}
258
	?>
259
	</ul>
260
	<?php
261
	return $editable_pages;
262
}
263

    
264
// Generate pages list
265
if($admin->get_permission('pages_view') == true) {
266
	?>
267
	<table cellpadding="0" cellspacing="0" width="100%" border="0">
268
	<tr>
269
		<td>
270
			<h2><?php echo $HEADING['MODIFY_DELETE_PAGE']; ?></h2>
271
		</td>
272
		<td align="right">
273
			<?php
274
				// Check if there are any pages that are in trash, and if we should show a link to the trash page
275
				if(PAGE_TRASH == 'separate') {
276
					$query_trash = $database->query("SELECT page_id FROM ".TABLE_PREFIX."pages WHERE visibility = 'deleted'");
277
					if($query_trash->numRows() > 0) {
278
						?>
279
						<a href="<?php echo ADMIN_URL; ?>/pages/trash.php">
280
						<img src="<?php echo ADMIN_URL; ?>/images/delete_16.png" alt="<?php echo $TEXT['PAGE_TRASH']; ?>" border="0" />
281
						<?php echo $TEXT['VIEW_DELETED_PAGES']; ?></a>
282
						<?php
283
					}
284
				}
285
			?>
286
		</td>
287
	</tr>
288
	</table>
289
	<div class="pages_list">
290
	<table cellpadding="1" cellspacing="0" width="720" border="0">
291
	<tr>
292
		<td width="20">
293
			&nbsp;
294
		</td>
295
		<td>
296
			<?php echo $TEXT['PAGE_TITLE']; ?>:
297
		</td>
298
		<td width="175" align="left">
299
			<?php echo $TEXT['MENU_TITLE']; ?>:
300
		</td>
301
		<td width="130" align="right">
302
			<?php echo $TEXT['VISIBILITY']; ?>:
303
		</td>
304
		<td width="125" align="center">
305
			<?php echo $TEXT['ACTIONS']; ?>:
306
		</td>		
307
	</tr>
308
	</table>
309
	<?php
310
	$editable_pages = make_list(0, 0);
311
	?>
312
	</div>
313
	<div class="empty_list">
314
		<?php echo $TEXT['NONE_FOUND']; ?>
315
	</div>
316
	<?php
317
} else {
318
	$editable_pages = 0;
319
}
320

    
321
// Setup template object
322
$template = new Template(ADMIN_PATH.'/pages');
323
$template->set_file('page', 'template.html');
324
$template->set_block('page', 'main_block', 'main');
325

    
326
// Figure out if the no pages found message should be shown or not
327
if($editable_pages == 0) {
328
	?>
329
	<style type="text/css">
330
	.pages_list {
331
		display: none;
332
	}
333
	</style>
334
	<?php
335
} else {
336
	?>
337
	<style type="text/css">
338
	.empty_list {
339
		display: none;
340
	}
341
	</style>
342
	<?php
343
}
344

    
345
// Insert values into the add page form
346

    
347
// Group list 1
348
	if($admin->get_group_id() == 1) {
349
		$query = "SELECT * FROM ".TABLE_PREFIX."groups";
350
	} else {
351
		$query = "SELECT * FROM ".TABLE_PREFIX."groups WHERE group_id != '".$admin->get_group_id()."'";
352
	}
353
	$get_groups = $database->query($query);
354
	$template->set_block('main_block', 'group_list_block', 'group_list');
355
	// Insert admin group and current group first
356
	$admin_group_name = $get_groups->fetchRow();
357
	$template->set_var(array(
358
									'ID' => 1,
359
									'TOGGLE' => '',
360
									'DISABLED' => ' disabled',
361
									'LINK_COLOR' => '000000',
362
									'CURSOR' => 'default',
363
									'NAME' => $admin_group_name['name'],
364
									'CHECKED' => ' checked'
365
									)
366
							);
367
	$template->parse('group_list', 'group_list_block', true);
368
	if($admin->get_group_id() != 1) {
369
		$template->set_var(array(
370
										'ID' => $admin->get_group_id(),
371
										'TOGGLE' => '',
372
										'DISABLED' => ' disabled',
373
										'LINK_COLOR' => '000000',
374
										'CURSOR' => 'default',
375
										'NAME' => $admin->get_group_name(),
376
										'CHECKED' => ' checked'
377
										)
378
								);
379
		$template->parse('group_list', 'group_list_block', true);
380
	}
381
	while($group = $get_groups->fetchRow()) {
382
		// Check if the group is allowed to edit pages
383
		$system_permissions = explode(',', $group['system_permissions']);
384
		if(is_numeric(array_search('pages_modify', $system_permissions))) {
385
			$template->set_var(array(
386
											'ID' => $group['group_id'],
387
											'TOGGLE' => $group['group_id'],
388
											'CHECKED' => '',
389
											'DISABLED' => '',
390
											'LINK_COLOR' => '',
391
											'CURSOR' => 'pointer',
392
											'NAME' => $group['name'],
393
											'CHECKED' => ''
394
											)
395
									);
396
			$template->parse('group_list', 'group_list_block', true);
397
		}
398
	}
399
// Group list 2
400
	if($admin->get_group_id() == 1) {
401
		$query = "SELECT * FROM ".TABLE_PREFIX."groups";
402
	} else {
403
		$query = "SELECT * FROM ".TABLE_PREFIX."groups WHERE group_id != '".$admin->get_group_id()."'";
404
	}
405
	$get_groups = $database->query($query);
406
	$template->set_block('main_block', 'group_list_block2', 'group_list2');
407
	// Insert admin group and current group first
408
	$admin_group_name = $get_groups->fetchRow();
409
	$template->set_var(array(
410
									'ID' => 1,
411
									'TOGGLE' => '',
412
									'DISABLED' => ' disabled',
413
									'LINK_COLOR' => '000000',
414
									'CURSOR' => 'default',
415
									'NAME' => $admin_group_name['name'],
416
									'CHECKED' => ' checked'
417
									)
418
							);
419
	$template->parse('group_list2', 'group_list_block2', true);
420
	if($admin->get_group_id() != 1) {
421
		$template->set_var(array(
422
										'ID' => $admin->get_group_id(),
423
										'TOGGLE' => '',
424
										'DISABLED' => ' disabled',
425
										'LINK_COLOR' => '000000',
426
										'CURSOR' => 'default',
427
										'NAME' => $admin->get_group_name(),
428
										'CHECKED' => ' checked'
429
										)
430
								);
431
		$template->parse('group_list2', 'group_list_block2', true);
432
	}
433
	while($group = $get_groups->fetchRow()) {
434
		$template->set_var(array(
435
										'ID' => $group['group_id'],
436
										'TOGGLE' => $group['group_id'],
437
										'CHECKED' => '',
438
										'DISABLED' => '',
439
										'LINK_COLOR' => '',
440
										'CURSOR' => 'pointer',
441
										'NAME' => $group['name'],
442
										'CHECKED' => ''
443
										)
444
								);
445
		$template->parse('group_list2', 'group_list_block2', true);
446
	}
447

    
448
// Parent page list
449
$database = new database();
450
function parent_list($parent) {
451
	global $admin, $database, $template;
452
	$query = "SELECT * FROM ".TABLE_PREFIX."pages WHERE parent = '$parent' AND visibility!='deleted' ORDER BY position ASC";
453
	$get_pages = $database->query($query);
454
	while($page = $get_pages->fetchRow()) {
455
		// Stop users from adding pages with a level of more than the set page level limit
456
		if($page['level']+1 < PAGE_LEVEL_LIMIT) {
457
			// Get user perms
458
			$admin_groups = explode(',', str_replace('_', '', $page['admin_groups']));
459
			$admin_users = explode(',', str_replace('_', '', $page['admin_users']));
460
			if(is_numeric(array_search($admin->get_group_id(), $admin_groups)) OR is_numeric(array_search($admin->get_user_id(), $admin_users))) {
461
				$can_modify = true;
462
			} else {
463
				$can_modify = false;
464
			}
465
			// Title -'s prefix
466
			$title_prefix = '';
467
			for($i = 1; $i <= $page['level']; $i++) { $title_prefix .= ' - '; }
468
				$template->set_var(array(
469
												'ID' => $page['page_id'],
470
												'TITLE' => ($title_prefix.$page['page_title'])
471
												)
472
										);
473
				if($can_modify == true) {
474
					$template->set_var('DISABLED', '');
475
				} else {
476
					$template->set_var('DISABLED', ' disabled="disabled" style="color: #aaa;"');
477
				}
478
				$template->parse('page_list2', 'page_list_block2', true);
479
		}
480
		parent_list($page['page_id']);
481
	}
482
}
483
$template->set_block('main_block', 'page_list_block2', 'page_list2');
484
if($admin->get_permission('pages_add_l0') == true) {
485
	$template->set_var(array(
486
									'ID' => '0',
487
									'TITLE' => $TEXT['NONE'],
488
									'SELECTED' => ' selected',
489
									'DISABLED' => ''
490
									)
491
							);
492
	$template->parse('page_list2', 'page_list_block2', true);
493
}
494
parent_list(0);
495

    
496
// Explode module permissions
497
$module_permissions = $_SESSION['MODULE_PERMISSIONS'];
498
// Modules list
499
$template->set_block('main_block', 'module_list_block', 'module_list');
500
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'module' AND function = 'page' order by name");
501
if($result->numRows() > 0) {
502
	while ($module = $result->fetchRow()) {
503
		// Check if user is allowed to use this module
504
		if(!is_numeric(array_search($module['directory'], $module_permissions))) {
505
			$template->set_var('VALUE', $module['directory']);
506
			$template->set_var('NAME', $module['name']);
507
			if($module['directory'] == 'wysiwyg') {
508
				$template->set_var('SELECTED', ' selected');
509
			} else {
510
				$template->set_var('SELECTED', '');
511
			}
512
			$template->parse('module_list', 'module_list_block', true);
513
		}
514
	}
515
}
516

    
517
// Insert language headings
518
$template->set_var(array(
519
								'HEADING_ADD_PAGE' => $HEADING['ADD_PAGE'],
520
								'HEADING_MODIFY_INTRO_PAGE' => $HEADING['MODIFY_INTRO_PAGE']
521
								)
522
						);
523
// Insert language text and messages
524
$template->set_var(array(
525
								'TEXT_TITLE' => $TEXT['TITLE'],
526
								'TEXT_TYPE' => $TEXT['TYPE'],
527
								'TEXT_PARENT' => $TEXT['PARENT'],
528
								'TEXT_VISIBILITY' => $TEXT['VISIBILITY'],
529
								'TEXT_PUBLIC' => $TEXT['PUBLIC'],
530
								'TEXT_PRIVATE' => $TEXT['PRIVATE'],
531
								'TEXT_REGISTERED' => $TEXT['REGISTERED'],
532
								'TEXT_HIDDEN' => $TEXT['HIDDEN'],
533
								'TEXT_NONE' => $TEXT['NONE'],
534
								'TEXT_NONE_FOUND' => $TEXT['NONE_FOUND'],
535
								'TEXT_ADD' => $TEXT['ADD'],
536
								'TEXT_RESET' => $TEXT['RESET'],
537
								'TEXT_ADMINISTRATORS' => $TEXT['ADMINISTRATORS'],								
538
								'TEXT_PRIVATE_VIEWERS' => $TEXT['PRIVATE_VIEWERS'],
539
								'TEXT_REGISTERED_VIEWERS' => $TEXT['REGISTERED_VIEWERS'],
540
								'INTRO_LINK' => $MESSAGE['PAGES']['INTRO_LINK'],
541
								)
542
						);
543

    
544
// Insert permissions values
545
if($admin->get_permission('pages_add') != true) {
546
	$template->set_var('DISPLAY_ADD', 'hide');
547
} elseif($admin->get_permission('pages_add_l0') != true AND $editable_pages == 0) {
548
	$template->set_var('DISPLAY_ADD', 'hide');
549
}
550
if($admin->get_permission('pages_intro') != true OR INTRO_PAGE != 'enabled') {
551
	$template->set_var('DISPLAY_INTRO', 'hide');
552
}
553

    
554

    
555
// Parse template object
556
$template->parse('main', 'main_block', false);
557
$template->pparse('output', 'page');
558

    
559
// Print admin 
560
$admin->print_footer();
561

    
562
?>
(4-4/19)