summaryrefslogtreecommitdiffstats
path: root/app/class
diff options
context:
space:
mode:
authorMalf Furious <m@lfurio.us>2017-04-19 22:47:00 -0400
committerMalf Furious <m@lfurio.us>2017-04-19 22:47:00 -0400
commit07a1a1b7f207101ad27084ad37082f96afad8ac6 (patch)
tree5269f56873ace16332468dadb809d415b8193af2 /app/class
parent3c4d7755d0a88c148884e0cbb90b327a96d87973 (diff)
downloadscrott-07a1a1b7f207101ad27084ad37082f96afad8ac6.tar.gz
scrott-07a1a1b7f207101ad27084ad37082f96afad8ac6.zip
Add object function rmBgImg()
Diffstat (limited to 'app/class')
-rw-r--r--app/class/object.class.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/class/object.class.php b/app/class/object.class.php
index f8f5460..3bf64ec 100644
--- a/app/class/object.class.php
+++ b/app/class/object.class.php
@@ -213,6 +213,18 @@ class object extends table
$path = "dynmic/bgs/" . $this->guid;
return saveFile($image, $path, self::BG_MAXSIZE, self::IMAGE_MIME);
}
+
+ /*
+ * Remove the background image for this object. This deletes
+ * the image on disk.
+ */
+ public function rmBgImg() : bool
+ {
+ if (!is_file("dynmic/bgs/" . $this->guid))
+ return true;
+
+ return unlink("dynmic/bgs/" . $this->guid);
+ }
}
?>