]> git.mxchange.org Git - friendica-addons.git/blobdiff - remote_permissions/remote_permissions.php
Update obsolete App::getBaseUrl calls to DI::baseUrl
[friendica-addons.git] / remote_permissions / remote_permissions.php
index ad6d7b251ee81173c01eb656c91f87bba28419c5..a985bf37a142d8b9d26fcc06490ba36ebb8a1608 100644 (file)
@@ -7,14 +7,13 @@
  * Status: Unsupported
  */
 
-use Friendica\BaseObject;
 use Friendica\Core\Config;
 use Friendica\Core\Hook;
 use Friendica\Core\L10n;
 use Friendica\Core\PConfig;
 use Friendica\Core\Renderer;
 use Friendica\Database\DBA;
-use Friendica\Util\ACLFormatter;
+use Friendica\DI;
 use Friendica\Util\Strings;
 
 function remote_permissions_install() {
@@ -40,7 +39,7 @@ function remote_permissions_settings(&$a,&$o) {
 
        /* Add our stylesheet to the page so we can make our settings look nice */
 
-       $a->page['htmlhead'] .= '<link rel="stylesheet"  type="text/css" href="' . $a->getBaseURL() . '/addon/remote_permissions/settings.css' . '" media="all" />' . "\r\n";
+       $a->page['htmlhead'] .= '<link rel="stylesheet"  type="text/css" href="' . DI::baseUrl()->get() . '/addon/remote_permissions/settings.css' . '" media="all" />' . "\r\n";
 
        /* Get the current state of our config variable */
 
@@ -82,7 +81,7 @@ function remote_permissions_content($a, $item_copy) {
                        return;
 
                // Find out if the contact lives here
-               $baseurl = $a->getBaseURL();
+               $baseurl = DI::baseUrl()->get();
                $baseurl = substr($baseurl, strpos($baseurl, '://') + 3);
                if(strpos($r[0]['url'], $baseurl) === false)
                        return;
@@ -125,8 +124,7 @@ function remote_permissions_content($a, $item_copy) {
 
                        $item = $r[0];
 
-                       /** @var ACLFormatter $aclFormatter */
-                       $aclFormatter = BaseObject::getClass(ACLFormatter::class);
+                       $aclFormatter = DI::aclFormatter();
 
                        $allowed_users = $aclFormatter->expand($item['allow_cid']);
                        $allowed_groups = $aclFormatter->expand($item['allow_gid']);