Project

General

Profile

« Previous | Next » 

Revision 1043

Added by Matthias over 15 years ago

Codechanges to get rid of the empty display(style) declaration "style='display: ;'", and to avoid to generate (hidden) elements if the user isn't alowed to edit one.

View differences:

index.php
34 34

  
35 35
// Insert values into the template object
36 36
$template->set_var(array(
37
								'ADMIN_URL' => ADMIN_URL,
38
								'THEME_URL' => THEME_URL,
39
								'WB_URL' => WB_URL
40
								)
41
						);
37
		'ADMIN_URL' => ADMIN_URL,
38
		'THEME_URL' => THEME_URL,
39
		'WB_URL' => WB_URL
40
	)
41
);
42 42

  
43
// Insert permission values into the template object
44
if($admin->get_permission('modules') != true) {
45
	$template->set_var('DISPLAY_MODULES', 'none');
46
}
47
if($admin->get_permission('templates') != true) {
48
	$template->set_var('DISPLAY_TEMPLATES', 'none');
49
}
50
if($admin->get_permission('languages') != true) {
51
	$template->set_var('DISPLAY_LANGUAGES', 'none');
52
}
53
if(!isset($_GET['advanced']) || $admin->get_permission('admintools') != true) {
54
	$template->set_var('DISPLAY_RELOAD', 'none');
55
}
43
/**
44
 *	Setting up the blocks
45
 */
46
$template->set_block('main_block', "modules_block", "modules");
47
$template->set_block('main_block', "templates_block", "templates");
48
$template->set_block('main_block', "languages_block", "languages");
49
$template->set_block('main_block', "reload_block", "reload");
56 50

  
57
// Insert section names and descriptions
51
/**
52
 *	Insert permission values into the template object
53
 *	Obsolete as we are using blocks ... see "parsing the blocks" section
54
 */
55
$display_none = "style=\"display: none;\"";
56
if($admin->get_permission('modules') != true) 	$template->set_var('DISPLAY_MODULES', $display_none);	
57
if($admin->get_permission('templates') != true)	$template->set_var('DISPLAY_TEMPLATES', $display_none);
58
if($admin->get_permission('languages') != true)	$template->set_var('DISPLAY_LANGUAGES', $display_none);
59
if(!isset($_GET['advanced']) || $admin->get_permission('admintools') != true)
60
	$template->set_var('DISPLAY_RELOAD', $display_none);
61

  
62
/**
63
 *	Insert section names and descriptions
64
 */
58 65
$template->set_var(array(
59 66
	'ADDONS_OVERVIEW' => $MENU['ADDONS'],
60 67
	'MODULES' => $MENU['MODULES'],
......
72 79
	)
73 80
);
74 81

  
75
// Parse template object
82
/**
83
 *	Parsing the blocks ...
84
 */
85
if ( $admin->get_permission('modules') == true) $template->parse('main_block', "modules_block", true);
86
if ( $admin->get_permission('templates') == true) $template->parse('main_block', "templates_block", true);
87
if ( $admin->get_permission('languages') == true) $template->parse('main_block', "languages_block", true);
88
if ( isset($_GET['advanced']) AND $admin->get_permission('admintools') == true) $template->parse('main_block', "reload_block", true);
89

  
90
/**
91
 *	Parse template object
92
 */
76 93
$template->parse('main', 'main_block', false);
77 94
$template->pparse('output', 'page');
78 95

  
79
// Print admin footer
96
/**
97
 *	Print admin footer
98
 */
80 99
$admin->print_footer();
81 100

  
82 101
?>

Also available in: Unified diff