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/gallery/libraries') 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