X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fmessageform.php;h=b034be3122b4400528a194949232d455a8650e74;hb=5c428f8adf5d4686988f371e3de204ac6e70b99a;hp=6431bfdcc8297c880c05f23fb3cf4a38d12109db;hpb=bbb830e14c718c687f0636710a1827c90b11f4cc;p=quix0rs-gnu-social.git diff --git a/lib/messageform.php b/lib/messageform.php index 6431bfdcc8..b034be3122 100644 --- a/lib/messageform.php +++ b/lib/messageform.php @@ -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,19 @@ 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(); + + $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'); + } } /**