X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fmessageform.php;h=733e83cd15ea09044b5273f955de1885c6cf0c09;hb=bc2f64d7ab6c0218104e1a655209fe062d5bdd43;hp=044fdc719d31c43c79608162d7ac4102ba948f04;hpb=9f356b55c6f419468771c0f3c2450010c0242abe;p=quix0rs-gnu-social.git diff --git a/lib/messageform.php b/lib/messageform.php index 044fdc719d..733e83cd15 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 'form_notice'; + return 'form_notice-direct'; + } + + /** + * Class of the form + * + * @return string class of the form + */ + + function formClass() + { + return 'form_notice ajax-notice'; } /** @@ -122,6 +133,8 @@ class MessageForm extends Form $mutual_users = $user->mutuallySubscribedUsers(); $mutual = array(); + // TRANS Label entry in drop-down selection box in direct-message inbox/outbox. This is the default entry in the drop-down box, doubling as instructions and a brake against accidental submissions with the first user in the list. + $mutual[0] = _('Select recipient:'); while ($mutual_users->fetch()) { if ($mutual_users->id != $user->id) { @@ -132,10 +145,15 @@ class MessageForm extends Form $mutual_users->free(); unset($mutual_users); + if (count($mutual) == 1) { + // TRANS Entry in drop-down selection box in direct-message inbox/outbox when no one is available to message. + $mutual[0] = _('No mutual subscribers.'); + } + $this->out->dropdown('to', _('To'), $mutual, null, false, ($this->to) ? $this->to->id : null); - $this->out->element('textarea', array('id' => 'notice_data-text', + $this->out->element('textarea', array('class' => 'notice_data-text', 'cols' => 35, 'rows' => 4, 'name' => 'content'), @@ -143,15 +161,10 @@ class MessageForm extends Form $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'), + $this->out->element('span', + array('class' => 'count'), $contentLimit); - $this->out->elementEnd('dl'); } } @@ -167,6 +180,6 @@ class MessageForm extends Form 'class' => 'submit', 'name' => 'message_send', 'type' => 'submit', - 'value' => _('Send'))); + 'value' => _m('Send button for sending notice', 'Send'))); } }