From 006f18dc7ac4c40e1ca48de5bc4d8bb492bbc454 Mon Sep 17 00:00:00 2001 From: Felix Rabinovich Date: Sat, 10 Jan 2009 08:00:43 +0000 Subject: Split themes into two tabs for regular and admin themes --- core/controllers/admin_themes.php | 11 ++++- core/views/admin_themes.html.php | 72 ++++++++++++++++++++++--------- themes/admin_default/js/ui.init.js | 13 +++++- themes/admin_default/theme.info | 2 + themes/admin_default/views/admin.html.php | 3 ++ themes/default/theme.info | 2 + 6 files changed, 80 insertions(+), 23 deletions(-) diff --git a/core/controllers/admin_themes.php b/core/controllers/admin_themes.php index 4e9534fd..e03e9870 100644 --- a/core/controllers/admin_themes.php +++ b/core/controllers/admin_themes.php @@ -22,17 +22,24 @@ class Admin_Themes_Controller extends Admin_Controller { $view = new Admin_View("admin.html"); $view->content = new View("admin_themes.html"); $themeDir = scandir(THEMEPATH); - $themes = array(); + $themes = $admin_themes = array(); foreach ($themeDir as $theme_name) { if (substr($theme_name, 0, 1) == ".") continue; $file = THEMEPATH . $theme_name . "/theme.info"; $theme_info = new ArrayObject(parse_ini_file($file), ArrayObject::ARRAY_AS_PROPS); $details = theme::get_edit_form_admin($theme_info); $theme_info['details'] = $details; - $themes[$theme_name] = $theme_info; + if ($theme_info->regular) { + $themes[$theme_name] = $theme_info; + } + if ($theme_info->admin) { + $admin_themes[$theme_name] = $theme_info; + } } $view->content->themes = $themes; + $view->content->admin_themes = $admin_themes; $view->content->active = module::get_var("core", "active_theme"); + $view->content->active_admin = module::get_var("core", "active_admin_theme"); print $view; } diff --git a/core/views/admin_themes.html.php b/core/views/admin_themes.html.php index c9e62983..9f0cfd56 100644 --- a/core/views/admin_themes.html.php +++ b/core/views/admin_themes.html.php @@ -3,26 +3,58 @@

"> - - $theme): ?> - - - -
-
- - " alt="name ?>" /> -
- description ?>
- - name ?> -
- - " alt="name ?>" /> -
- description ?>
- name ?> -
+
+ +
+ + $theme): ?> + + + +
+
+ + " alt="name ?>" /> +
+ description ?>
+ + name ?> +
+ + " alt="name ?>" /> +
+ description ?>
+ name ?> +
+
+
+ + $theme): ?> + + + +
+
+ + " + alt="name ?>" /> +
+ description ?>
+ + name ?> +
+ + " alt="name ?>" /> +
+ description ?>
+ name ?> +
+
+
+ "/>
diff --git a/themes/admin_default/js/ui.init.js b/themes/admin_default/js/ui.init.js index c9cf4441..b662ce80 100644 --- a/themes/admin_default/js/ui.init.js +++ b/themes/admin_default/js/ui.init.js @@ -24,7 +24,18 @@ $(document).ready(function(){ }; $("#gThemeAdmin :radio").click(function(event) { - console.log("clicked radio " + event.target.value); $("#gThemeDetails").load("themes/edit/" + event.target.value); }); + + $("#gThemeTabs > ul").tabs({ select: updateThemeDetails }); }); + +function updateThemeDetails(evt, ui) { + var themeName; + if (ui.index == 0) { + themeName = $("#gtRegular :checked").val(); + } else { + themeName = $("#gtAdmin :checked").val(); + } + $("#gThemeDetails").load("themes/edit/" + themeName); +} diff --git a/themes/admin_default/theme.info b/themes/admin_default/theme.info index a96713d4..7805253f 100644 --- a/themes/admin_default/theme.info +++ b/themes/admin_default/theme.info @@ -2,3 +2,5 @@ name = Default Admin description = Default Gallery theme to administer version = 1 author = Gallery Team +admin = 1 +regular = 1 diff --git a/themes/admin_default/views/admin.html.php b/themes/admin_default/views/admin.html.php index 406697ba..9e9973f9 100644 --- a/themes/admin_default/views/admin.html.php +++ b/themes/admin_default/views/admin.html.php @@ -16,6 +16,9 @@ type="text/css" media="screen,projection"> " type="text/css" media="screen,projection"> + + + diff --git a/themes/default/theme.info b/themes/default/theme.info index 6f540473..61a0bb60 100644 --- a/themes/default/theme.info +++ b/themes/default/theme.info @@ -2,3 +2,5 @@ name = Default description = Default Gallery theme to view photos and albums version = 1 author = Gallery Team +regular = 1 +admin = 0 -- cgit v1.2.3