Browse Source

Merge pull request #1 from towards-a-new-leftypol/sidebarFix_fix

fix categories array in categories theme
pull/40/head
nonmakina 3 years ago
committed by GitHub
parent
commit
ce2e0f3c21
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      templates/themes/categories/frames.html
  2. 29
      templates/themes/categories/theme.php

4
templates/themes/categories/frames.html

@ -65,7 +65,7 @@
<title>{{ settings.title }}</title>
</head>
<body>
{{ include(settings.file_sidebar) }}
{{ include(settings.file_news) }}
{% include 'themes/categories/' ~ settings.file_sidebar %}
{% include 'themes/categories/' ~ settings.file_news %}
</body>
</html>

29
templates/themes/categories/theme.php

@ -28,8 +28,15 @@
// Build homepage
public static function homepage($settings) {
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
@ -51,6 +58,14 @@
public static function sidebar($settings) {
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'];
foreach ($categories as &$boards) {
@ -61,13 +76,9 @@
$board = Array('title' => $title, 'uri' => sprintf($config['board_path'], $board));
}
}
return Element('themes/categories/sidebar.html', Array(
'settings' => $settings,
'config' => $config,
'categories' => $categories
));
}
return $categories;
}
};
?>

Loading…
Cancel
Save