X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=securemail%2Fsecuremail.php;h=6e6658682271776471d7a19a2123f719ff3e8886;hb=1357817fc38de7be7dc8ebffc1fa0961796fd32d;hp=fd074b72095fc82c02be0b9e21e5d8057bbbb29e;hpb=bbaf463a204f84d0ac05336925abf99ae3583b8e;p=friendica-addons.git diff --git a/securemail/securemail.php b/securemail/securemail.php index fd074b72..6e665868 100644 --- a/securemail/securemail.php +++ b/securemail/securemail.php @@ -7,9 +7,7 @@ */ use Friendica\App; -use Friendica\Core\Config; use Friendica\Core\Hook; -use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\Renderer; use Friendica\DI; @@ -59,11 +57,11 @@ function securemail_settings(App &$a, &$s) $t = Renderer::getMarkupTemplate('admin.tpl', 'addon/securemail/'); $s .= Renderer::replaceMacros($t, [ - '$title' => L10n::t('"Secure Mail" Settings'), - '$submit' => L10n::t('Save Settings'), - '$test' => L10n::t('Save and send test'), //NOTE: update also in 'post' - '$enable' => ['securemail-enable', L10n::t('Enable Secure Mail'), $enable, ''], - '$publickey' => ['securemail-pkey', L10n::t('Public key'), $publickey, L10n::t('Your public PGP key, ascii armored format'), 'rows="10"'] + '$title' => DI::l10n()->t('"Secure Mail" Settings'), + '$submit' => DI::l10n()->t('Save Settings'), + '$test' => DI::l10n()->t('Save and send test'), //NOTE: update also in 'post' + '$enable' => ['securemail-enable', DI::l10n()->t('Enable Secure Mail'), $enable, ''], + '$publickey' => ['securemail-pkey', DI::l10n()->t('Public key'), $publickey, DI::l10n()->t('Your public PGP key, ascii armored format'), 'rows="10"'] ]); } @@ -87,17 +85,17 @@ function securemail_settings_post(App &$a, array &$b) DI::pConfig()->set(local_user(), 'securemail', 'pkey', trim($_POST['securemail-pkey'])); $enable = (!empty($_POST['securemail-enable']) ? 1 : 0); DI::pConfig()->set(local_user(), 'securemail', 'enable', $enable); - info(L10n::t('Secure Mail Settings saved.') . EOL); + info(DI::l10n()->t('Secure Mail Settings saved.') . EOL); - if ($_POST['securemail-submit'] == L10n::t('Save and send test')) { - $sitename = Config::get('config', 'sitename'); + if ($_POST['securemail-submit'] == DI::l10n()->t('Save and send test')) { + $sitename = DI::config()->get('config', 'sitename'); $hostname = DI::baseUrl()->getHostname(); if (strpos($hostname, ':')) { $hostname = substr($hostname, 0, strpos($hostname, ':')); } - $sender_email = Config::get('config', 'sender_email'); + $sender_email = DI::config()->get('config', 'sender_email'); if (empty($sender_email)) { $sender_email = 'noreply@' . $hostname; } @@ -124,9 +122,9 @@ function securemail_settings_post(App &$a, array &$b) DI::pConfig()->set(local_user(), 'securemail', 'enable', $enable); if ($res) { - info(L10n::t('Test email sent') . EOL); + info(DI::l10n()->t('Test email sent') . EOL); } else { - notice(L10n::t('There was an error sending the test email') . EOL); + notice(DI::l10n()->t('There was an error sending the test email') . EOL); } } }