X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=newmemberwidget%2Fnewmemberwidget.php;h=90f0c38da462b5e9a694288da048ec7ff42d0c4f;hb=b062142800482af361771001f532b61eb2f3b3ca;hp=11e8e12e305935277812b776f687f7de501f7440;hpb=d3717045f7024396a46dd2cb1a472b482f6d6d63;p=friendica-addons.git
diff --git a/newmemberwidget/newmemberwidget.php b/newmemberwidget/newmemberwidget.php
index 11e8e12e..90f0c38d 100644
--- a/newmemberwidget/newmemberwidget.php
+++ b/newmemberwidget/newmemberwidget.php
@@ -1,15 +1,13 @@
***/
use Friendica\Content\Text\BBCode;
-use Friendica\Core\Config;
use Friendica\Core\Hook;
-use Friendica\Core\L10n;
use Friendica\Core\Logger;
use Friendica\Core\Renderer;
use Friendica\DI;
@@ -21,11 +19,6 @@ function newmemberwidget_install()
Logger::log('newmemberwidget installed');
}
-function newmemberwidget_uninstall()
-{
- Hook::unregister( 'network_mod_init', 'addon/newmemberwidget/newmemberwidget.php', 'newmemberwidget_network_mod_init');
-}
-
function newmemberwidget_network_mod_init ($a, $b)
{
if (empty($_SESSION['new_member'])) {
@@ -33,18 +26,18 @@ function newmemberwidget_network_mod_init ($a, $b)
}
$t = '
'.EOL;
- $t .= '
'.L10n::t('New Member').'
'.EOL;
- $t .= '
' . L10n::t('Tips for New Members') . ''.EOL;
+ $t .= '
'.DI::l10n()->t('New Member').'
'.EOL;
+ $t .= '
' . DI::l10n()->t('Tips for New Members') . ''.EOL;
- if (Config::get('newmemberwidget','linkglobalsupport', false)) {
- $t .= '
'.L10n::t('Global Support Forum').''.EOL;
+ if (DI::config()->get('newmemberwidget','linkglobalsupport', false)) {
+ $t .= '
'.DI::l10n()->t('Global Support Forum').''.EOL;
}
- if (Config::get('newmemberwidget','linklocalsupport', false)) {
- $t .= '
'.L10n::t('Local Support Forum').''.EOL;
+ if (DI::config()->get('newmemberwidget','linklocalsupport', false)) {
+ $t .= '
'.DI::l10n()->t('Local Support Forum').''.EOL;
}
- $ft = Config::get('newmemberwidget','freetext', '');
+ $ft = DI::config()->get('newmemberwidget','freetext', '');
if (!empty($ft)) {
$t .= '
'.BBCode::convert(trim($ft)).'
';
}
@@ -59,20 +52,20 @@ function newmemberwidget_addon_admin_post(&$a)
$lsn = (!empty($_POST['localsupportname']) ? Strings::escapeTags(trim($_POST['localsupportname'])) : "");
$gs = intval($_POST['linkglobalsupport']);
$ls = intval($_POST['linklocalsupport']);
- Config::set('newmemberwidget', 'freetext', trim($ft));
- Config::set('newmemberwidget', 'linkglobalsupport', $gs);
- Config::set('newmemberwidget', 'linklocalsupport', $ls);
- Config::set('newmemberwidget', 'localsupport', trim($lsn));
+ DI::config()->set('newmemberwidget', 'freetext', trim($ft));
+ DI::config()->set('newmemberwidget', 'linkglobalsupport', $gs);
+ DI::config()->set('newmemberwidget', 'linklocalsupport', $ls);
+ DI::config()->set('newmemberwidget', 'localsupport', trim($lsn));
}
function newmemberwidget_addon_admin(&$a, &$o)
{
$t = Renderer::getMarkupTemplate('admin.tpl', 'addon/newmemberwidget');
$o = Renderer::replaceMacros($t, [
- '$submit' => L10n::t('Save Settings'),
- '$freetext' => [ "freetext", L10n::t("Message"), Config::get("newmemberwidget", "freetext"), L10n::t("Your message for new members. You can use bbcode here.")],
- '$linkglobalsupport' => [ "linkglobalsupport", L10n::t('Add a link to global support forum'), Config::get('newmemberwidget', 'linkglobalsupport'), L10n::t('Should a link to the global support forum be displayed?')." (
@helpers)"],
- '$linklocalsupport' => [ "linklocalsupport", L10n::t('Add a link to the local support forum'), Config::get('newmemberwidget', 'linklocalsupport'), L10n::t('If you have a local support forum and want to have a link displayed in the widget, check this box.')],
- '$localsupportname' => [ "localsupportname", L10n::t('Name of the local support group'), Config::get('newmemberwidget', 'localsupport'), L10n::t('If you checked the above, specify the
nickname of the local support group here (i.e. helpers)')],
+ '$submit' => DI::l10n()->t('Save Settings'),
+ '$freetext' => [ "freetext", DI::l10n()->t("Message"), DI::config()->get("newmemberwidget", "freetext"), DI::l10n()->t("Your message for new members. You can use bbcode here.")],
+ '$linkglobalsupport' => [ "linkglobalsupport", DI::l10n()->t('Add a link to global support forum'), DI::config()->get('newmemberwidget', 'linkglobalsupport'), DI::l10n()->t('Should a link to the global support forum be displayed?')." (
@helpers)"],
+ '$linklocalsupport' => [ "linklocalsupport", DI::l10n()->t('Add a link to the local support forum'), DI::config()->get('newmemberwidget', 'linklocalsupport'), DI::l10n()->t('If you have a local support forum and want to have a link displayed in the widget, check this box.')],
+ '$localsupportname' => [ "localsupportname", DI::l10n()->t('Name of the local support group'), DI::config()->get('newmemberwidget', 'localsupport'), DI::l10n()->t('If you checked the above, specify the
nickname of the local support group here (i.e. helpers)')],
]);
}