]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/messageform.php
Merge branch '0.9.x' into 1.0.x
[quix0rs-gnu-social.git] / lib / messageform.php
index ea93b8cf6cbf3e8d3e54be4b294a245fb6f11d38..b116964da9d95e9200466f45f4674eeb6579787f 100644 (file)
@@ -28,7 +28,7 @@
  * @link      http://status.net/
  */
 
-if (!defined('LACONICA')) {
+if (!defined('STATUSNET') && !defined('LACONICA')) {
     exit(1);
 }
 
@@ -80,10 +80,21 @@ class MessageForm extends Form
     /**
      * ID of the form
      *
-     * @return int ID of the form
+     * @return string ID of the form
      */
 
     function id()
+    {
+        return 'form_notice-direct';
+    }
+
+   /**
+     * Class of the form
+     *
+     * @return string class of the form
+     */
+
+    function formClass()
     {
         return 'form_notice';
     }
@@ -140,12 +151,16 @@ class MessageForm extends Form
                                               'rows' => 4,
                                               'name' => 'content'),
                             ($this->content) ? $this->content : '');
-        $this->out->elementStart('dl', 'form_note');
-        $this->out->element('dt', null, _('Available characters'));
-        $this->out->element('dd', array('id' => 'notice_text-count'),
-                            '140');
-        $this->out->elementEnd('dl');
 
+        $contentLimit = Message::maxContent();
+
+        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');
+        }
     }
 
     /**
@@ -160,6 +175,6 @@ class MessageForm extends Form
                                            'class' => 'submit',
                                            'name' => 'message_send',
                                            'type' => 'submit',
-                                           'value' => _('Send')));
+                                           'value' => _m('Send button for sending notice', 'Send')));
     }
 }