use Friendica\App;
use Friendica\Content\Nav;
use Friendica\Content\Smilies;
+use Friendica\Content\Text\BBCode;
+use Friendica\Core\ACL;
use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
use Friendica\Model\Mail;
+use Friendica\Util\DateTimeFormat;
use Friendica\Util\Temporal;
-require_once 'include/acl_selectors.php';
require_once 'include/conversation.php';
function message_init(App $a)
'$linkurl' => L10n::t('Please enter a link URL:')
]);
- $preselect = isset($a->argv[2]) ? [$a->argv[2]] : false;
+ $preselect = isset($a->argv[2]) ? [$a->argv[2]] : [];
$prename = $preurl = $preid = '';
$preid = $r[0]['id'];
$preselect = [$preid];
} else {
- $preselect = false;
+ $preselect = [];
}
}
$prefill = $preselect ? $prename : '';
// the ugly select box
- $select = contact_select('messageto', 'message-to-select', $preselect, 4, true, false, false, 10);
+ $select = ACL::getMessageContactSelectHTML('messageto', 'message-to-select', $preselect, 4, 10);
$tpl = get_markup_template('prv_message.tpl');
$o .= replace_macros($tpl, [
'$to' => L10n::t('To:'),
'$showinputs' => 'true',
'$prefill' => $prefill,
- '$autocomp' => $autocomp,
'$preid' => $preid,
'$subject' => L10n::t('Subject:'),
'$subjtxt' => x($_REQUEST, 'subject') ? strip_tags($_REQUEST['subject']) : '',
intval(local_user())
);
- require_once("include/bbcode.php");
-
$tpl = get_markup_template('msg-header.tpl');
$a->page['htmlhead'] .= replace_macros($tpl, [
'$baseurl' => System::baseUrl(true),
$from_name_e = $message['from-name'];
$subject_e = $message['title'];
- $body_e = Smilies::replace(bbcode($message['body']));
+ $body_e = Smilies::replace(BBCode::convert($message['body']));
$to_name_e = $message['name'];
$contact = Contact::getDetailsByURL($message['from-url']);
'body' => $body_e,
'delete' => L10n::t('Delete message'),
'to_name' => $to_name_e,
- 'date' => Temporal::local($message['created'], 'D, d M Y - g:i A'),
- 'ago' => relative_date($message['created']),
+ 'date' => DateTimeFormat::local($message['created'], L10n::t('D, d M Y - g:i A')),
+ 'ago' => Temporal::getRelativeDate($message['created']),
];
$seen = $message['seen'];
'$delete' => L10n::t('Delete conversation'),
'$body' => $body_e,
'$to_name' => $to_name_e,
- '$date' => Temporal::local($rr['mailcreated'], L10n::t('D, d M Y - g:i A')),
- '$ago' => relative_date($rr['mailcreated']),
+ '$date' => DateTimeFormat::local($rr['mailcreated'], L10n::t('D, d M Y - g:i A')),
+ '$ago' => Temporal::getRelativeDate($rr['mailcreated']),
'$seen' => $rr['mailseen'],
'$count' => L10n::tt('%d message', '%d messages', $rr['count']),
]);