Project

General

Profile

« Previous | Next » 

Revision 1243

Added by Dietmar almost 15 years ago

Ticket #911 continue to fix CSS-errors in WB backend

View differences:

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
// Print admin header
27
require('../../config.php');
28
require_once(WB_PATH.'/framework/class.admin.php');
29
$admin = new admin('Access', 'groups');
30

  
31
// Create new template object for the modify/remove menu
32
$template = new Template(THEME_PATH.'/templates');
33
$template->set_file('page', 'groups.htt');
34
$template->set_block('page', 'main_block', 'main');
35
$template->set_block('main_block', 'manage_users_block', 'users');
36
// insert urls
37
$template->set_var(array(
38
	'ADMIN_URL' => ADMIN_URL,
39
	'WB_URL' => WB_URL,
40
	'WB_PATH' => WB_PATH,
41
	'THEME_URL' => THEME_URL
42
	)
43
);
44

  
45
// Get existing value from database
46
$database = new database();
47
$query = "SELECT group_id,name FROM ".TABLE_PREFIX."groups WHERE group_id != '1'";
48
$results = $database->query($query);
49
if($database->is_error()) {
50
	$admin->print_error($database->get_error(), 'index.php');
51
}
52

  
53
// Insert values into the modify/remove menu
54
$template->set_block('main_block', 'list_block', 'list');
55
if($results->numRows() > 0) {
56
	// Insert first value to say please select
57
	$template->set_var('VALUE', '');
58
	$template->set_var('NAME', $TEXT['PLEASE_SELECT'].'...');
59
	$template->parse('list', 'list_block', true);
60
	// Loop through groups
61
	while($group = $results->fetchRow()) {
62
		$template->set_var('VALUE', $group['group_id']);
63
		$template->set_var('NAME', $group['name']);
64
		$template->parse('list', 'list_block', true);
65
	}
66
} else {
67
	// Insert single value to say no groups were found
68
	$template->set_var('NAME', $TEXT['NONE_FOUND']);
69
	$template->parse('list', 'list_block', true);
70
}
71

  
72
// Insert permissions values
73
if($admin->get_permission('groups_add') != true) {
74
	$template->set_var('DISPLAY_ADD', 'hide');
75
}
76
if($admin->get_permission('groups_modify') != true) {
77
	$template->set_var('DISPLAY_MODIFY', 'hide');
78
}
79
if($admin->get_permission('groups_delete') != true) {
80
	$template->set_var('DISPLAY_DELETE', 'hide');
81
}
82

  
83
// Insert language headings
84
$template->set_var(array(
85
	'HEADING_MODIFY_DELETE_GROUP' => $HEADING['MODIFY_DELETE_GROUP'],
86
	'HEADING_ADD_GROUP' => $HEADING['ADD_GROUP']
87
	)
88
);
89
// Insert language text and messages
90
$template->set_var(array(
91
	'TEXT_MODIFY' => $TEXT['MODIFY'],
92
	'TEXT_DELETE' => $TEXT['DELETE'],
93
	'TEXT_MANAGE_USERS' => ( $admin->get_permission('users') == true ) ? $TEXT['MANAGE_USERS']: "",
94
	'CONFIRM_DELETE' => $MESSAGE['GROUPS']['CONFIRM_DELETE']
95
	)
96
);
97
if ( $admin->get_permission('users') == true ) $template->parse("users", "manage_users_block", true);
98
// Parse template object
99
$template->parse('main', 'main_block', false);
100
$template->pparse('output', 'page');
101

  
102
// Setup template for add group form
103
$template = new Template(THEME_PATH.'/templates');
104
$template->set_file('page', 'groups_form.htt');
105
$template->set_block('page', 'main_block', 'main');
106
$template->set_var('DISPLAY_EXTRA', 'none');
107
$template->set_var('ACTION_URL', ADMIN_URL.'/groups/add.php');
108
$template->set_var('SUBMIT_TITLE', $TEXT['ADD']);
109
$template->set_var('ADVANCED_ACTION', 'index.php');
110

  
111
// Tell the browser whether or not to show advanced options
112
if ( true == (isset( $_POST['advanced']) AND ( strpos( $_POST['advanced'], ">>") > 0 ) ) ) {
113
	$template->set_var('DISPLAY_ADVANCED', '');
114
	$template->set_var('DISPLAY_BASIC', 'none');
115
	$template->set_var('ADVANCED', 'yes');
116
	$template->set_var('ADVANCED_BUTTON', '<< '.$TEXT['HIDE_ADVANCED']);
117
} else {
118
	$template->set_var('DISPLAY_ADVANCED', 'none');
119
	$template->set_var('DISPLAY_BASIC', '');
120
	$template->set_var('ADVANCED', 'no');
121
	$template->set_var('ADVANCED_BUTTON', $TEXT['SHOW_ADVANCED'].' >>');
122
}
123

  
124
// Insert permissions values
125
if($admin->get_permission('groups_add') != true) {
126
	$template->set_var('DISPLAY_ADD', 'hide');
127
}
128

  
129
// Insert values into module list
130
$template->set_block('main_block', 'module_list_block', 'module_list');
131
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'module' AND function = 'page'");
132
if($result->numRows() > 0) {
133
	while($addon = $result->fetchRow()) {
134
		$template->set_var('VALUE', $addon['directory']);
135
		$template->set_var('NAME', $addon['name']);
136
		$template->parse('module_list', 'module_list_block', true);
137
	}
138
}
139

  
140
// Insert values into template list
141
$template->set_block('main_block', 'template_list_block', 'template_list');
142
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'template'");
143
if($result->numRows() > 0) {
144
	while($addon = $result->fetchRow()) {
145
		$template->set_var('VALUE', $addon['directory']);
146
		$template->set_var('NAME', $addon['name']);
147
		$template->parse('template_list', 'template_list_block', true);
148
	}
149
}
150

  
151
// Insert language text and messages
152
$template->set_var(array(
153
								'TEXT_RESET' => $TEXT['RESET'],
154
								'TEXT_ACTIVE' => $TEXT['ACTIVE'],
155
								'TEXT_DISABLED' => $TEXT['DISABLED'],
156
								'TEXT_PLEASE_SELECT' => $TEXT['PLEASE_SELECT'],
157
								'TEXT_USERNAME' => $TEXT['USERNAME'],
158
								'TEXT_PASSWORD' => $TEXT['PASSWORD'],
159
								'TEXT_RETYPE_PASSWORD' => $TEXT['RETYPE_PASSWORD'],
160
								'TEXT_DISPLAY_NAME' => $TEXT['DISPLAY_NAME'],
161
								'TEXT_EMAIL' => $TEXT['EMAIL'],
162
								'TEXT_GROUP' => $TEXT['GROUP'],
163
								'TEXT_SYSTEM_PERMISSIONS' => $TEXT['SYSTEM_PERMISSIONS'],
164
								'TEXT_MODULE_PERMISSIONS' => $TEXT['MODULE_PERMISSIONS'],
165
								'TEXT_TEMPLATE_PERMISSIONS' => $TEXT['TEMPLATE_PERMISSIONS'],
166
								'TEXT_NAME' => $TEXT['NAME'],
167
								'SECTION_PAGES' => $MENU['PAGES'],
168
								'SECTION_MEDIA' => $MENU['MEDIA'],
169
								'SECTION_MODULES' => $MENU['MODULES'],
170
								'SECTION_TEMPLATES' => $MENU['TEMPLATES'],
171
								'SECTION_SETTINGS' => $MENU['SETTINGS'],
172
								'SECTION_LANGUAGES' => $MENU['LANGUAGES'],
173
								'SECTION_USERS' => $MENU['USERS'],
174
								'SECTION_GROUPS' => $MENU['GROUPS'],
175
								'SECTION_ADMINTOOLS' => $MENU['ADMINTOOLS'],
176
								'TEXT_VIEW' => $TEXT['VIEW'],
177
								'TEXT_ADD' => $TEXT['ADD'],
178
								'TEXT_LEVEL' => $TEXT['LEVEL'],
179
								'TEXT_MODIFY' => $TEXT['MODIFY'],
180
								'TEXT_DELETE' => $TEXT['DELETE'],
181
								'TEXT_MODIFY_CONTENT' => $TEXT['MODIFY_CONTENT'],
182
								'TEXT_MODIFY_SETTINGS' => $TEXT['MODIFY_SETTINGS'],
183
								'HEADING_MODIFY_INTRO_PAGE' => $HEADING['MODIFY_INTRO_PAGE'],
184
								'TEXT_CREATE_FOLDER' => $TEXT['CREATE_FOLDER'],
185
								'TEXT_RENAME' => $TEXT['RENAME'],
186
								'TEXT_UPLOAD_FILES' => $TEXT['UPLOAD_FILES'],
187
								'TEXT_BASIC' => $TEXT['BASIC'],
188
								'TEXT_ADVANCED' => $TEXT['ADVANCED'],
189
								'CHANGING_PASSWORD' => $MESSAGE['USERS']['CHANGING_PASSWORD'],
190
								'CHECKED' => ' checked="checked"',
191
								'ADMIN_URL' => ADMIN_URL,
192
								'WB_URL' => WB_URL,
193
								'WB_PATH' => WB_PATH,
194
								'THEME_URL' => THEME_URL
195
								)
196
						);
197

  
198
// Parse template for add group form
199
$template->parse('main', 'main_block', false);
200
$template->pparse('output', 'page');
201

  
202
// Print the admin footer
203
$admin->print_footer();
204

  
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      settings
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
// Print admin header
62
require('../../config.php');
63
require_once(WB_PATH.'/framework/class.admin.php');
64
$admin = new admin('Access', 'groups');
65

  
66
// Create new template object for the modify/remove menu
67
$template = new Template(THEME_PATH.'/templates');
68
$template->set_file('page', 'groups.htt');
69
$template->set_block('page', 'main_block', 'main');
70
$template->set_block('main_block', 'manage_users_block', 'users');
71
// insert urls
72
$template->set_var(array(
73
	'ADMIN_URL' => ADMIN_URL,
74
	'WB_URL' => WB_URL,
75
	'WB_PATH' => WB_PATH,
76
	'THEME_URL' => THEME_URL
77
	)
78
);
79

  
80
// Get existing value from database
81
$database = new database();
82
$query = "SELECT group_id,name FROM ".TABLE_PREFIX."groups WHERE group_id != '1'";
83
$results = $database->query($query);
84
if($database->is_error()) {
85
	$admin->print_error($database->get_error(), 'index.php');
86
}
87

  
88
// Insert values into the modify/remove menu
89
$template->set_block('main_block', 'list_block', 'list');
90
if($results->numRows() > 0) {
91
	// Insert first value to say please select
92
	$template->set_var('VALUE', '');
93
	$template->set_var('NAME', $TEXT['PLEASE_SELECT'].'...');
94
	$template->parse('list', 'list_block', true);
95
	// Loop through groups
96
	while($group = $results->fetchRow()) {
97
		$template->set_var('VALUE', $group['group_id']);
98
		$template->set_var('NAME', $group['name']);
99
		$template->parse('list', 'list_block', true);
100
	}
101
} else {
102
	// Insert single value to say no groups were found
103
	$template->set_var('NAME', $TEXT['NONE_FOUND']);
104
	$template->parse('list', 'list_block', true);
105
}
106

  
107
// Insert permissions values
108
if($admin->get_permission('groups_add') != true) {
109
	$template->set_var('DISPLAY_ADD', 'hide');
110
}
111
if($admin->get_permission('groups_modify') != true) {
112
	$template->set_var('DISPLAY_MODIFY', 'hide');
113
}
114
if($admin->get_permission('groups_delete') != true) {
115
	$template->set_var('DISPLAY_DELETE', 'hide');
116
}
117

  
118
// Insert language headings
119
$template->set_var(array(
120
	'HEADING_MODIFY_DELETE_GROUP' => $HEADING['MODIFY_DELETE_GROUP'],
121
	'HEADING_ADD_GROUP' => $HEADING['ADD_GROUP']
122
	)
123
);
124
// Insert language text and messages
125
$template->set_var(array(
126
	'TEXT_MODIFY' => $TEXT['MODIFY'],
127
	'TEXT_DELETE' => $TEXT['DELETE'],
128
	'TEXT_MANAGE_USERS' => ( $admin->get_permission('users') == true ) ? $TEXT['MANAGE_USERS']: "",
129
	'CONFIRM_DELETE' => $MESSAGE['GROUPS']['CONFIRM_DELETE']
130
	)
131
);
132
if ( $admin->get_permission('users') == true ) $template->parse("users", "manage_users_block", true);
133
// Parse template object
134
$template->parse('main', 'main_block', false);
135
$template->pparse('output', 'page');
136

  
137
// Setup template for add group form
138
$template = new Template(THEME_PATH.'/templates');
139
$template->set_file('page', 'groups_form.htt');
140
$template->set_block('page', 'main_block', 'main');
141
$template->set_var('DISPLAY_EXTRA', 'display:none;');
142
$template->set_var('ACTION_URL', ADMIN_URL.'/groups/add.php');
143
$template->set_var('SUBMIT_TITLE', $TEXT['ADD']);
144
$template->set_var('ADVANCED_ACTION', 'index.php');
145

  
146
// Tell the browser whether or not to show advanced options
147
if ( true == (isset( $_POST['advanced']) AND ( strpos( $_POST['advanced'], ">>") > 0 ) ) ) {
148
	$template->set_var('DISPLAY_ADVANCED', '');
149
	$template->set_var('DISPLAY_BASIC', 'display:none;');
150
	$template->set_var('ADVANCED', 'yes');
151
	$template->set_var('ADVANCED_BUTTON', '<< '.$TEXT['HIDE_ADVANCED']);
152
} else {
153
	$template->set_var('DISPLAY_ADVANCED', 'display:none;');
154
	$template->set_var('DISPLAY_BASIC', '');
155
	$template->set_var('ADVANCED', 'no');
156
	$template->set_var('ADVANCED_BUTTON', $TEXT['SHOW_ADVANCED'].' >>');
157
}
158

  
159
// Insert permissions values
160
if($admin->get_permission('groups_add') != true) {
161
	$template->set_var('DISPLAY_ADD', 'hide');
162
}
163

  
164
// Insert values into module list
165
$template->set_block('main_block', 'module_list_block', 'module_list');
166
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'module' AND function = 'page'");
167
if($result->numRows() > 0) {
168
	while($addon = $result->fetchRow()) {
169
		$template->set_var('VALUE', $addon['directory']);
170
		$template->set_var('NAME', $addon['name']);
171
		$template->parse('module_list', 'module_list_block', true);
172
	}
173
}
174

  
175
// Insert values into template list
176
$template->set_block('main_block', 'template_list_block', 'template_list');
177
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'template'");
178
if($result->numRows() > 0) {
179
	while($addon = $result->fetchRow()) {
180
		$template->set_var('VALUE', $addon['directory']);
181
		$template->set_var('NAME', $addon['name']);
182
		$template->parse('template_list', 'template_list_block', true);
183
	}
184
}
185

  
186
// Insert language text and messages
187
$template->set_var(array(
188
								'TEXT_RESET' => $TEXT['RESET'],
189
								'TEXT_ACTIVE' => $TEXT['ACTIVE'],
190
								'TEXT_DISABLED' => $TEXT['DISABLED'],
191
								'TEXT_PLEASE_SELECT' => $TEXT['PLEASE_SELECT'],
192
								'TEXT_USERNAME' => $TEXT['USERNAME'],
193
								'TEXT_PASSWORD' => $TEXT['PASSWORD'],
194
								'TEXT_RETYPE_PASSWORD' => $TEXT['RETYPE_PASSWORD'],
195
								'TEXT_DISPLAY_NAME' => $TEXT['DISPLAY_NAME'],
196
								'TEXT_EMAIL' => $TEXT['EMAIL'],
197
								'TEXT_GROUP' => $TEXT['GROUP'],
198
								'TEXT_SYSTEM_PERMISSIONS' => $TEXT['SYSTEM_PERMISSIONS'],
199
								'TEXT_MODULE_PERMISSIONS' => $TEXT['MODULE_PERMISSIONS'],
200
								'TEXT_TEMPLATE_PERMISSIONS' => $TEXT['TEMPLATE_PERMISSIONS'],
201
								'TEXT_NAME' => $TEXT['NAME'],
202
								'SECTION_PAGES' => $MENU['PAGES'],
203
								'SECTION_MEDIA' => $MENU['MEDIA'],
204
								'SECTION_MODULES' => $MENU['MODULES'],
205
								'SECTION_TEMPLATES' => $MENU['TEMPLATES'],
206
								'SECTION_SETTINGS' => $MENU['SETTINGS'],
207
								'SECTION_LANGUAGES' => $MENU['LANGUAGES'],
208
								'SECTION_USERS' => $MENU['USERS'],
209
								'SECTION_GROUPS' => $MENU['GROUPS'],
210
								'SECTION_ADMINTOOLS' => $MENU['ADMINTOOLS'],
211
								'TEXT_VIEW' => $TEXT['VIEW'],
212
								'TEXT_ADD' => $TEXT['ADD'],
213
								'TEXT_LEVEL' => $TEXT['LEVEL'],
214
								'TEXT_MODIFY' => $TEXT['MODIFY'],
215
								'TEXT_DELETE' => $TEXT['DELETE'],
216
								'TEXT_MODIFY_CONTENT' => $TEXT['MODIFY_CONTENT'],
217
								'TEXT_MODIFY_SETTINGS' => $TEXT['MODIFY_SETTINGS'],
218
								'HEADING_MODIFY_INTRO_PAGE' => $HEADING['MODIFY_INTRO_PAGE'],
219
								'TEXT_CREATE_FOLDER' => $TEXT['CREATE_FOLDER'],
220
								'TEXT_RENAME' => $TEXT['RENAME'],
221
								'TEXT_UPLOAD_FILES' => $TEXT['UPLOAD_FILES'],
222
								'TEXT_BASIC' => $TEXT['BASIC'],
223
								'TEXT_ADVANCED' => $TEXT['ADVANCED'],
224
								'CHANGING_PASSWORD' => $MESSAGE['USERS']['CHANGING_PASSWORD'],
225
								'CHECKED' => ' checked="checked"',
226
								'ADMIN_URL' => ADMIN_URL,
227
								'WB_URL' => WB_URL,
228
								'WB_PATH' => WB_PATH,
229
								'THEME_URL' => THEME_URL
230
								)
231
						);
232

  
233
// Parse template for add group form
234
$template->parse('main', 'main_block', false);
235
$template->pparse('output', 'page');
236

  
237
// Print the admin footer
238
$admin->print_footer();
239

  
205 240
?>

Also available in: Unified diff