diff options
author | Felix Rabinovich <virshu@users.sourceforge.net> | 2009-01-22 01:52:41 +0000 |
---|---|---|
committer | Felix Rabinovich <virshu@users.sourceforge.net> | 2009-01-22 01:52:41 +0000 |
commit | 90666f7e04dc300480bb2972917b135294ff05f6 (patch) | |
tree | ff0d99173cf70ce7f778f58f3d134c5ee50a189c | |
parent | 7a1b986b5b6085ab345d00438d4e94ce4e7106bb (diff) |
Theme details. Initial release
-rw-r--r-- | core/controllers/admin_themedetails.php | 31 | ||||
-rw-r--r-- | core/helpers/core_menu.php | 6 | ||||
-rw-r--r-- | core/helpers/theme.php | 16 |
3 files changed, 42 insertions, 11 deletions
diff --git a/core/controllers/admin_themedetails.php b/core/controllers/admin_themedetails.php new file mode 100644 index 00000000..80d3f187 --- /dev/null +++ b/core/controllers/admin_themedetails.php @@ -0,0 +1,31 @@ +<?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_Themedetails_Controller extends Admin_Controller { + public function index() { + $view = new Admin_View("admin.html"); + $view->content = theme::get_edit_form_admin(); + print $view; + } + + public function save() { + access::verify_csrf(); + } +} + diff --git a/core/helpers/core_menu.php b/core/helpers/core_menu.php index cca08885..0fbf59d5 100644 --- a/core/helpers/core_menu.php +++ b/core/helpers/core_menu.php @@ -127,9 +127,9 @@ class core_menu_Core { ->label(t("Themes")) ->url(url::site("admin/themes"))) ->append(Menu::factory("link") - ->id("image_sizes") - ->label(t("Image Sizes")) - ->url("#"))) + ->id("theme_details") + ->label(t("Theme Details")) + ->url(url::site("admin/themedetails")))) ->append(Menu::factory("submenu") ->id("users_groups_menu") ->label(t("Users/Groups"))) diff --git a/core/helpers/theme.php b/core/helpers/theme.php index 74a41459..f36eb371 100644 --- a/core/helpers/theme.php +++ b/core/helpers/theme.php @@ -38,22 +38,22 @@ class theme_Core { Kohana::config_set('core.modules', $modules); } - static function get_edit_form_admin($theme) { - $form = new Forge("admin/themes/edit/{$theme->id}", + static function get_edit_form_admin() { + $form = new Forge("admin/themes/edit/", '', null, array("id" =>"gThemeDetailsForm")); - $group = $form->group("edit_theme")->label($theme->description); + $group = $form->group("edit_theme"); $group->input("page_size")->label(t("Items per page"))->id("gPageSize")-> rules('required|valid_digit')-> - value(self::get_var($theme->id, "page_size", 90)); + value(module::get_var("core", "page_size")); $group->input("thumb_size")->label(t("Thumbnail size (in pixels)"))->id("gThumbSize")-> rules('required|valid_digit')-> - value(self::get_var($theme->id, "thumb_size", 300)); + value(module::get_var("core", "thumb_size")); $group->input("resize_size")->label(t("Resized image size (in pixels)"))->id("gResizeSize")-> rules('required|valid_digit')-> - value(self::get_var($theme->id, "resize_size", 600)); + value(module::get_var("core", "resize_size")); $group->submit("")->value(t("Modify Theme")); - return $form; - } + return $form->render(); + } static function get_edit_form_content($theme_name) { $file = THEMEPATH . $theme_name . "/theme.info"; |