From c2a1ea64eda2bf3e22ecaf4df4714c091bc5d7c4 Mon Sep 17 00:00:00 2001 From: colings Date: Sun, 2 Jan 2011 09:48:23 -0600 Subject: Tweak to include parent_id in resize call, for custom albums. --- modules/gallery/helpers/graphics.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/gallery/helpers/graphics.php b/modules/gallery/helpers/graphics.php index edba6b76..bfea2f2c 100644 --- a/modules/gallery/helpers/graphics.php +++ b/modules/gallery/helpers/graphics.php @@ -169,7 +169,9 @@ class graphics_Core { } foreach (self::_get_rules($target) as $rule) { - $args = array($working_file, $output_file, unserialize($rule->args)); + $options = unserialize($rule->args); + $options["parent_id"] = $item->parent_id; + $args = array($working_file, $output_file, $options); call_user_func_array($rule->operation, $args); $working_file = $output_file; } -- cgit v1.2.3 From 68edb2454dcd2044a82d8e8f8a1b96330e6d3b8c Mon Sep 17 00:00:00 2001 From: colings Date: Mon, 21 Feb 2011 15:40:58 -0600 Subject: Added 'item' to parameters passed to graphics rules --- modules/gallery/helpers/gallery_graphics.php | 6 +++--- modules/gallery/helpers/graphics.php | 4 +--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/modules/gallery/helpers/gallery_graphics.php b/modules/gallery/helpers/gallery_graphics.php index e63b9336..17de4930 100644 --- a/modules/gallery/helpers/gallery_graphics.php +++ b/modules/gallery/helpers/gallery_graphics.php @@ -46,10 +46,10 @@ class gallery_graphics_Core { * @param string $output_file * @param array $options */ - static function resize($input_file, $output_file, $options) { + static function resize($input_file, $output_file, $options, $item) { graphics::init_toolkit(); - module::event("graphics_resize", $input_file, $output_file, $options); + module::event("graphics_resize", $input_file, $output_file, $options, $item); if (@filesize($input_file) == 0) { throw new Exception("@todo EMPTY_INPUT_FILE"); @@ -69,7 +69,7 @@ class gallery_graphics_Core { $image->save($output_file); } - module::event("graphics_resize_completed", $input_file, $output_file, $options); + module::event("graphics_resize_completed", $input_file, $output_file, $options, $item); } /** diff --git a/modules/gallery/helpers/graphics.php b/modules/gallery/helpers/graphics.php index 834211bf..04501132 100644 --- a/modules/gallery/helpers/graphics.php +++ b/modules/gallery/helpers/graphics.php @@ -169,9 +169,7 @@ class graphics_Core { } foreach (self::_get_rules($target) as $rule) { - $options = unserialize($rule->args); - $options["parent_id"] = $item->parent_id; - $args = array($working_file, $output_file, $options); + $args = array($working_file, $output_file, unserialize($rule->args), $item); call_user_func_array($rule->operation, $args); $working_file = $output_file; } -- cgit v1.2.3 From ca47b887f5bb8ad311c4ab7e4c71aace37ba88e9 Mon Sep 17 00:00:00 2001 From: colings Date: Wed, 23 Feb 2011 20:31:07 -0600 Subject: Added extra arg to gallery_graphics calls and updated users --- modules/g2_import/helpers/g2_import.php | 2 +- modules/gallery/controllers/quick.php | 2 +- modules/gallery/helpers/gallery_graphics.php | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php index 5fd92972..22fb68c6 100644 --- a/modules/g2_import/helpers/g2_import.php +++ b/modules/g2_import/helpers/g2_import.php @@ -610,7 +610,7 @@ class g2_import_Core { if ($g2_preferred && $g2_preferred instanceof GalleryDerivative) { if (preg_match("/rotate\|(-?\d+)/", $g2_preferred->getDerivativeOperations(), $matches)) { $tmpfile = tempnam(TMPPATH, "rotate"); - gallery_graphics::rotate($item->file_path(), $tmpfile, array("degrees" => $matches[1])); + gallery_graphics::rotate($item->file_path(), $tmpfile, array("degrees" => $matches[1]), $item); $item->set_data_file($tmpfile); $item->save(); unlink($tmpfile); diff --git a/modules/gallery/controllers/quick.php b/modules/gallery/controllers/quick.php index 17abc39f..da4768fd 100644 --- a/modules/gallery/controllers/quick.php +++ b/modules/gallery/controllers/quick.php @@ -38,7 +38,7 @@ class Quick_Controller extends Controller { if ($degrees) { $tmpfile = tempnam(TMPPATH, "rotate") . "." . pathinfo($item->file_path(), PATHINFO_EXTENSION); - gallery_graphics::rotate($item->file_path(), $tmpfile, array("degrees" => $degrees)); + gallery_graphics::rotate($item->file_path(), $tmpfile, array("degrees" => $degrees), $item); $item->set_data_file($tmpfile); $item->save(); unlink($tmpfile); diff --git a/modules/gallery/helpers/gallery_graphics.php b/modules/gallery/helpers/gallery_graphics.php index 17de4930..1f47a65c 100644 --- a/modules/gallery/helpers/gallery_graphics.php +++ b/modules/gallery/helpers/gallery_graphics.php @@ -25,17 +25,17 @@ class gallery_graphics_Core { * @param string $output_file * @param array $options */ - static function rotate($input_file, $output_file, $options) { + static function rotate($input_file, $output_file, $options, $item) { graphics::init_toolkit(); - module::event("graphics_rotate", $input_file, $output_file, $options); + module::event("graphics_rotate", $input_file, $output_file, $options, $item); Image::factory($input_file) ->quality(module::get_var("gallery", "image_quality")) ->rotate($options["degrees"]) ->save($output_file); - module::event("graphics_rotate_completed", $input_file, $output_file, $options); + module::event("graphics_rotate_completed", $input_file, $output_file, $options, $item); } /** @@ -87,11 +87,11 @@ class gallery_graphics_Core { * @param string $output_file * @param array $options */ - static function composite($input_file, $output_file, $options) { + static function composite($input_file, $output_file, $options, $item) { try { graphics::init_toolkit(); - module::event("graphics_composite", $input_file, $output_file, $options); + module::event("graphics_composite", $input_file, $output_file, $options, $item); list ($width, $height) = getimagesize($input_file); list ($w_width, $w_height) = getimagesize($options["file"]); @@ -121,7 +121,7 @@ class gallery_graphics_Core { ->quality(module::get_var("gallery", "image_quality")) ->save($output_file); - module::event("graphics_composite_completed", $input_file, $output_file, $options); + module::event("graphics_composite_completed", $input_file, $output_file, $options, $item); } catch (ErrorException $e) { Kohana_Log::add("error", $e->get_message()); } -- cgit v1.2.3 From c38d4695a01c939840357d7f59aa836169571048 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 5 Mar 2011 15:46:04 -0800 Subject: Add missing phpDoc for the extra Item_Model argument to graphics calls and make the param optional. #1646. --- modules/gallery/helpers/gallery_graphics.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/gallery/helpers/gallery_graphics.php b/modules/gallery/helpers/gallery_graphics.php index 1f47a65c..716bad18 100644 --- a/modules/gallery/helpers/gallery_graphics.php +++ b/modules/gallery/helpers/gallery_graphics.php @@ -24,8 +24,9 @@ class gallery_graphics_Core { * @param string $input_file * @param string $output_file * @param array $options + * @param Item_Model $item (optional) */ - static function rotate($input_file, $output_file, $options, $item) { + static function rotate($input_file, $output_file, $options, $item=null) { graphics::init_toolkit(); module::event("graphics_rotate", $input_file, $output_file, $options, $item); @@ -45,8 +46,9 @@ class gallery_graphics_Core { * @param string $input_file * @param string $output_file * @param array $options + * @param Item_Model $item (optional) */ - static function resize($input_file, $output_file, $options, $item) { + static function resize($input_file, $output_file, $options, $item=null) { graphics::init_toolkit(); module::event("graphics_resize", $input_file, $output_file, $options, $item); @@ -86,8 +88,9 @@ class gallery_graphics_Core { * @param string $input_file * @param string $output_file * @param array $options + * @param Item_Model $item (optional) */ - static function composite($input_file, $output_file, $options, $item) { + static function composite($input_file, $output_file, $options, $item=null) { try { graphics::init_toolkit(); -- cgit v1.2.3 From 7e569a21e35ad2461709c5487d37d5a2824cca3d Mon Sep 17 00:00:00 2001 From: Automatic Build Number Updater Date: Sat, 5 Mar 2011 16:46:57 -0700 Subject: Automated update of .build_number to 67 for branch master Last update: 3e80fe9228bcbfa01bf87da67a47cd3f284dff01 (2 commits ago) --- .build_number | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.build_number b/.build_number index 64f75ee2..726555f3 100644 --- a/.build_number +++ b/.build_number @@ -3,4 +3,4 @@ ; process. You don't need to edit it. In fact.. ; ; DO NOT EDIT THIS FILE BY HAND! -build_number=66 +build_number=67 -- cgit v1.2.3 From bda14f29eac2c7471d4e5e554493dd21728199e2 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 5 Mar 2011 15:59:52 -0800 Subject: Put external CSS before external JS, per: http://code.google.com/speed/page-speed/docs/rtt.html#PutStylesBeforeScripts ref: http://gallery.menalto.com/node/100693 Thanks Serge! Fixes #1633. --- themes/admin_wind/views/admin.html.php | 6 +++--- themes/wind/views/page.html.php | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/themes/admin_wind/views/admin.html.php b/themes/admin_wind/views/admin.html.php index 9e011c69..a56b6f41 100644 --- a/themes/admin_wind/views/admin.html.php +++ b/themes/admin_wind/views/admin.html.php @@ -41,11 +41,11 @@ media="screen,print,projection" /> - - get_combined("script") ?> - get_combined("css") ?> + + + get_combined("script") ?> body_attributes() ?>> diff --git a/themes/wind/views/page.html.php b/themes/wind/views/page.html.php index 0e5bdf6b..2b86556d 100644 --- a/themes/wind/views/page.html.php +++ b/themes/wind/views/page.html.php @@ -71,11 +71,11 @@ media="screen,print,projection" /> - - get_combined("script") ?> - get_combined("css") ?> + + + get_combined("script") ?> body_attributes() ?>> -- cgit v1.2.3 From 1437ce7542a344cd7fe08facb5972126d0eff957 Mon Sep 17 00:00:00 2001 From: Automatic Build Number Updater Date: Sat, 5 Mar 2011 17:14:58 -0700 Subject: Automated update of .build_number to 68 for branch master Last update: 7e569a21e35ad2461709c5487d37d5a2824cca3d (1 commits ago) --- .build_number | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.build_number b/.build_number index 726555f3..87174813 100644 --- a/.build_number +++ b/.build_number @@ -3,4 +3,4 @@ ; process. You don't need to edit it. In fact.. ; ; DO NOT EDIT THIS FILE BY HAND! -build_number=67 +build_number=68 -- cgit v1.2.3 From 451ef39d58c64b5387b835b5a8c11b98a5c9659b Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 5 Mar 2011 16:51:20 -0800 Subject: PATH_INFO mangles apostrophe (and other symbols, I'm sure) into a question mark, so any tags containing an apostrophe won't display their contents. Take the simple fix here and change the tag urls to also contain the tag id, which avoids having to add a slug for the tag and all kinds of validation code. Fixes #1636. --- modules/tag/controllers/tag.php | 4 ++-- modules/tag/models/tag.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/tag/controllers/tag.php b/modules/tag/controllers/tag.php index 7aa038c6..8f885dea 100644 --- a/modules/tag/controllers/tag.php +++ b/modules/tag/controllers/tag.php @@ -19,8 +19,8 @@ */ class Tag_Controller extends Controller { public function __call($function, $args) { - $tag_name = $function; - $tag = ORM::factory("tag")->where("name", "=", $tag_name)->find(); + $tag_id = $function; + $tag = ORM::factory("tag")->where("id", "=", $tag_id)->find(); $page_size = module::get_var("gallery", "page_size", 9); $page = (int) Input::instance()->get("page", "1"); $children_count = $tag->items_count(); diff --git a/modules/tag/models/tag.php b/modules/tag/models/tag.php index 53ccc856..479a7da0 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->name}"); + $url = url::site("tag/{$this->id}/{$this->name}"); if ($query) { $url .= "?$query"; } -- cgit v1.2.3 From 99a817dd9583ec736177a1ce6245e0f793fd4d47 Mon Sep 17 00:00:00 2001 From: Automatic Build Number Updater Date: Sat, 5 Mar 2011 17:54:34 -0700 Subject: Automated update of .build_number to 69 for branch master Last update: 7e569a21e35ad2461709c5487d37d5a2824cca3d (3 commits ago) --- .build_number | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.build_number b/.build_number index 87174813..18b6cf1d 100644 --- a/.build_number +++ b/.build_number @@ -3,4 +3,4 @@ ; process. You don't need to edit it. In fact.. ; ; DO NOT EDIT THIS FILE BY HAND! -build_number=68 +build_number=69 -- cgit v1.2.3 From 907377835bb34ca395dc5c6ab5a53f0fd2f6392b Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 5 Mar 2011 17:05:29 -0800 Subject: When we're not auto-fitting the image, pin it to the top of the page. This way small images on pages with a ton of comments don't get pushed way down. Fixes #1626. --- lib/gallery.show_full_size.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/gallery.show_full_size.js b/lib/gallery.show_full_size.js index 531d2a3a..0baee882 100644 --- a/lib/gallery.show_full_size.js +++ b/lib/gallery.show_full_size.js @@ -20,7 +20,7 @@ image_size = $.gallery_auto_fit_window(image_width, image_height); } else { image_size = { - top: Math.round((height - image_height) / 2), + top: 12, left: Math.round((width - image_width) / 2), width: Math.round(image_width), height: Math.round(image_height) -- cgit v1.2.3 From 1e3bf7e6eb51ac550bdc5388f1664f9b4f4dd393 Mon Sep 17 00:00:00 2001 From: Automatic Build Number Updater Date: Sat, 5 Mar 2011 18:06:17 -0700 Subject: Automated update of .build_number to 70 for branch master Last update: 7e569a21e35ad2461709c5487d37d5a2824cca3d (5 commits ago) --- .build_number | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.build_number b/.build_number index 18b6cf1d..4df67be2 100644 --- a/.build_number +++ b/.build_number @@ -3,4 +3,4 @@ ; process. You don't need to edit it. In fact.. ; ; DO NOT EDIT THIS FILE BY HAND! -build_number=69 +build_number=70 -- cgit v1.2.3 From 3fd7debd2f5d3e05ffd23d0e1f90119ff50c001b Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 15 Mar 2011 00:53:35 -0700 Subject: Fix a bug where the placeholder %hide-url didn't match the variable in the assoc. array. Follow on for #1624 --- modules/gallery/controllers/admin_upgrade_checker.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/gallery/controllers/admin_upgrade_checker.php b/modules/gallery/controllers/admin_upgrade_checker.php index a5cfcfc8..29d52a31 100644 --- a/modules/gallery/controllers/admin_upgrade_checker.php +++ b/modules/gallery/controllers/admin_upgrade_checker.php @@ -25,7 +25,7 @@ class Admin_Upgrade_Checker_Controller extends Admin_Controller { if ($message) { $message .= t( " (remind me later)", - array("url" => url::site("admin/upgrade_checker/remind_me_later?csrf=__CSRF__"))); + array("hide-url" => url::site("admin/upgrade_checker/remind_me_later?csrf=__CSRF__"))); site_status::info($message, "upgrade_checker"); } else { site_status::clear("upgrade_checker"); -- cgit v1.2.3 From e4d4a89a1bd54164fb62d95ac62a44957d124e68 Mon Sep 17 00:00:00 2001 From: Automatic Build Number Updater Date: Tue, 15 Mar 2011 00:54:08 -0700 Subject: Automated update of .build_number to 71 for branch master Last update: 1e3bf7e6eb51ac550bdc5388f1664f9b4f4dd393 (1 commits ago) --- .build_number | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.build_number b/.build_number index 4df67be2..4521d1ec 100644 --- a/.build_number +++ b/.build_number @@ -3,4 +3,4 @@ ; process. You don't need to edit it. In fact.. ; ; DO NOT EDIT THIS FILE BY HAND! -build_number=70 +build_number=71 -- cgit v1.2.3