X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fmessageform.php;h=b116964da9d95e9200466f45f4674eeb6579787f;hb=4e5a69ad6f201ea83820be63eb60fc0af3e077a7;hp=eca39cc064de98445961e7a7eb137d69f8707623;hpb=21d87778ae76fd73eded304d213bdeb47b5052ee;p=quix0rs-gnu-social.git diff --git a/lib/messageform.php b/lib/messageform.php index eca39cc064..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,12 +80,23 @@ class MessageForm extends Form /** * ID of the form * - * @return int ID of the form + * @return string ID of the form */ function id() { - return 'message_form'; + return 'form_notice-direct'; + } + + /** + * Class of the form + * + * @return string class of the form + */ + + function formClass() + { + return 'form_notice'; } /** @@ -99,6 +110,16 @@ class MessageForm extends Form return common_local_url('newmessage'); } + /** + * Legend of the Form + * + * @return void + */ + function formLegend() + { + $this->out->element('legend', null, _('Send a direct notice')); + } + /** * Data elements * @@ -123,17 +144,23 @@ class MessageForm extends Form unset($mutual_users); $this->out->dropdown('to', _('To'), $mutual, null, false, - $this->to->id); + ($this->to) ? $this->to->id : null); - $this->out->elementStart('p'); - - $this->out->element('textarea', array('id' => 'message_content', - 'cols' => 60, - 'rows' => 3, + $this->out->element('textarea', array('id' => 'notice_data-text', + 'cols' => 35, + 'rows' => 4, 'name' => 'content'), ($this->content) ? $this->content : ''); - $this->out->elementEnd('p'); + $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'); + } } /** @@ -144,9 +171,10 @@ class MessageForm extends Form function formActions() { - $this->out->element('input', array('id' => 'message_send', + $this->out->element('input', array('id' => 'notice_action-submit', + 'class' => 'submit', 'name' => 'message_send', 'type' => 'submit', - 'value' => _('Send'))); + 'value' => _m('Send button for sending notice', 'Send'))); } -} \ No newline at end of file +}