X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fmessageform.php;h=b116964da9d95e9200466f45f4674eeb6579787f;hb=9109fe3c631ebef14f2de061fc6fc565ee0f7174;hp=8ea2b36c27b21df3006297edeb2ded887d205d50;hpb=6b7fa65ca1558dd9763137d590dae82071de74d3;p=quix0rs-gnu-social.git diff --git a/lib/messageform.php b/lib/messageform.php index 8ea2b36c27..b116964da9 100644 --- a/lib/messageform.php +++ b/lib/messageform.php @@ -1,6 +1,6 @@ . * * @category Form - * @package Laconica - * @author Evan Prodromou - * @author Sarven Capadisli - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou + * @author Sarven Capadisli + * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -38,11 +38,11 @@ require_once INSTALLDIR.'/lib/form.php'; * Form for posting a direct message * * @category Form - * @package Laconica - * @author Evan Prodromou - * @author Sarven Capadisli + * @package StatusNet + * @author Evan Prodromou + * @author Sarven Capadisli * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ * * @see HTMLOutputter */ @@ -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,16 @@ 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(); + + 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'); + } } /** @@ -160,6 +175,6 @@ class MessageForm extends Form 'class' => 'submit', 'name' => 'message_send', 'type' => 'submit', - 'value' => _('Send'))); + 'value' => _m('Send button for sending notice', 'Send'))); } }