Project

General

Profile

1
<?php
2

    
3
// $Id: index.php,v 1.3 2005/04/02 06:25:38 rdjurovich Exp $
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
$admin = new admin('Start','start');
29

    
30
// Setup template object
31
$template = new Template(ADMIN_PATH.'/start');
32
$template->set_file('page', 'template.html');
33
$template->set_block('page', 'main_block', 'main');
34

    
35
// Insert values into the template object
36
$template->set_var(array(
37
								'WELCOME_MESSAGE' => $MESSAGE['START']['WELCOME_MESSAGE'],
38
								'CURRENT_USER' => $MESSAGE['START']['CURRENT_USER'],
39
								'DISPLAY_NAME' => $admin->get_display_name(),
40
								'ADMIN_URL' => ADMIN_URL,
41
								'WB_URL' => WB_URL
42
								)
43
						);
44

    
45
// Insert permission values into the template object
46
if($admin->get_permission('pages') != true) {
47
	$template->set_var('DISPLAY_PAGES', 'none');
48
}
49
if($admin->get_permission('media') != true) {
50
	$template->set_var('DISPLAY_MEDIA', 'none');
51
}
52
if($admin->get_permission('addons') != true) {
53
	$template->set_var('DISPLAY_ADDONS', 'none');
54
}
55
if($admin->get_permission('access') != true) {
56
	$template->set_var('DISPLAY_ACCESS', 'none');
57
}
58
if($admin->get_permission('settings') != true) {
59
	$template->set_var('DISPLAY_SETTINGS', 'none');
60
}
61

    
62
// Check if installation directory still exists
63
if(file_exists(WB_PATH.'/install/')) {
64
	// Check if user is part of Adminstrators group
65
	if($admin->get_group_id() == 1) {
66
		$template->set_var('WARNING', $MESSAGE['START']['INSTALL_DIR_EXISTS']);
67
	} else {
68
		$template->set_var('DISPLAY_WARNING', 'none');
69
	}
70
} else {
71
	$template->set_var('DISPLAY_WARNING', 'none');
72
}
73

    
74
// Insert "Add-ons" section overview (pretty complex compared to normal)
75
$addons_overview = $TEXT['MANAGE'].' ';
76
$addons_count = 0;
77
if($admin->get_permission('modules') == true) {
78
	$addons_overview .= '<a href="'.ADMIN_URL.'/modules/index.php">'.$MENU['MODULES'].'</a>';
79
	$addons_count = 1;
80
}
81
if($admin->get_permission('templates') == true) {
82
	if($addons_count == 1) { $addons_overview .= ', '; }
83
	$addons_overview .= '<a href="'.ADMIN_URL.'/templates/index.php">'.$MENU['TEMPLATES'].'</a>';
84
	$addons_count = 1;
85
}
86
if($admin->get_permission('languages') == true) {
87
	if($addons_count == 1) { $addons_overview .= ', '; }
88
	$addons_overview .= '<a href="'.ADMIN_URL.'/languages/index.php">'.$MENU['LANGUAGES'].'</a>';
89
}
90

    
91
// Insert "Access" section overview (pretty complex compared to normal)
92
$access_overview = $TEXT['MANAGE'].' ';
93
$access_count = 0;
94
if($admin->get_permission('users') == true) {
95
	$access_overview .= '<a href="'.ADMIN_URL.'/users/index.php">'.$MENU['USERS'].'</a>';
96
	$access_count = 1;
97
}
98
if($admin->get_permission('groups') == true) {
99
	if($access_count == 1) { $access_overview .= ', '; }
100
	$access_overview .= '<a href="'.ADMIN_URL.'/groups/index.php">'.$MENU['GROUPS'].'</a>';
101
	$access_count = 1;
102
}
103

    
104
// Insert section names and descriptions
105
$template->set_var(array(
106
								'HOME' => $MENU['START'],
107
								'PAGES' => $MENU['PAGES'],
108
								'MEDIA' => $MENU['MEDIA'],
109
								'ADDONS' => $MENU['ADDONS'],
110
								'ACCESS' => $MENU['ACCESS'],
111
								'PREFERENCES' => $MENU['PREFERENCES'],
112
								'SETTINGS' => $MENU['SETTINGS'],
113
								'HELP' => $MENU['HELP'],
114
								'VIEW' => $MENU['VIEW'],
115
								'HOME_OVERVIEW' => $OVERVIEW['START'],
116
								'PAGES_OVERVIEW' => $OVERVIEW['PAGES'],
117
								'MEDIA_OVERVIEW' => $OVERVIEW['MEDIA'],
118
								'ADDONS_OVERVIEW' => $addons_overview,
119
								'ACCESS_OVERVIEW' => $access_overview,
120
								'PREFERENCES_OVERVIEW' => $OVERVIEW['PREFERENCES'],
121
								'SETTINGS_OVERVIEW' => $OVERVIEW['SETTINGS'],
122
								'HELP_OVERVIEW' => $OVERVIEW['HELP'],
123
								'VIEW_OVERVIEW' => $OVERVIEW['VIEW']
124
								)
125
						);
126

    
127
// Parse template object
128
$template->parse('main', 'main_block', false);
129
$template->pparse('output', 'page');
130

    
131
// Print admin footer
132
$admin->print_footer();
133

    
134
?>
(1-1/2)