Project

General

Profile

1 1242 Luisehahne
<?php
2 1271 Luisehahne
/*
3 1242 Luisehahne
*
4 1271 Luisehahne
*                       About WebsiteBaker
5 1242 Luisehahne
*
6
* Website Baker is a PHP-based Content Management System (CMS)
7
* designed with one goal in mind: to enable its users to produce websites
8
* with ease.
9
*
10 1271 Luisehahne
*                       LICENSE INFORMATION
11 1242 Luisehahne
*
12
* WebsiteBaker is free software; you can redistribute it and/or
13
* modify it under the terms of the GNU General Public License
14
* as published by the Free Software Foundation; either version 2
15
* of the License, or (at your option) any later version.
16
*
17
* WebsiteBaker is distributed in the hope that it will be useful,
18
* but WITHOUT ANY WARRANTY; without even the implied warranty of
19
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20
* See the GNU General Public License for more details.
21
*
22
* You should have received a copy of the GNU General Public License
23
* along with this program; if not, write to the Free Software
24
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
25
*
26
*                   WebsiteBaker Extra Information
27
*
28
*
29 1271 Luisehahne
*/
30 1242 Luisehahne
/**
31
 *
32 1271 Luisehahne
 * @category        admin
33
 * @package         start
34
 * @author          WebsiteBaker Project
35
 * @copyright       2004-2009, Ryan Djurovich
36
 * @copyright       2009-2010, Website Baker Org. e.V.
37
 * @link			http://www.websitebaker2.org/
38
 * @license         http://www.gnu.org/licenses/gpl.html
39
 * @platform        WebsiteBaker 2.8.x
40
 * @requirements    PHP 4.3.4 and higher
41
 * @version         $Id$
42
 * @filesource		$HeadURL$
43
 * @lastmodified    $Date$
44 1242 Luisehahne
 *
45 1271 Luisehahne
*/
46 1242 Luisehahne
47
require('../../config.php');
48
require_once(WB_PATH.'/framework/class.admin.php');
49
$admin = new admin('Start','start');
50
51
// Setup template object
52
$template = new Template(THEME_PATH.'/templates');
53
$template->set_file('page', 'start.htt');
54
$template->set_block('page', 'main_block', 'main');
55
56
// Insert values into the template object
57
$template->set_var(array(
58
								'WELCOME_MESSAGE' => $MESSAGE['START']['WELCOME_MESSAGE'],
59
								'CURRENT_USER' => $MESSAGE['START']['CURRENT_USER'],
60
								'DISPLAY_NAME' => $admin->get_display_name(),
61
								'ADMIN_URL' => ADMIN_URL,
62
								'WB_URL' => WB_URL,
63
								'THEME_URL' => THEME_URL,
64
								'WB_VERSION' => WB_VERSION
65
								)
66
						);
67
68
// Insert permission values into the template object
69
if($admin->get_permission('pages') != true) {
70
	$template->set_var('DISPLAY_PAGES', 'display:none;');
71
}
72
if($admin->get_permission('media') != true) {
73
	$template->set_var('DISPLAY_MEDIA', 'display:none;');
74
}
75
if($admin->get_permission('addons') != true) {
76
	$template->set_var('DISPLAY_ADDONS', 'display:none;');
77
}
78
if($admin->get_permission('access') != true) {
79
	$template->set_var('DISPLAY_ACCESS', 'display:none;');
80
}
81
if($admin->get_permission('settings') != true) {
82
	$template->set_var('DISPLAY_SETTINGS', 'display:none;');
83
}
84
if($admin->get_permission('admintools') != true) {
85
	$template->set_var('DISPLAY_ADMINTOOLS', 'display:none;');
86
}
87
88
// Check if installation directory still exists
89
if(file_exists(WB_PATH.'/install/')) {
90
	// Check if user is part of Adminstrators group
91
	if(in_array(1, $admin->get_groups_id())) {
92
		$template->set_var('WARNING', $MESSAGE['START']['INSTALL_DIR_EXISTS']);
93
	} else {
94
		$template->set_var('DISPLAY_WARNING', 'display:none;');
95
	}
96
} else {
97
	$template->set_var('DISPLAY_WARNING', 'display:none;');
98
}
99
100
// Insert "Add-ons" section overview (pretty complex compared to normal)
101
$addons_overview = $TEXT['MANAGE'].' ';
102
$addons_count = 0;
103
if($admin->get_permission('modules') == true) {
104
	$addons_overview .= '<a href="'.ADMIN_URL.'/modules/index.php">'.$MENU['MODULES'].'</a>';
105
	$addons_count = 1;
106
}
107
if($admin->get_permission('templates') == true) {
108
	if($addons_count == 1) { $addons_overview .= ', '; }
109
	$addons_overview .= '<a href="'.ADMIN_URL.'/templates/index.php">'.$MENU['TEMPLATES'].'</a>';
110
	$addons_count = 1;
111
}
112
if($admin->get_permission('languages') == true) {
113
	if($addons_count == 1) { $addons_overview .= ', '; }
114
	$addons_overview .= '<a href="'.ADMIN_URL.'/languages/index.php">'.$MENU['LANGUAGES'].'</a>';
115
}
116
117
// Insert "Access" section overview (pretty complex compared to normal)
118
$access_overview = $TEXT['MANAGE'].' ';
119
$access_count = 0;
120
if($admin->get_permission('users') == true) {
121
	$access_overview .= '<a href="'.ADMIN_URL.'/users/index.php">'.$MENU['USERS'].'</a>';
122
	$access_count = 1;
123
}
124
if($admin->get_permission('groups') == true) {
125
	if($access_count == 1) { $access_overview .= ', '; }
126
	$access_overview .= '<a href="'.ADMIN_URL.'/groups/index.php">'.$MENU['GROUPS'].'</a>';
127
	$access_count = 1;
128
}
129
130
// Insert section names and descriptions
131
$template->set_var(array(
132
								'PAGES' => $MENU['PAGES'],
133
								'MEDIA' => $MENU['MEDIA'],
134
								'ADDONS' => $MENU['ADDONS'],
135
								'ACCESS' => $MENU['ACCESS'],
136
								'PREFERENCES' => $MENU['PREFERENCES'],
137
								'SETTINGS' => $MENU['SETTINGS'],
138
								'ADMINTOOLS' => $MENU['ADMINTOOLS'],
139
								'HOME_OVERVIEW' => $OVERVIEW['START'],
140
								'PAGES_OVERVIEW' => $OVERVIEW['PAGES'],
141
								'MEDIA_OVERVIEW' => $OVERVIEW['MEDIA'],
142
								'ADDONS_OVERVIEW' => $addons_overview,
143
								'ACCESS_OVERVIEW' => $access_overview,
144
								'PREFERENCES_OVERVIEW' => $OVERVIEW['PREFERENCES'],
145
								'SETTINGS_OVERVIEW' => $OVERVIEW['SETTINGS'],
146
								'ADMINTOOLS_OVERVIEW' => $OVERVIEW['ADMINTOOLS']
147
								)
148
						);
149
150
// Parse template object
151
$template->parse('main', 'main_block', false);
152
$template->pparse('output', 'page');
153
154
// Print admin footer
155
$admin->print_footer();
156
157 4 ryan
?>