X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=remote_permissions%2Fremote_permissions.php;h=26817182819cc72101043002e7c17abd1e51cecd;hb=1357817fc38de7be7dc8ebffc1fa0961796fd32d;hp=506eb72209f8ab5e9e0203b660ddf92f5c7114fb;hpb=f2fc22227a0dfae8f5c85f24f1c5bfa6e5c4c245;p=friendica-addons.git diff --git a/remote_permissions/remote_permissions.php b/remote_permissions/remote_permissions.php index 506eb722..26817182 100644 --- a/remote_permissions/remote_permissions.php +++ b/remote_permissions/remote_permissions.php @@ -7,7 +7,6 @@ * Status: Unsupported */ -use Friendica\Core\Config; use Friendica\Core\Hook; use Friendica\Core\Renderer; use Friendica\Database\DBA; @@ -31,7 +30,7 @@ function remote_permissions_settings(&$a,&$o) { if(! local_user()) return; - $global = Config::get("remote_perms", "global"); + $global = DI::config()->get("remote_perms", "global"); if($global == 1) return; @@ -69,7 +68,7 @@ function remote_permissions_content($a, $item_copy) { if($item_copy['uid'] != local_user()) return; - if(Config::get('remote_perms','global') == 0) { + if(DI::config()->get('remote_perms','global') == 0) { // Admin has set Individual choice. We need to find // the original poster. First, get the contact's info $r = q("SELECT nick, url FROM contact WHERE id = %d LIMIT 1", @@ -202,13 +201,13 @@ function remote_permissions_addon_admin(&$a, &$o){ $t = Renderer::getMarkupTemplate( "admin.tpl", "addon/remote_permissions/" ); $o = Renderer::replaceMacros($t, [ '$submit' => DI::l10n()->t('Save Settings'), - '$global' => ['remotepermschoice', DI::l10n()->t('Global'), 1, DI::l10n()->t('The posts of every user on this server show the post recipients'), Config::get('remote_perms', 'global') == 1], - '$individual' => ['remotepermschoice', DI::l10n()->t('Individual'), 2, DI::l10n()->t('Each user chooses whether his/her posts show the post recipients'), Config::get('remote_perms', 'global') == 0] + '$global' => ['remotepermschoice', DI::l10n()->t('Global'), 1, DI::l10n()->t('The posts of every user on this server show the post recipients'), DI::config()->get('remote_perms', 'global') == 1], + '$individual' => ['remotepermschoice', DI::l10n()->t('Individual'), 2, DI::l10n()->t('Each user chooses whether his/her posts show the post recipients'), DI::config()->get('remote_perms', 'global') == 0] ]); } function remote_permissions_addon_admin_post(&$a){ $choice = (!empty($_POST['remotepermschoice']) ? Strings::escapeTags(trim($_POST['remotepermschoice'])) : ''); - Config::set('remote_perms','global',($choice == 1 ? 1 : 0)); + DI::config()->set('remote_perms','global',($choice == 1 ? 1 : 0)); info(DI::l10n()->t('Settings updated.'). EOL); }