Project

General

Profile

« Previous | Next » 

Revision 199

Added by ryan about 19 years ago

Fixed minor bugs with template and module permissions on groups

View differences:

groups.php
85 85
	
86 86
	// Insert values into module list
87 87
	$template->set_block('main_block', 'module_list_block', 'module_list');
88
	if ($handle = opendir(WB_PATH.'/modules/')) {
89
		while (false !== ($file = readdir($handle))) {
90
			if($file != "." AND $file != ".." AND $file != ".svn" AND is_dir(WB_PATH."/modules/$file") AND file_exists(WB_PATH."/modules/$file/info.php")) {
91
				// Include the modules info file
92
				require(WB_PATH.'/modules/'.$file.'/info.php');
93
				if ($module_type=='page') {
94
					$template->set_var('VALUE', $file);
95
					$template->set_var('NAME', $module_name);
96
					if(!is_numeric(array_search($file, $module_permissions))) {
97
						$template->set_var('CHECKED', 'checked');
98
					} else {
99
						$template->set_var('CHECKED', '');
100
					}
101
					$template->parse('module_list', 'module_list_block', true);
102
				}
88
	$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'module' AND function = 'page'");
89
	if($result->numRows() > 0) {
90
		while($addon = $result->fetchRow()) {
91
			$template->set_var('VALUE', $addon['directory']);
92
			$template->set_var('NAME', $addon['name']);
93
			if(!is_numeric(array_search($addon['directory'], $module_permissions))) {
94
				$template->set_var('CHECKED', 'checked');
95
			} else {
96
				$template->set_var('CHECKED', '');
103 97
			}
98
			$template->parse('module_list', 'module_list_block', true);
104 99
		}
105 100
	}
106 101
	
107 102
	// Insert values into template list
108 103
	$template->set_block('main_block', 'template_list_block', 'template_list');
109
	if ($handle = opendir(WB_PATH.'/templates/')) {
110
		while (false !== ($file = readdir($handle))) {
111
			if($file != "." AND $file != ".." AND $file != ".svn" AND is_dir(WB_PATH."/templates/$file") AND file_exists(WB_PATH."/templates/$file/info.php")) {
112
				// Include the modules info file
113
				require(WB_PATH.'/templates/'.$file.'/info.php');
114
				$template->set_var('VALUE', $file);
115
				$template->set_var('NAME', $template_name);
116
				if(!is_numeric(array_search($file, $template_permissions))) {
117
					$template->set_var('CHECKED', 'checked');
118
				} else {
119
					$template->set_var('CHECKED', '');
120
				}
121
				$template->parse('template_list', 'template_list_block', true);
104
	$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'template'");
105
	if($result->numRows() > 0) {
106
		while($addon = $result->fetchRow()) {
107
			$template->set_var('VALUE', $addon['directory']);
108
			$template->set_var('NAME', $addon['name']);
109
			if(!is_numeric(array_search($addon['directory'], $template_permissions))) {
110
				$template->set_var('CHECKED', 'checked');
111
			} else {
112
				$template->set_var('CHECKED', '');
122 113
			}
114
			$template->parse('template_list', 'template_list_block', true);
123 115
		}
124 116
	}
125
	
117
		
126 118
	// Insert language text and messages
127 119
	$template->set_var(array(
128 120
									'TEXT_RESET' => $TEXT['RESET'],

Also available in: Unified diff