* @link http://status.net/
*/
-if (!defined('STATUSNET')) {
+if (!defined('STATUSNET') && !defined('LACONICA')) {
exit(1);
}
/**
* 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';
}
/**
$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) {
$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'),
($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->element('span',
+ array('class' => 'count'),
+ $contentLimit);
+ }
}
/**
'class' => 'submit',
'name' => 'message_send',
'type' => 'submit',
- 'value' => _('Send')));
+ 'value' => _m('Send button for sending notice', 'Send')));
}
}