From 07a1a1b7f207101ad27084ad37082f96afad8ac6 Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Wed, 19 Apr 2017 22:47:00 -0400 Subject: Add object function rmBgImg() --- app/class/object.class.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'app/class') 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); + } } ?> -- cgit v1.2.3