summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers/gallery_event.php
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-11-18 14:37:49 -0800
committerTim Almdal <tnalmdal@shaw.ca>2009-11-18 14:37:49 -0800
commit1692ee130887a6ad1ba68aa34a96ad36161600f9 (patch)
tree2901fee570d5ee8aa6a0ada01c1d92980be11e03 /modules/gallery/helpers/gallery_event.php
parent372f589f66436c5b5bb8ed8a98532842c1e01a71 (diff)
Currently Admin_Theme_Options controller assumes that all the themes will provide the same values. This change corrects that assumption and moves the management of the theme options, including creating the form and updating the theme options into the theme.
Diffstat (limited to 'modules/gallery/helpers/gallery_event.php')
-rw-r--r--modules/gallery/helpers/gallery_event.php21
1 files changed, 16 insertions, 5 deletions
diff --git a/modules/gallery/helpers/gallery_event.php b/modules/gallery/helpers/gallery_event.php
index 3139951f..88f4a67b 100644
--- a/modules/gallery/helpers/gallery_event.php
+++ b/modules/gallery/helpers/gallery_event.php
@@ -245,11 +245,7 @@ class gallery_event_Core {
->id("themes")
->label(t("Theme choice"))
->url(url::site("admin/themes")))
- ->append(Menu::factory("link")
- ->id("theme_options")
- ->label(t("Theme options"))
- ->url(url::site("admin/theme_options")))
- ->append(Menu::factory("link")
+ ->append(Menu::factory("link")
->id("sidebar")
->label(t("Manage sidebar"))
->url(url::site("admin/sidebar"))))
@@ -260,6 +256,21 @@ class gallery_event_Core {
->id("maintenance")
->label(t("Maintenance"))
->url(url::site("admin/maintenance")));
+
+ $theme_name = theme::$site;
+ $theme_helper = THEMEPATH . "$theme_name/helpers/{$theme_name}.php";
+ if (file_exists($theme_helper)) {
+ require_once($theme_helper);
+
+ if (method_exists($theme_name, "get_admin_form")) {
+ $info = theme::get_info($theme_name);
+ $menu->get("appearance_menu")
+ ->add_after("themes", Menu::factory("link")
+ ->id("theme_options")
+ ->label(t("%name options", array("name" => $info->name)))
+ ->url(url::site("admin/theme_options")));
+ }
+ }
return $menu;
}