diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/class/object.class.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/app/class/object.class.php b/app/class/object.class.php index 8d889e7..f8f5460 100644 --- a/app/class/object.class.php +++ b/app/class/object.class.php @@ -25,6 +25,7 @@ class object extends table * Constants used for uploading images */ public const HEAD_MAXSIZE = 1048576; // 1Mb + public const BG_MAXSIZE = 1048576; // 1Mb public const IMAGE_MIME = array( "image/jpeg", "image/jpg", @@ -201,6 +202,17 @@ class object extends table return unlink("dynmic/heads/" . $this->guid); } + + /* + * Set the background image for this object, overwriting any + * existing image. $image should be an uploaded file to PHP, + * still unhandled. + */ + public function setBgImg(array $image) : bool + { + $path = "dynmic/bgs/" . $this->guid; + return saveFile($image, $path, self::BG_MAXSIZE, self::IMAGE_MIME); + } } ?> |