Project

General

Profile

1
<?php
2

    
3
// $Id: index.php 944 2009-02-22 09:39:58Z 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(THEME_PATH.'/templates');
32
$template->set_file('page', 'start.htt');
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
								'THEME_URL' => THEME_URL,
43
								'WB_VERSION' => WB_VERSION
44
								)
45
						);
46

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

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

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

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

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

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

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

    
136
?>
    (1-1/1)