diff options
author | Malf Furious <m@lfurio.us> | 2017-04-19 22:45:18 -0400 |
---|---|---|
committer | Malf Furious <m@lfurio.us> | 2017-04-19 22:45:18 -0400 |
commit | 3c4d7755d0a88c148884e0cbb90b327a96d87973 (patch) | |
tree | 7af020842b0bc091f03a2c998be0cba17752c0b1 | |
parent | 77d16dcad807e80e439d636301ccf588195f53fc (diff) | |
download | scrott-3c4d7755d0a88c148884e0cbb90b327a96d87973.tar.gz scrott-3c4d7755d0a88c148884e0cbb90b327a96d87973.zip |
Add object function setBgImg()
Diffstat (limited to '')
-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); + } } ?> |