X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=discourse%2Fdiscourse.php;h=f684425a9967d208514fdf706f44b5db26753a19;hb=a0e071db702855e2ea5b3e252726a49234a2b6ef;hp=262ee554e0c968bb0b089acbef31f2cdb838e630;hpb=75a7d6f1c7ef03851a3e4baa1dcac3399b433605;p=friendica-addons.git diff --git a/discourse/discourse.php b/discourse/discourse.php index 262ee554..f684425a 100644 --- a/discourse/discourse.php +++ b/discourse/discourse.php @@ -9,14 +9,12 @@ */ use Friendica\App; use Friendica\Core\Hook; -use Friendica\Core\L10n; use Friendica\Core\Logger; -use Friendica\Core\PConfig; use Friendica\Core\Renderer; use Friendica\Core\Protocol; use Friendica\Database\DBA; +use Friendica\DI; use Friendica\Model\Contact; -use Friendica\Util\XML; use Friendica\Content\Text\Markdown; use Friendica\Util\Network; use Friendica\Util\Strings; @@ -44,13 +42,13 @@ function discourse_settings(App $a, &$s) return; } - $enabled = intval(PConfig::get(local_user(), 'discourse', 'enabled')); + $enabled = intval(DI::pConfig()->get(local_user(), 'discourse', 'enabled')); $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/discourse/'); $s .= Renderer::replaceMacros($t, [ - '$title' => L10n::t('Discourse'), - '$enabled' => ['enabled', L10n::t('Enable processing of Discourse mailing list mails'), $enabled, L10n::t('If enabled, incoming mails from Discourse will be improved so they look much better. To make it work, you have to configure the e-mail settings in Friendica. You also have to enable the mailing list mode in Discourse. Then you have to add the Discourse mail account as contact.')], - '$submit' => L10n::t('Save Settings'), + '$title' => DI::l10n()->t('Discourse'), + '$enabled' => ['enabled', DI::l10n()->t('Enable processing of Discourse mailing list mails'), $enabled, DI::l10n()->t('If enabled, incoming mails from Discourse will be improved so they look much better. To make it work, you have to configure the e-mail settings in Friendica. You also have to enable the mailing list mode in Discourse. Then you have to add the Discourse mail account as contact.')], + '$submit' => DI::l10n()->t('Save Settings'), ]); } @@ -60,7 +58,7 @@ function discourse_settings_post(App $a) return; } - PConfig::set(local_user(), 'discourse', 'enabled', intval($_POST['enabled'])); + DI::pConfig()->set(local_user(), 'discourse', 'enabled', intval($_POST['enabled'])); } function discourse_email_getmessage(App $a, &$message) @@ -69,7 +67,7 @@ function discourse_email_getmessage(App $a, &$message) return; } - if (!PConfig::get($message['item']['uid'], 'discourse', 'enabled')) { + if (!DI::pConfig()->get($message['item']['uid'], 'discourse', 'enabled')) { return; }