Revision 169
Added by ryan about 19 years ago
settings.php | ||
---|---|---|
290 | 290 |
} |
291 | 291 |
// Templates list |
292 | 292 |
$template->set_block('main_block', 'template_list_block', 'template_list'); |
293 |
if($handle = opendir(WB_PATH.'/templates/')) { |
|
294 |
while(false !== ($file = readdir($handle))) { |
|
295 |
if($file != "." AND $file != ".." AND $file != ".svn" AND is_dir(WB_PATH."/templates/$file") AND file_exists(WB_PATH.'/templates/'.$file.'/info.php')) { |
|
296 |
// Include the templates info file |
|
297 |
require(WB_PATH.'/templates/'.$file.'/info.php'); |
|
298 |
// Check if the user has perms to use this template |
|
299 |
if($file == $results_array['template'] OR $admin->get_permission($file, 'template') == true) { |
|
300 |
$template->set_var('VALUE', $file); |
|
301 |
$template->set_var('NAME', $template_name); |
|
302 |
if($file == $results_array['template']) { |
|
303 |
$template->set_var('SELECTED', ' selected'); |
|
304 |
} else { |
|
305 |
$template->set_var('SELECTED', ''); |
|
306 |
} |
|
307 |
$template->parse('template_list', 'template_list_block', true); |
|
293 |
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'template'"); |
|
294 |
if($result->numRows() > 0) { |
|
295 |
while($addon = $result->fetchRow()) { |
|
296 |
// Check if the user has perms to use this template |
|
297 |
if($addon['directory'] == $results_array['template'] OR $admin->get_permission($addon['directory'], 'template') == true) { |
|
298 |
$template->set_var('VALUE', $addon['directory']); |
|
299 |
$template->set_var('NAME', $addon['name']); |
|
300 |
if($addon['directory'] == $results_array['template']) { |
|
301 |
$template->set_var('SELECTED', ' selected'); |
|
302 |
} else { |
|
303 |
$template->set_var('SELECTED', ''); |
|
308 | 304 |
} |
305 |
$template->parse('template_list', 'template_list_block', true); |
|
309 | 306 |
} |
310 | 307 |
} |
311 |
// Unset all menu arrays |
|
312 |
unset($menu); |
|
313 | 308 |
} |
314 | 309 |
|
315 | 310 |
// Menu list |
Also available in: Unified diff
Fixed addon listing in numerous places so it now use's DB for info