diff --git a/CHANGELOG.md b/CHANGELOG.md
index 39fb954b..ef2bfabb 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,6 +12,7 @@ First forked version from bludit
### Added
- Admin: Added a sidebar panel that show all sidebar widget to be activated/deactivated
+- Admin: Show some pages only if the theme support their features
### Changed
diff --git a/bl-kernel/admin/themes/koblog/html/sidebar.php b/bl-kernel/admin/themes/koblog/html/sidebar.php
index 4a9fd844..18d86ea9 100644
--- a/bl-kernel/admin/themes/koblog/html/sidebar.php
+++ b/bl-kernel/admin/themes/koblog/html/sidebar.php
@@ -35,9 +35,11 @@
p('Themes') ?>
+
p('Sidebar') ?>
+
p('Settings') ?>
diff --git a/bl-kernel/helpers/theme.class.php b/bl-kernel/helpers/theme.class.php
index e351de3b..4e6118fa 100644
--- a/bl-kernel/helpers/theme.class.php
+++ b/bl-kernel/helpers/theme.class.php
@@ -282,4 +282,31 @@ class Theme
// https://github.com/psfpro/bootstrap-html5sortable
return '' . PHP_EOL;
}
+
+ public static function supports($featureToCheck, $verifySidebar = true)
+ {
+ global $site;
+ global $themes;
+ $themeName = $site->theme();
+
+ if (isset($themes)) {
+ foreach ($themes as $theme) {
+ if ($theme['dirname'] == $site->theme()) {
+ if (isset($theme['supports'])) {
+ foreach ($theme['supports'] as $feature) {
+ if ($featureToCheck == $feature) {
+ return true;
+ }
+ if ($verifySidebar && $feature == "sidebar") {
+ // TODO: add check to see if a plugin support it in the sidebar
+ return true;
+ }
+ }
+ return false;
+ }
+ }
+ }
+ }
+ return false;
+ }
}
diff --git a/bl-themes/alternative/metadata.json b/bl-themes/alternative/metadata.json
index fe3da245..289facc2 100644
--- a/bl-themes/alternative/metadata.json
+++ b/bl-themes/alternative/metadata.json
@@ -7,5 +7,6 @@
"license": "MIT",
"compatible": "3.15",
"notes": "",
- "plugin": "alternative"
+ "plugin": "alternative",
+ "supports": []
}
diff --git a/bl-themes/blogx/metadata.json b/bl-themes/blogx/metadata.json
index 93726165..4e6fd4f4 100644
--- a/bl-themes/blogx/metadata.json
+++ b/bl-themes/blogx/metadata.json
@@ -6,5 +6,6 @@
"releaseDate": "2024-08-23",
"license": "MIT",
"compatible": "kb_0.0.1",
- "notes": ""
+ "notes": "",
+ "supports": ["sidebar"]
}