diff options
Diffstat (limited to 'plugins/SocialPhoto/NewSocialPhotoAction.php')
-rw-r--r-- | plugins/SocialPhoto/NewSocialPhotoAction.php | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/plugins/SocialPhoto/NewSocialPhotoAction.php b/plugins/SocialPhoto/NewSocialPhotoAction.php new file mode 100644 index 000000000..a7402ab87 --- /dev/null +++ b/plugins/SocialPhoto/NewSocialPhotoAction.php @@ -0,0 +1,50 @@ +<?php + +if (!defined('STATUSNET')) { + exit(1); +} + +require_once INSTALLDIR . '/plugins/SocialPhoto/NewSocialObjectAction.php'; + +class NewSocialPhotoAction extends NewSocialObjectAction +{ + private $slug='photo'; + private $dbclass='SocialPhoto'; + + function validate() + { + return true; + } + + function getSummary() + { + $title = $this->trimmed('photo-title'); + $max_len = Notice::maxContent() - 30; + if(strlen($title) > $max_len) { + return substr($title, 0, $max_len-1) . '…'; #ellipsis ;) + } + return $title; + } + + function getMentions() + { + $this->trimmed('mentions'); + } + + function getTags() + { + $this->trimmed('tags'); + } + + function getGroups() + { + $this->trimmed('groups'); + } + + function showSocialObjectForm() + { + require_once dirname(__FILE__) . '/SocialPhotoForm.php'; + $form = new SocialPhotoForm($this); + $form->show(); + } +} |