summaryrefslogtreecommitdiff
path: root/core/controllers/admin_themes.php
diff options
context:
space:
mode:
authorFelix Rabinovich <virshu@users.sourceforge.net>2009-01-01 18:56:06 +0000
committerFelix Rabinovich <virshu@users.sourceforge.net>2009-01-01 18:56:06 +0000
commit50dceb50159c407629274352143f539d252bae6f (patch)
tree0f98c9effe89701ccd8d4880f1a92a3fc77761d1 /core/controllers/admin_themes.php
parent540e4ed9eb6df5955a58ea9946049a84efa67e33 (diff)
Theme Administration implementation
Diffstat (limited to 'core/controllers/admin_themes.php')
-rw-r--r--core/controllers/admin_themes.php41
1 files changed, 41 insertions, 0 deletions
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 @@
+<?php defined("SYSPATH") or die("No direct script access.");
+/**
+ * Gallery - a web based photo album viewer and editor
+ * Copyright (C) 2000-2008 Bharat Mediratta
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+class Admin_Themes_Controller extends Admin_Controller {
+ public function index() {
+ $view = new Admin_View("admin.html");
+ $view->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");
+ }
+}
+