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(-) (limited to 'modules') 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