diff options
author | shadlaws <shad@shadlaws.com> | 2013-02-06 11:04:24 +0100 |
---|---|---|
committer | shadlaws <shad@shadlaws.com> | 2013-02-06 11:04:24 +0100 |
commit | faa719551d68308be8a1c41d9cd6104604958593 (patch) | |
tree | c61f37cd0a16a42fd7bb1c0b53e1a043230f2f6b /modules/gallery | |
parent | 1796a290c18a2e38c7714ac903c78ac54c373e6b (diff) |
#1991 - Add options to graphics::mark_dirty to specify type and/or mime type.
- graphics::mark_dirty - added $type and $mime_type as options.
- graphics::mark_dirty - used options to set additional where conditions.
Diffstat (limited to 'modules/gallery')
-rw-r--r-- | modules/gallery/helpers/graphics.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/modules/gallery/helpers/graphics.php b/modules/gallery/helpers/graphics.php index 7c8e89d5..4df57fba 100644 --- a/modules/gallery/helpers/graphics.php +++ b/modules/gallery/helpers/graphics.php @@ -314,12 +314,19 @@ class graphics_Core { } /** - * Mark thumbnails and resizes as dirty. They will have to be rebuilt. + * Mark thumbnails and resizes as dirty. They will have to be rebuilt. Optionally, only those of + * a specified type and/or mime type can be marked (e.g. $type="movie" to rebuild movies only). */ - static function mark_dirty($thumbs, $resizes) { + static function mark_dirty($thumbs, $resizes, $type=null, $mime_type=null) { if ($thumbs || $resizes) { $db = db::build() ->update("items"); + if ($type) { + $db->where("type", "=", $type); + } + if ($mime_type) { + $db->where("mime_type", "=", $mime_type); + } if ($thumbs) { $db->set("thumb_dirty", 1); } |