theme error handling
This commit is contained in:
@@ -27,4 +27,16 @@ Requires $config[\'boards\'] and $config[\'categories\'].';
|
||||
|
||||
// Unique function name for building everything
|
||||
$theme['build_function'] = 'categories_build';
|
||||
|
||||
$theme['install_callback'] = 'categories_install';
|
||||
if(!function_exists('categories_install')) {
|
||||
function categories_install($settings) {
|
||||
global $config;
|
||||
|
||||
if(!isset($config['boards']) || !isset($config['categories'])) {
|
||||
return Array(false, '<h2>Prerequisites not met!</h2>' .
|
||||
'This theme requires $config[\'boards\'] and $config[\'categories\'] to be set.');
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@@ -121,27 +121,31 @@
|
||||
'<li><a class="system" href="javascript:parent.removeFrames()">[Remove Frames]</a></li>' .
|
||||
'</ul></fieldset>';
|
||||
|
||||
for($cat = 0; $cat < count($config['categories']); $cat++) {
|
||||
$body .= '<fieldset><legend>' . $config['categories'][$cat] . '</legend><ul>';
|
||||
if(isset($config['categories'])) {
|
||||
for($cat = 0; $cat < count($config['categories']); $cat++) {
|
||||
$body .= '<fieldset><legend>' . $config['categories'][$cat] . '</legend><ul>';
|
||||
|
||||
foreach($config['boards'][$cat] as &$board) {
|
||||
$body .= '<li><a href="' .
|
||||
sprintf($config['board_path'], $board) .
|
||||
'">' . boardTitle($board) . '</a></li>';
|
||||
foreach($config['boards'][$cat] as &$board) {
|
||||
$body .= '<li><a href="' .
|
||||
sprintf($config['board_path'], $board) .
|
||||
'">' . boardTitle($board) . '</a></li>';
|
||||
}
|
||||
|
||||
$body .= '</ul></fieldset>';
|
||||
}
|
||||
|
||||
$body .= '</ul></fieldset>';
|
||||
}
|
||||
|
||||
foreach($config['custom_categories'] as $name => &$group) {
|
||||
$body .= '<fieldset><legend>' . $name . '</legend><ul>';
|
||||
if(isset($config['custom_categories'])) {
|
||||
foreach($config['custom_categories'] as $name => &$group) {
|
||||
$body .= '<fieldset><legend>' . $name . '</legend><ul>';
|
||||
|
||||
foreach($group as $title => &$url) {
|
||||
$body .= '<li><a href="' . $url .
|
||||
'">' . $title . '</a></li>';
|
||||
foreach($group as $title => &$url) {
|
||||
$body .= '<li><a href="' . $url .
|
||||
'">' . $title . '</a></li>';
|
||||
}
|
||||
|
||||
$body .= '</ul></fieldset>';
|
||||
}
|
||||
|
||||
$body .= '</ul></fieldset>';
|
||||
}
|
||||
|
||||
// Finish page
|
||||
|
Reference in New Issue
Block a user