aboutsummaryrefslogtreecommitdiff
path: root/classes/LightboxPluginImage.php
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2014-03-15 15:04:14 -0300
committerSilvio Rhatto <rhatto@riseup.net>2014-03-15 15:04:14 -0300
commit66dd3f3f5f14bb0ba6d2c7ef83b5b612d5ee2e30 (patch)
tree6002cbd9db40b15b4e67a67d5669644f86e4dbde /classes/LightboxPluginImage.php
downloadelgg-66dd3f3f5f14bb0ba6d2c7ef83b5b612d5ee2e30.tar.gz
elgg-66dd3f3f5f14bb0ba6d2c7ef83b5b612d5ee2e30.tar.bz2
Squashed 'mod/lightbox/' content from commit a83b8d8
git-subtree-dir: mod/lightbox git-subtree-split: a83b8d89691c31b4568f47790fb40d0bc962aca5
Diffstat (limited to 'classes/LightboxPluginImage.php')
-rw-r--r--classes/LightboxPluginImage.php31
1 files changed, 31 insertions, 0 deletions
diff --git a/classes/LightboxPluginImage.php b/classes/LightboxPluginImage.php
new file mode 100644
index 000000000..6d2b6bbea
--- /dev/null
+++ b/classes/LightboxPluginImage.php
@@ -0,0 +1,31 @@
+<?php
+
+/**
+ * Override the ElggFile
+ */
+class LightboxPluginImage extends ElggFile {
+ protected function initializeAttributes() {
+ parent::initializeAttributes();
+
+ $this->attributes['subtype'] = "image";
+ }
+
+ public function __construct($guid = null) {
+ parent::__construct($guid);
+ }
+
+ public function delete() {
+
+ $thumbnails = array($this->thumbnail, $this->smallthumb, $this->largethumb);
+ foreach ($thumbnails as $thumbnail) {
+ if ($thumbnail) {
+ $delfile = new ElggFile();
+ $delfile->owner_guid = $this->owner_guid;
+ $delfile->setFilename($thumbnail);
+ $delfile->delete();
+ }
+ }
+
+ return parent::delete();
+ }
+}