fix categories array in categories theme
This commit is contained in:
parent
2cda8b0b7e
commit
b3fd39a712
|
@ -65,7 +65,7 @@
|
||||||
<title>{{ settings.title }}</title>
|
<title>{{ settings.title }}</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
{{ include(settings.file_sidebar) }}
|
{% include 'themes/categories/' ~ settings.file_sidebar %}
|
||||||
{{ include(settings.file_news) }}
|
{% include 'themes/categories/' ~ settings.file_news %}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -28,8 +28,15 @@
|
||||||
// Build homepage
|
// Build homepage
|
||||||
public static function homepage($settings) {
|
public static function homepage($settings) {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
return Element('themes/categories/frames.html', Array('config' => $config, 'settings' => $settings));
|
return Element(
|
||||||
|
'themes/categories/frames.html',
|
||||||
|
Array(
|
||||||
|
'config' => $config,
|
||||||
|
'settings' => $settings,
|
||||||
|
'categories' => Categories::getCategories($config)
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build news page
|
// Build news page
|
||||||
|
@ -51,6 +58,14 @@
|
||||||
public static function sidebar($settings) {
|
public static function sidebar($settings) {
|
||||||
global $config, $board;
|
global $config, $board;
|
||||||
|
|
||||||
|
return Element('themes/categories/sidebar.html', Array(
|
||||||
|
'settings' => $settings,
|
||||||
|
'config' => $config,
|
||||||
|
'categories' => Categories::getCategories($config)
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function getCategories($config) {
|
||||||
$categories = $config['categories'];
|
$categories = $config['categories'];
|
||||||
|
|
||||||
foreach ($categories as &$boards) {
|
foreach ($categories as &$boards) {
|
||||||
|
@ -61,13 +76,9 @@
|
||||||
$board = Array('title' => $title, 'uri' => sprintf($config['board_path'], $board));
|
$board = Array('title' => $title, 'uri' => sprintf($config['board_path'], $board));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return Element('themes/categories/sidebar.html', Array(
|
return $categories;
|
||||||
'settings' => $settings,
|
}
|
||||||
'config' => $config,
|
|
||||||
'categories' => $categories
|
|
||||||
));
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Reference in New Issue