diff options
Diffstat (limited to 'lib/noticeform.php')
-rw-r--r-- | lib/noticeform.php | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/lib/noticeform.php b/lib/noticeform.php index 350e37db8..62320dd60 100644 --- a/lib/noticeform.php +++ b/lib/noticeform.php @@ -90,7 +90,6 @@ class NoticeForm extends Form $this->action = $action; $this->content = $content; $this->inreplyto = $inreplyto; - if ($user) { $this->user = $user; } else { @@ -124,7 +123,6 @@ class NoticeForm extends Form return common_local_url('newnotice'); } - /** * Legend of the Form * @@ -135,7 +133,6 @@ class NoticeForm extends Form $this->out->element('legend', null, _('Send a notice')); } - /** * Data elements * @@ -152,11 +149,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', |