X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fmessage.php;h=f12f54015f589717c45b100aea20f8111a688317;hb=215c6ecc14b799dc5359fd933275d9307ccd35ed;hp=093ef07317c82593db4a221c5aac8208fd62c851;hpb=3f3422975266835fc125d1d61aae85ccc10d96d9;p=friendica.git diff --git a/mod/message.php b/mod/message.php index 093ef07317..f12f54015f 100644 --- a/mod/message.php +++ b/mod/message.php @@ -1,6 +1,22 @@ . + * */ use Friendica\App; @@ -8,15 +24,14 @@ use Friendica\Content\Nav; use Friendica\Content\Pager; use Friendica\Content\Text\BBCode; use Friendica\Core\ACL; -use Friendica\Core\L10n; use Friendica\Core\Renderer; use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\Contact; use Friendica\Model\Mail; +use Friendica\Model\Notify\Type; use Friendica\Module\Security\Login; use Friendica\Util\DateTimeFormat; -use Friendica\Util\Proxy as ProxyUtils; use Friendica\Util\Strings; use Friendica\Util\Temporal; @@ -29,7 +44,7 @@ function message_init(App $a) } $new = [ - 'label' => L10n::t('New Message'), + 'label' => DI::l10n()->t('New Message'), 'url' => 'message/new', 'sel' => $a->argc > 1 && $a->argv[1] == 'new', 'accesskey' => 'm', @@ -52,34 +67,32 @@ function message_init(App $a) function message_post(App $a) { if (!local_user()) { - notice(L10n::t('Permission denied.') . EOL); + notice(DI::l10n()->t('Permission denied.')); return; } $replyto = !empty($_REQUEST['replyto']) ? Strings::escapeTags(trim($_REQUEST['replyto'])) : ''; $subject = !empty($_REQUEST['subject']) ? Strings::escapeTags(trim($_REQUEST['subject'])) : ''; $body = !empty($_REQUEST['body']) ? Strings::escapeHtml(trim($_REQUEST['body'])) : ''; - $recipient = !empty($_REQUEST['messageto']) ? intval($_REQUEST['messageto']) : 0; + $recipient = !empty($_REQUEST['recipient']) ? intval($_REQUEST['recipient']) : 0; $ret = Mail::send($recipient, $body, $subject, $replyto); $norecip = false; switch ($ret) { case -1: - notice(L10n::t('No recipient selected.') . EOL); + notice(DI::l10n()->t('No recipient selected.')); $norecip = true; break; case -2: - notice(L10n::t('Unable to locate contact information.') . EOL); + notice(DI::l10n()->t('Unable to locate contact information.')); break; case -3: - notice(L10n::t('Message could not be sent.') . EOL); + notice(DI::l10n()->t('Message could not be sent.')); break; case -4: - notice(L10n::t('Message collection failure.') . EOL); + notice(DI::l10n()->t('Message collection failure.')); break; - default: - info(L10n::t('Message sent.') . EOL); } // fake it to go back to the input form if no recipient listed @@ -97,7 +110,7 @@ function message_content(App $a) Nav::setSelected('messages'); if (!local_user()) { - notice(L10n::t('Permission denied.') . EOL); + notice(DI::l10n()->t('Permission denied.')); return Login::form(); } @@ -106,20 +119,20 @@ function message_content(App $a) $tpl = Renderer::getMarkupTemplate('mail_head.tpl'); if ($a->argc > 1 && $a->argv[1] == 'new') { $button = [ - 'label' => L10n::t('Discard'), + 'label' => DI::l10n()->t('Discard'), 'url' => '/message', 'sel' => 'close', ]; } else { $button = [ - 'label' => L10n::t('New Message'), + 'label' => DI::l10n()->t('New Message'), 'url' => '/message/new', 'sel' => 'new', 'accesskey' => 'm', ]; } $header = Renderer::replaceMacros($tpl, [ - '$messages' => L10n::t('Messages'), + '$messages' => DI::l10n()->t('Messages'), '$button' => $button, ]); @@ -128,51 +141,20 @@ function message_content(App $a) return; } - // Check if we should do HTML-based delete confirmation - if (!empty($_REQUEST['confirm'])) { - //