X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fmessage.php;h=c62a15eb233d21addfc03e86655097158dd3c4ce;hb=4683cfee123904032cebc5b6d6719c8c712caa24;hp=e0d9f4404ff1e238ed8d2389ce1e1bcdd90a22e9;hpb=3a9db3f6373330902a5efe42eb8790c240fba580;p=friendica.git diff --git a/mod/message.php b/mod/message.php index e0d9f4404f..c62a15eb23 100644 --- a/mod/message.php +++ b/mod/message.php @@ -1,28 +1,41 @@ . + * */ use Friendica\App; use Friendica\Content\Nav; use Friendica\Content\Pager; -use Friendica\Content\Smilies; use Friendica\Content\Text\BBCode; use Friendica\Core\ACL; -use Friendica\Core\L10n; use Friendica\Core\Renderer; -use Friendica\Core\System; use Friendica\Database\DBA; +use Friendica\DI; use Friendica\Model\Contact; use Friendica\Model\Mail; -use Friendica\Module\Login; +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; -require_once 'include/conversation.php'; - function message_init(App $a) { $tabs = ''; @@ -32,22 +45,22 @@ 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', ]; $tpl = Renderer::getMarkupTemplate('message_side.tpl'); - $a->page['aside'] = Renderer::replaceMacros($tpl, [ + DI::page()['aside'] = Renderer::replaceMacros($tpl, [ '$tabs' => $tabs, '$new' => $new, ]); - $base = System::baseUrl(); + $base = DI::baseUrl(); $head_tpl = Renderer::getMarkupTemplate('message-head.tpl'); - $a->page['htmlhead'] .= Renderer::replaceMacros($head_tpl, [ - '$baseurl' => System::baseUrl(true), + DI::page()['htmlhead'] .= Renderer::replaceMacros($head_tpl, [ + '$baseurl' => DI::baseUrl()->get(true), '$base' => $base ]); } @@ -55,7 +68,7 @@ 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.') . EOL); return; } @@ -69,20 +82,20 @@ function message_post(App $a) switch ($ret) { case -1: - notice(L10n::t('No recipient selected.') . EOL); + notice(DI::l10n()->t('No recipient selected.') . EOL); $norecip = true; break; case -2: - notice(L10n::t('Unable to locate contact information.') . EOL); + notice(DI::l10n()->t('Unable to locate contact information.') . EOL); break; case -3: - notice(L10n::t('Message could not be sent.') . EOL); + notice(DI::l10n()->t('Message could not be sent.') . EOL); break; case -4: - notice(L10n::t('Message collection failure.') . EOL); + notice(DI::l10n()->t('Message collection failure.') . EOL); break; default: - info(L10n::t('Message sent.') . EOL); + info(DI::l10n()->t('Message sent.') . EOL); } // fake it to go back to the input form if no recipient listed @@ -90,7 +103,7 @@ function message_post(App $a) $a->argc = 2; $a->argv[1] = 'new'; } else { - $a->internalRedirect($a->cmd . '/' . $ret); + DI::baseUrl()->redirect(DI::args()->getCommand() . '/' . $ret); } } @@ -100,29 +113,29 @@ function message_content(App $a) Nav::setSelected('messages'); if (!local_user()) { - notice(L10n::t('Permission denied.') . EOL); + notice(DI::l10n()->t('Permission denied.') . EOL); return Login::form(); } - $myprofile = System::baseUrl() . '/profile/' . $a->user['nickname']; + $myprofile = DI::baseUrl() . '/profile/' . $a->user['nickname']; $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, ]); @@ -135,7 +148,7 @@ function message_content(App $a) if (!empty($_REQUEST['confirm'])) { //