From 50dceb50159c407629274352143f539d252bae6f Mon Sep 17 00:00:00 2001 From: Felix Rabinovich Date: Thu, 1 Jan 2009 18:56:06 +0000 Subject: Theme Administration implementation --- core/controllers/admin_themes.php | 41 +++++++++++++++++++++++++++++++++++++++ core/helpers/core_menu.php | 2 +- core/views/admin_themes.html.php | 13 +++++++++++++ 3 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 core/controllers/admin_themes.php create mode 100644 core/views/admin_themes.html.php (limited to 'core') diff --git a/core/controllers/admin_themes.php b/core/controllers/admin_themes.php new file mode 100644 index 00000000..5c9a2ad1 --- /dev/null +++ b/core/controllers/admin_themes.php @@ -0,0 +1,41 @@ +content = new View("admin_themes.html"); + $themes = scandir(THEMEPATH); + $view->content->themes = array_diff($themes, array(".", "..", ".svn")); + $view->content->active = module::get_var("core", "active_theme"); + print $view; + } + + public function save() { + access::verify_csrf(); + $theme = $this->input->post("theme"); + if ($theme != module::get_var("core", "active_theme")) { + module::set_var("core", "active_theme", $theme); + message::success(_("Updated Theme")); + log::success("graphics", sprintf(_("Changed theme to %s"), $theme)); + } + url::redirect("admin/themes"); + } +} + diff --git a/core/helpers/core_menu.php b/core/helpers/core_menu.php index 9bf6de3f..c863400f 100644 --- a/core/helpers/core_menu.php +++ b/core/helpers/core_menu.php @@ -97,7 +97,7 @@ class core_menu_Core { ->append(Menu::factory("link") ->id("themes") ->label(_("Themes")) - ->url("#")) + ->url(url::site("admin/themes"))) ->append(Menu::factory("link") ->id("image_sizes") ->label(_("Image Sizes")) diff --git a/core/views/admin_themes.html.php b/core/views/admin_themes.html.php new file mode 100644 index 00000000..b1fefd1e --- /dev/null +++ b/core/views/admin_themes.html.php @@ -0,0 +1,13 @@ + +
+

+

+
"> + + + checked="checked" /> + + "/> +
+
-- cgit v1.2.3