summaryrefslogtreecommitdiff
path: root/core/helpers/graphics.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-02-08 06:40:57 +0000
committerBharat Mediratta <bharat@menalto.com>2009-02-08 06:40:57 +0000
commit442d9295c62903d2595abefb485bb9f869f3ce8e (patch)
treef661175ce2a9ca560a183e9849cad8f4d82c51d2 /core/helpers/graphics.php
parent41ed142f5dfd0687734f14c79273fd0c84f1e330 (diff)
Change mark_all_dirty to mark_dirty and specify what we want to mark dirty. This will be useful for Admin_Theme_Details
Diffstat (limited to 'core/helpers/graphics.php')
-rw-r--r--core/helpers/graphics.php15
1 files changed, 10 insertions, 5 deletions
diff --git a/core/helpers/graphics.php b/core/helpers/graphics.php
index 37143f74..f80d88f5 100644
--- a/core/helpers/graphics.php
+++ b/core/helpers/graphics.php
@@ -48,7 +48,7 @@ class graphics_Core {
$rule->args = serialize($args);
$rule->save();
- self::mark_all_dirty();
+ self::mark_dirty(true, true);
}
/**
@@ -59,7 +59,7 @@ class graphics_Core {
$db = Database::instance();
$result = $db->query("DELETE FROM `graphics_rules` WHERE `module_name` = '$module_name'");
if ($result->count()) {
- self::mark_all_dirty();
+ self::mark_dirty(true, true);
}
}
@@ -208,11 +208,16 @@ class graphics_Core {
}
/**
- * Mark all thumbnails and resizes as dirty. They will have to be rebuilt.
+ * Mark thumbnails and resizes as dirty. They will have to be rebuilt.
*/
- static function mark_all_dirty() {
+ static function mark_dirty($thumbs, $resizes) {
$db = Database::instance();
- $db->query("UPDATE `items` SET `thumb_dirty` = 1, `resize_dirty` = 1");
+ if ($thumbs) {
+ $db->query("UPDATE `items` SET `thumb_dirty` = 1");
+ }
+ if ($resizes) {
+ $db->query("UPDATE `items` SET `resize_dirty` = 1");
+ }
$count = self::find_dirty_images_query()->count();
if ($count) {