]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/noticeform.php
Reorganize, make bare auth work, output If-Modified-Since header
[quix0rs-gnu-social.git] / lib / noticeform.php
index 7b6d7d21fdb541053ca3edfb9f18d0d7840e4c5c..cee46709e1f045d485e65ebe46124ea18d41e15b 100644 (file)
@@ -28,7 +28,7 @@
  * @link      http://status.net/
  */
 
-if (!defined('STATUSNET')) {
+if (!defined('STATUSNET') && !defined('LACONICA')) {
     exit(1);
 }
 
@@ -83,7 +83,7 @@ class NoticeForm extends Form
 
         $this->action  = $action;
         $this->content = $content;
-        
+
         if ($user) {
             $this->user = $user;
         } else {
@@ -117,7 +117,6 @@ class NoticeForm extends Form
         return common_local_url('newnotice');
     }
 
-
     /**
      * Legend of the Form
      *
@@ -128,7 +127,6 @@ class NoticeForm extends Form
         $this->out->element('legend', null, _('Send a notice'));
     }
 
-
     /**
      * Data elements
      *
@@ -145,11 +143,20 @@ class NoticeForm extends Form
                                               'rows' => 4,
                                               'name' => 'status_textarea'),
                             ($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 = 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',