Revision 1242
Added by Dietmar almost 15 years ago
index.php | ||
---|---|---|
1 |
<?php |
|
2 |
|
|
3 |
// $Id$ |
|
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 |
|
|
1 |
<?php |
|
2 |
/**************************************************************************** |
|
3 |
* SVN Version information: |
|
4 |
* |
|
5 |
* $Id$ |
|
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$ |
|
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 |
|
|
136 | 171 |
?> |
Also available in: Unified diff
Ticket #911 Beginning to fix More CSS-errors in WB backend
add SVN- Revision to backend theme