X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fmessageform.php;h=044fdc719d31c43c79608162d7ac4102ba948f04;hb=de5382d4caaf0b388a4de0243cde9a783a43a541;hp=61d3d75af26face5c970bb7e0d78b73d3f847567;hpb=0824bb2e1df68fd6634ca915e4c87664ee2ef872;p=quix0rs-gnu-social.git diff --git a/lib/messageform.php b/lib/messageform.php index 61d3d75af2..044fdc719d 100644 --- a/lib/messageform.php +++ b/lib/messageform.php @@ -99,7 +99,6 @@ class MessageForm extends Form return common_local_url('newmessage'); } - /** * Legend of the Form * @@ -110,7 +109,6 @@ class MessageForm extends Form $this->out->element('legend', null, _('Send a direct notice')); } - /** * Data elements * @@ -134,20 +132,27 @@ class MessageForm extends Form $mutual_users->free(); unset($mutual_users); - $this->out->elementStart('ul', 'form_data'); - $this->out->elementStart('li', array('id' => 'notice_to')); $this->out->dropdown('to', _('To'), $mutual, null, false, - $this->to->id); - $this->out->elementEnd('li'); + ($this->to) ? $this->to->id : null); - $this->out->elementStart('li', array('id' => 'notice_text')); $this->out->element('textarea', array('id' => 'notice_data-text', 'cols' => 35, 'rows' => 4, 'name' => 'content'), ($this->content) ? $this->content : ''); - $this->out->elementEnd('li'); - $this->out->elementEnd('ul'); + + $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'); + } } /** @@ -158,14 +163,10 @@ class MessageForm extends Form function formActions() { - $this->out->elementStart('ul', 'form_actions'); - $this->out->elementStart('li', array('id' => 'notice_submit')); $this->out->element('input', array('id' => 'notice_action-submit', 'class' => 'submit', 'name' => 'message_send', 'type' => 'submit', 'value' => _('Send'))); - $this->out->elementEnd('li'); - $this->out->elementEnd('ul'); } }