diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-02-08 10:18:09 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-02-08 10:18:09 +0000 |
commit | 3a83c4e76fcfd3e9e62d95fe91222367527411e4 (patch) | |
tree | c0fe1e8a6c14c984eb8f79b4ead09b141fd22420 /core/helpers/graphics.php | |
parent | 442d9295c62903d2595abefb485bb9f869f3ce8e (diff) |
Properly implement changing the thumbnail and resized image sizes by
updating the graphics rules as appropriate.
Diffstat (limited to 'core/helpers/graphics.php')
-rw-r--r-- | core/helpers/graphics.php | 16 |
1 files changed, 15 insertions, 1 deletions
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(); } /** |