Project

General

Profile

1
<?php
2
/**
3
 *
4
 * @category        admin
5
 * @package         start
6
 * @author          WebsiteBaker Project
7
 * @copyright       2004-2009, Ryan Djurovich
8
 * @copyright       2009-2011, Website Baker Org. e.V.
9
 * @link			http://www.websitebaker2.org/
10
 * @license         http://www.gnu.org/licenses/gpl.html
11
 * @platform        WebsiteBaker 2.8.x
12
 * @requirements    PHP 5.2.2 and higher
13
 * @version         $Id: index.php 1414 2011-01-23 21:38:20Z Luisehahne $
14
 * @filesource		$HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/admin/start/index.php $
15
 * @lastmodified    $Date: 2011-01-23 22:38:20 +0100 (Sun, 23 Jan 2011) $
16
 *
17
*/
18

    
19
require('../../config.php');
20
require_once(WB_PATH.'/framework/class.admin.php');
21
$admin = new admin('Start','start');
22

    
23
// Setup template object
24
$template = new Template(THEME_PATH.'/templates');
25
$template->set_file('page', 'start.htt');
26
$template->set_block('page', 'main_block', 'main');
27

    
28
// Insert values into the template object
29
$template->set_var(array(
30
								'WELCOME_MESSAGE' => $MESSAGE['START']['WELCOME_MESSAGE'],
31
								'CURRENT_USER' => $MESSAGE['START']['CURRENT_USER'],
32
								'DISPLAY_NAME' => $admin->get_display_name(),
33
								'ADMIN_URL' => ADMIN_URL,
34
								'WB_URL' => WB_URL,
35
								'THEME_URL' => THEME_URL,
36
								'WB_VERSION' => WB_VERSION
37
								)
38
						);
39

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

    
66
$msg = (file_exists(WB_PATH.'/install/')) ?  $MESSAGE['START']['INSTALL_DIR_EXISTS'] : '';
67
$msg .= (file_exists(WB_PATH.'/upgrade-script.php')) ? '<br />'.'upgrade-script.php '.$TEXT['DELETE'] : '';
68

    
69
// Check if installation directory still exists
70
if(file_exists(WB_PATH.'/install/') || file_exists(WB_PATH.'/upgrade-script.php') ) {
71
	// Check if user is part of Adminstrators group
72
	if(in_array(1, $admin->get_groups_id()))
73
    {
74
		$template->set_var('WARNING', $msg );
75
	} else {
76
		$template->set_var('DISPLAY_WARNING', 'display:none;');
77
	}
78
} else {
79
	$template->set_var('DISPLAY_WARNING', 'display:none;');
80
}
81

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

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

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

    
135
// Parse template object
136
$template->parse('main', 'main_block', false);
137
$template->pparse('output', 'page');
138

    
139
// Print admin footer
140
$admin->print_footer();
141

    
142
?>
    (1-1/1)