]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Bookmarklet.php
Remove deprecated App::getHostName() - process methods to DI::baseUrl()->getHostName()
[friendica.git] / src / Module / Bookmarklet.php
index 1b6ff384597169eae700e21e3536bb17b9847d09..93f790a37d7be77642a9a6a187d552bd77960a27 100644 (file)
@@ -5,6 +5,8 @@ namespace Friendica\Module;
 use Friendica\BaseModule;
 use Friendica\Core\ACL;
 use Friendica\Core\L10n;
+use Friendica\DI;
+use Friendica\Module\Security\Login;
 use Friendica\Network\HTTPException;
 use Friendica\Util\Strings;
 
@@ -14,12 +16,12 @@ use Friendica\Util\Strings;
  */
 class Bookmarklet extends BaseModule
 {
-       public static function content()
+       public static function content(array $parameters = [])
        {
                $_GET['mode'] = 'minimal';
 
-               $app = self::getApp();
-               $config = $app->getConfig();
+               $app = DI::app();
+               $config = DI::config();
 
                if (!local_user()) {
                        $output = '<h2>' . L10n::t('Login') . '</h2>';
@@ -27,7 +29,7 @@ class Bookmarklet extends BaseModule
                        return $output;
                }
 
-               $referer = Strings::normaliseLink(defaults($_SERVER, 'HTTP_REFERER', ''));
+               $referer = Strings::normaliseLink($_SERVER['HTTP_REFERER'] ?? '');
                $page = Strings::normaliseLink($app->getBaseURL() . "/bookmarklet");
 
                if (!strstr($referer, $page)) {
@@ -42,13 +44,13 @@ class Bookmarklet extends BaseModule
                                'allow_location'   => $app->user['allow_location'],
                                'default_location' => $app->user['default-location'],
                                'nickname'         => $app->user['nickname'],
-                               'lockstate'        => ((is_array($app->user) && ((strlen($app->user['allow_cid'])) || (strlen($a->user['allow_gid'])) || (strlen($app->user['deny_cid'])) || (strlen($app->user['deny_gid'])))) ? 'lock' : 'unlock'),
+                               'lockstate'        => ((is_array($app->user) && ((strlen($app->user['allow_cid'])) || (strlen($app->user['allow_gid'])) || (strlen($app->user['deny_cid'])) || (strlen($app->user['deny_gid'])))) ? 'lock' : 'unlock'),
                                'default_perms'    => ACL::getDefaultUserPermissions($app->user),
-                               'acl'              => ACL::getFullSelectorHTML($app->user, true),
+                               'acl'              => ACL::getFullSelectorHTML($app->page, $app->user, true),
                                'bang'             => '',
                                'visitor'          => 'block',
                                'profile_uid'      => local_user(),
-                               'title'            => trim(defaults($_REQUEST, 'title', ''), '*'),
+                               'title'            => trim($_REQUEST['title'] ?? '', '*'),
                                'content'          => $content
                        ];
                        $output = status_editor($app, $x, 0, false);