From dbeadc1407293d0c7af36723db6fe5699890b845 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 22 Jul 2009 14:27:57 -0700 Subject: Use the Kohana cascading filesystem to locate resources loaded by the theme. Because the theme comes first, this means that themes can override any module resources, at the cost that we no longer have namespacing for JS and CSS files. The only file getting used outside of this model is themes/default/screen.css which is used in the admin theme. I fixed that by copying screen.css into admin_default and renaming its screen.css to admin_screen.css. I also copied over all the images that it was referencing. Fixes tickets #48 and #539. Theme API changes: - theme_script(), theme_url() and theme_css() are no longer needed - script(), url() and css() now refer to the first matching asset in the module load path, where gallery3/lib is at the end of the path --- modules/user/helpers/user_theme.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/user/helpers/user_theme.php') diff --git a/modules/user/helpers/user_theme.php b/modules/user/helpers/user_theme.php index ad9d4c63..c5351f8e 100644 --- a/modules/user/helpers/user_theme.php +++ b/modules/user/helpers/user_theme.php @@ -26,7 +26,7 @@ class user_theme_Core { static function admin_head($theme) { if (strpos(Router::$current_uri, "admin/users") !== false) { - $theme->script("lib/gallery.panel.js"); + $theme->script("gallery.panel.js"); } } } -- cgit v1.2.3 From b826182b7a7b2d630b478d3e2bcf0628989a92d9 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 6 Aug 2009 22:22:24 +0800 Subject: Cleanup the javascript for enabling dialog or panel links. 1) We don't need to loop over the elements to bind the event handler. 2) Just include gallery.panel.js for all the admin pages. Signed-off-by: Tim Almdal --- modules/gallery/helpers/gallery_theme.php | 1 + modules/user/helpers/user_theme.php | 6 ------ themes/admin_default/js/ui.init.js | 12 +++--------- themes/default/js/ui.init.js | 5 +---- 4 files changed, 5 insertions(+), 19 deletions(-) (limited to 'modules/user/helpers/user_theme.php') diff --git a/modules/gallery/helpers/gallery_theme.php b/modules/gallery/helpers/gallery_theme.php index d3751b80..903827cc 100644 --- a/modules/gallery/helpers/gallery_theme.php +++ b/modules/gallery/helpers/gallery_theme.php @@ -78,6 +78,7 @@ class gallery_theme_Core { } static function admin_head($theme) { + $theme->script("gallery.panel.js"); $session = Session::instance(); if ($session->get("debug")) { $theme->css("debug.css"); diff --git a/modules/user/helpers/user_theme.php b/modules/user/helpers/user_theme.php index c5351f8e..69042aed 100644 --- a/modules/user/helpers/user_theme.php +++ b/modules/user/helpers/user_theme.php @@ -23,10 +23,4 @@ class user_theme_Core { $view->user = user::active(); return $view->render(); } - - static function admin_head($theme) { - if (strpos(Router::$current_uri, "admin/users") !== false) { - $theme->script("gallery.panel.js"); - } - } } diff --git a/themes/admin_default/js/ui.init.js b/themes/admin_default/js/ui.init.js index 3f062a27..06cc1cd5 100644 --- a/themes/admin_default/js/ui.init.js +++ b/themes/admin_default/js/ui.init.js @@ -1,5 +1,5 @@ $(document).ready(function(){ - + // Initialize Superfish menus $("#gSiteAdminMenu ul.gMenu").addClass("sf-menu"); $("ul.gMenu").addClass("sf-menu"); @@ -18,16 +18,10 @@ $(document).ready(function(){ $("#gMessage li").showMessage(); // Initialize modal dialogs - var dialogLinks = $(".gDialogLink"); - for (var i=0; i < dialogLinks.length; i++) { - $(dialogLinks[i]).bind("click", handleDialogEvent); - } + $(".gDialogLink").bind("click", handleDialogEvent); // Initialize panels - var panelLinks = $(".gPanelLink"); - for (i=0; i Date: Thu, 6 Aug 2009 13:32:41 +0800 Subject: Don't show the ajaxy login link in the top right corner if we're on the login page itself. Signed-off-by: Bharat Mediratta --- modules/user/helpers/user_theme.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'modules/user/helpers/user_theme.php') diff --git a/modules/user/helpers/user_theme.php b/modules/user/helpers/user_theme.php index 69042aed..8de2d248 100644 --- a/modules/user/helpers/user_theme.php +++ b/modules/user/helpers/user_theme.php @@ -19,8 +19,10 @@ */ class user_theme_Core { static function header_top($theme) { - $view = new View("login.html"); - $view->user = user::active(); - return $view->render(); + if ($theme->page_type != "login") { + $view = new View("login.html"); + $view->user = user::active(); + return $view->render(); + } } } -- cgit v1.2.3