summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-08-21 07:23:27 -0400
committerEvan Prodromou <evan@controlyourself.ca>2009-08-21 07:23:27 -0400
commitde5382d4caaf0b388a4de0243cde9a783a43a541 (patch)
tree145069a7481816b3deb9c39aed0fd89a2124879a /lib
parent6dcded4129cebf2e492499cd258bf14a6e25eff9 (diff)
message input form correctly shows and check max length
Diffstat (limited to 'lib')
-rw-r--r--lib/messageform.php17
1 files changed, 12 insertions, 5 deletions
diff --git a/lib/messageform.php b/lib/messageform.php
index 8ea2b36c2..044fdc719 100644
--- a/lib/messageform.php
+++ b/lib/messageform.php
@@ -140,12 +140,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');
+ }
}
/**