]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/noticeform.php
Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x
[quix0rs-gnu-social.git] / lib / noticeform.php
index ce8f9c6530759c343afdb6edbe5311aeb0199cd9..1be011c182fe83ff037500fb8b5cec13053be452 100644 (file)
@@ -90,7 +90,7 @@ class NoticeForm extends Form
         $this->action  = $action;
         $this->content = $content;
         $this->inreplyto = $inreplyto;
-        
+
         if ($user) {
             $this->user = $user;
         } else {
@@ -105,7 +105,7 @@ class NoticeForm extends Form
     /**
      * ID of the form
      *
-     * @return int ID of the form
+     * @return string ID of the form
      */
 
     function id()
@@ -113,6 +113,17 @@ class NoticeForm extends Form
         return 'form_notice';
     }
 
+   /**
+     * Class of the form
+     *
+     * @return string class of the form
+     */
+
+    function formClass()
+    {
+        return 'form_notice';
+    }
+
     /**
      * Action of the form
      *
@@ -142,40 +153,44 @@ class NoticeForm extends Form
 
     function formData()
     {
-        $this->out->element('label', array('for' => 'notice_data-text'),
-                            sprintf(_('What\'s up, %s?'), $this->user->nickname));
-        // XXX: vary by defined max size
-        $this->out->element('textarea', array('id' => 'notice_data-text',
-                                              'cols' => 35,
-                                              'rows' => 4,
-                                              'name' => 'status_textarea'),
-                            ($this->content) ? $this->content : '');
-
-        $contentLimit = Notice::maxContent();
-
-        $this->out->element('script', array('type' => 'text/javascript'),
-                            'maxLength = ' . $contentLimit . ';');
-
-        if ($contentLimit > 0) {
-            $this->out->elementStart('dl', 'form_note');
-            $this->out->element('dt', null, _('Available characters'));
-            $this->out->element('dd', array('id' => 'notice_text-count'),
-                                $contentLimit);
-            $this->out->elementEnd('dl');
-        }
-
-        if (common_config('attachments', 'uploads')) {
-            $this->out->element('label', array('for' => 'notice_data-attach'),_('Attach'));
-            $this->out->element('input', array('id' => 'notice_data-attach',
-                                               'type' => 'file',
-                                               'name' => 'attach',
-                                               'title' => _('Attach a file')));
-            $this->out->hidden('MAX_FILE_SIZE', common_config('attachments', 'file_quota'));
-        }
-        if ($this->action) {
-            $this->out->hidden('notice_return-to', $this->action, 'returnto');
+        if (Event::handle('StartShowNoticeFormData', array($this))) {
+            $this->out->element('label', array('for' => 'notice_data-text'),
+                                sprintf(_('What\'s up, %s?'), $this->user->nickname));
+            // XXX: vary by defined max size
+            $this->out->element('textarea', array('id' => 'notice_data-text',
+                                                  'cols' => 35,
+                                                  'rows' => 4,
+                                                  'name' => 'status_textarea'),
+                                ($this->content) ? $this->content : '');
+
+            $contentLimit = Notice::maxContent();
+
+            $this->out->element('script', array('type' => 'text/javascript'),
+                                'maxLength = ' . $contentLimit . ';');
+
+            if ($contentLimit > 0) {
+                $this->out->elementStart('dl', 'form_note');
+                $this->out->element('dt', null, _('Available characters'));
+                $this->out->element('dd', array('id' => 'notice_text-count'),
+                                    $contentLimit);
+                $this->out->elementEnd('dl');
+            }
+
+            if (common_config('attachments', 'uploads')) {
+                $this->out->element('label', array('for' => 'notice_data-attach'),_('Attach'));
+                $this->out->element('input', array('id' => 'notice_data-attach',
+                                                   'type' => 'file',
+                                                   'name' => 'attach',
+                                                   'title' => _('Attach a file')));
+                $this->out->hidden('MAX_FILE_SIZE', common_config('attachments', 'file_quota'));
+            }
+            if ($this->action) {
+                $this->out->hidden('notice_return-to', $this->action, 'returnto');
+            }
+            $this->out->hidden('notice_in-reply-to', $this->inreplyto, 'inreplyto');
+
+            Event::handle('StartShowNoticeFormData', array($this));
         }
-        $this->out->hidden('notice_in-reply-to', $this->inreplyto, 'inreplyto');
     }
 
     /**