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