From 3a83c4e76fcfd3e9e62d95fe91222367527411e4 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 8 Feb 2009 10:18:09 +0000 Subject: Properly implement changing the thumbnail and resized image sizes by updating the graphics rules as appropriate. --- core/helpers/graphics.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'core/helpers') diff --git a/core/helpers/graphics.php b/core/helpers/graphics.php index f80d88f5..f708435b 100644 --- a/core/helpers/graphics.php +++ b/core/helpers/graphics.php @@ -48,7 +48,21 @@ class graphics_Core { $rule->args = serialize($args); $rule->save(); - self::mark_dirty(true, true); + self::mark_dirty($target == "thumb", $target == "resize"); + } + + /** + * Remove any matching graphics rules + * @param string $module_name the module that added the rule + * @param string $target the target for this operation ("thumb" or "resize") + * @param string $operation the name of the operation + */ + static function remove_rule($module_name, $target, $operation) { + ORM::factory("graphics_rule") + ->where("module_name", $module_name) + ->where("target", $target) + ->where("operation", $operation) + ->delete_all(); } /** -- cgit v1.2.3