From 9fe20561068fec04c57f7769aaf9ca5025bdc6ac Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 21 Apr 2011 13:59:03 -0700 Subject: Use window.location = "url" instead of window.location.reload() so that we pop back up to the top of the page so that you see the status message. Fixes #1676. --- modules/gallery/views/admin_modules.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/gallery/views/admin_modules.html.php b/modules/gallery/views/admin_modules.html.php index f4ae965c..2cc81b0d 100644 --- a/modules/gallery/views/admin_modules.html.php +++ b/modules/gallery/views/admin_modules.html.php @@ -6,7 +6,7 @@ dataType: "json", success: function(data) { if (data.reload) { - window.location.reload(); + window.location = ""; } else { $("body").append('
' + data.dialog + '
'); $("#g-dialog").dialog({ -- cgit v1.2.3 From 1af4f99108ffe1ffc2a3ff723c68c5a12dde0223 Mon Sep 17 00:00:00 2001 From: Chris Kelly Date: Thu, 21 Apr 2011 15:57:18 -0400 Subject: Add missing CSS tag so tables get aligned. Fixes #1678. --- modules/gallery/views/admin_languages.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/gallery/views/admin_languages.html.php b/modules/gallery/views/admin_languages.html.php index 01d1ce3f..eef087e1 100644 --- a/modules/gallery/views/admin_languages.html.php +++ b/modules/gallery/views/admin_languages.html.php @@ -51,7 +51,7 @@ $display_name): ?> - +
-- cgit v1.2.3 From 5bc0da365221eea08b1525d4cf71371853aa4d15 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 21 Apr 2011 14:33:08 -0700 Subject: Create before_combine and after_combine events to allow modules and themes to interact with the combine list ahead of time, and to be able to do things like minification after it's combined. Fixes #1653. --- modules/gallery/libraries/Gallery_View.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'modules') diff --git a/modules/gallery/libraries/Gallery_View.php b/modules/gallery/libraries/Gallery_View.php index 562f7929..77e3d204 100644 --- a/modules/gallery/libraries/Gallery_View.php +++ b/modules/gallery/libraries/Gallery_View.php @@ -111,6 +111,8 @@ class Gallery_View_Core extends View { $contents = $cache->get($key); if (empty($contents)) { + module::event("before_combine", $type, $this->combine_queue[$type][$group]); + $contents = ""; foreach (array_keys($this->combine_queue[$type][$group]) as $path) { if ($type == "css") { @@ -120,6 +122,8 @@ class Gallery_View_Core extends View { } } + module::event("after_combine", $type, $contents); + $cache->set($key, $contents, array($type), 30 * 84600); $use_gzip = function_exists("gzencode") && @@ -128,6 +132,7 @@ class Gallery_View_Core extends View { $cache->set("{$key}_gz", gzencode($contents, 9, FORCE_GZIP), array($type, "gzip"), 30 * 84600); } + } unset($this->combine_queue[$type][$group]); @@ -158,6 +163,7 @@ class Gallery_View_Core extends View { $replace[] = "url('" . url::abs_file($relative) . "')"; } else { Kohana_Log::add("error", "Missing URL reference '{$match[1]}' in CSS file '$css_file'"); + } } $replace = str_replace(DIRECTORY_SEPARATOR, "/", $replace); -- cgit v1.2.3 From 8cf066b838a98ace3cfa81e02ccc7a8570d1ba7f Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 21 Apr 2011 15:43:48 -0700 Subject: Use Tag_Model::url() instead of hand creating tag urls, since the API changed and that broke. Fixe #1680. --- modules/tag/helpers/tag_event.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/tag/helpers/tag_event.php b/modules/tag/helpers/tag_event.php index df81ae65..b415b42d 100644 --- a/modules/tag/helpers/tag_event.php +++ b/modules/tag/helpers/tag_event.php @@ -149,7 +149,7 @@ class tag_event_Core { static function info_block_get_metadata($block, $item) { $tags = array(); foreach (tag::item_tags($item) as $tag) { - $tags[] = "name}") . "\">{$tag->name}"; + $tags[] = "url()}\">{$tag->name}"; } if ($tags) { $info = $block->content->metadata; -- cgit v1.2.3 From 08a6df2274ea196056eb7441d4aff050dc3531fa Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 21 Apr 2011 15:50:53 -0700 Subject: Normally Router::find_uri() strips off the url suffix for us, but when we make the theme::$is_admin determination we're working off of the PATH_INFO so we need to strip it off manually. Fixes #1631. --- modules/gallery/helpers/theme.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'modules') diff --git a/modules/gallery/helpers/theme.php b/modules/gallery/helpers/theme.php index f285834c..a42fa7ad 100644 --- a/modules/gallery/helpers/theme.php +++ b/modules/gallery/helpers/theme.php @@ -41,6 +41,13 @@ class theme_Core { $config = Kohana_Config::instance(); $modules = $config->get("core.modules"); + + // Normally Router::find_uri() strips off the url suffix for us, but we're working off of the + // PATH_INFO here so we need to strip it off manually + if ($suffix = Kohana::config("core.url_suffix")) { + $path = preg_replace("#" . preg_quote($suffix) . "$#u", "", $path); + } + self::$is_admin = $path == "/admin" || !strncmp($path, "/admin/", 7); self::$site_theme_name = module::get_var("gallery", "active_site_theme"); if (self::$is_admin) { -- cgit v1.2.3 From 99fd65ff02d17cbb3ec936b4bdbf2a8c6b0b73e3 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Fri, 22 Apr 2011 07:55:34 -0700 Subject: Catch the item_updated_data_file() event and rescan. Fixes #1679. --- modules/exif/helpers/exif_event.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'modules') diff --git a/modules/exif/helpers/exif_event.php b/modules/exif/helpers/exif_event.php index e594c765..72e88041 100644 --- a/modules/exif/helpers/exif_event.php +++ b/modules/exif/helpers/exif_event.php @@ -24,6 +24,12 @@ class exif_event_Core { } } + static function item_updated_data_file($item) { + if (!$item->is_album()) { + exif::extract($item); + } + } + static function item_deleted($item) { db::build() ->delete("exif_records") -- cgit v1.2.3 From 72149b8c68a488e4f935603e6bbf91d2536c2dee Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Fri, 22 Apr 2011 08:11:56 -0700 Subject: Urlencode the tag name so that our html is compliant. Fixes #1672. --- modules/tag/models/tag.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/tag/models/tag.php b/modules/tag/models/tag.php index 479a7da0..bd665667 100644 --- a/modules/tag/models/tag.php +++ b/modules/tag/models/tag.php @@ -132,7 +132,7 @@ class Tag_Model_Core extends ORM { * @param string $query the query string (eg "page=3") */ public function url($query=null) { - $url = url::site("tag/{$this->id}/{$this->name}"); + $url = url::site("tag/{$this->id}/" . urlencode($this->name)); if ($query) { $url .= "?$query"; } -- cgit v1.2.3 From 11703b24ffdf38443ac46afbfa65e6f07ec5648e Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Fri, 22 Apr 2011 09:28:19 -0700 Subject: Detect if the users theme is missing (or missing a theme.info) and in that case fall back to the wind theme. Fixes #1655. --- modules/gallery/helpers/theme.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'modules') diff --git a/modules/gallery/helpers/theme.php b/modules/gallery/helpers/theme.php index a42fa7ad..37707f28 100644 --- a/modules/gallery/helpers/theme.php +++ b/modules/gallery/helpers/theme.php @@ -50,9 +50,25 @@ class theme_Core { self::$is_admin = $path == "/admin" || !strncmp($path, "/admin/", 7); self::$site_theme_name = module::get_var("gallery", "active_site_theme"); + + // If the site theme doesn't exist, fall back to wind. + if (!file_exists(THEMEPATH . self::$site_theme_name . "/theme.info")) { + site_status::error(t("Theme '%name' is missing. Falling back to the Wind theme.", + array("name" => self::$site_theme_name)), "missing_site_theme"); + module::set_var("gallery", "active_site_theme", self::$site_theme_name = "wind"); + } + if (self::$is_admin) { // Load the admin theme self::$admin_theme_name = module::get_var("gallery", "active_admin_theme"); + + // If the admin theme doesn't exist, fall back to admin_wind. + if (!file_exists(THEMEPATH . self::$admin_theme_name . "/theme.info")) { + site_status::error(t("Admin theme '%name' is missing! Falling back to the Wind theme.", + array("name" => self::$admin_theme_name)), "missing_admin_theme"); + module::set_var("gallery", "active_admin_theme", self::$admin_theme_name = "admin_wind"); + } + array_unshift($modules, THEMEPATH . self::$admin_theme_name); // If the site theme has an admin subdir, load that as a module so that -- cgit v1.2.3 From deb7db6486988ce3e41b2fffd010487fbb67a91f Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Fri, 22 Apr 2011 09:29:25 -0700 Subject: Clear the site status for missing themes when we view this page -- if something goes wrong we'll just add it back again anyway. Follow-on for #1655. --- modules/gallery/controllers/admin_themes.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'modules') diff --git a/modules/gallery/controllers/admin_themes.php b/modules/gallery/controllers/admin_themes.php index cd8a5530..9cdc3db5 100644 --- a/modules/gallery/controllers/admin_themes.php +++ b/modules/gallery/controllers/admin_themes.php @@ -25,6 +25,9 @@ class Admin_Themes_Controller extends Admin_Controller { $view->content->admin = module::get_var("gallery", "active_admin_theme"); $view->content->site = module::get_var("gallery", "active_site_theme"); $view->content->themes = $this->_get_themes(); + + site_status::clear("missing_site_theme"); + site_status::clear("missing_admin_theme"); print $view; } -- cgit v1.2.3