Project

General

Profile

1
<?php
2

    
3
// $Id: index.php 915 2009-01-21 19:27:01Z Ruebenwurzel $
4

    
5
/*
6

    
7
 Website Baker Project <http://www.websitebaker.org/>
8
 Copyright (C) 2004-2009, 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
								'WB_VERSION' => WB_VERSION
43
								)
44
						);
45

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

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

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

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

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

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

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

    
135
?>
(1-1/2)