]> git.mxchange.org Git - friendica.git/blobdiff - mod/settings.php
Replace deprecated $a->page with DI::page()
[friendica.git] / mod / settings.php
index b126defcbab6b0d9071daa3ecd6282fbcb85325f..9e47b3d2e14a80c58124c8e92b853c9b04086598 100644 (file)
@@ -56,7 +56,7 @@ function settings_init(App $a)
        // These lines provide the javascript needed by the acl selector
 
        $tpl = Renderer::getMarkupTemplate('settings/head.tpl');
-       $a->page['htmlhead'] .= Renderer::replaceMacros($tpl, [
+       DI::page()['htmlhead'] .= Renderer::replaceMacros($tpl, [
                '$ispublic' => L10n::t('everybody')
        ]);
 
@@ -143,7 +143,7 @@ function settings_init(App $a)
 
 
        $tabtpl = Renderer::getMarkupTemplate("generic_links_widget.tpl");
-       $a->page['aside'] = Renderer::replaceMacros($tabtpl, [
+       DI::page()['aside'] = Renderer::replaceMacros($tabtpl, [
                '$title' => L10n::t('Settings'),
                '$class' => 'settings-widget',
                '$items' => $tabs,
@@ -173,7 +173,7 @@ function settings_post(App $a)
 
                $key = $_POST['remove'];
                DBA::delete('tokens', ['id' => $key, 'uid' => local_user()]);
-               $a->internalRedirect('settings/oauth/', true);
+               DI::baseUrl()->redirect('settings/oauth/', true);
                return;
        }
 
@@ -219,7 +219,7 @@ function settings_post(App $a)
                                );
                        }
                }
-               $a->internalRedirect('settings/oauth/', true);
+               DI::baseUrl()->redirect('settings/oauth/', true);
                return;
        }
 
@@ -383,7 +383,7 @@ function settings_post(App $a)
                }
 
                Hook::callAll('display_settings_post', $_POST);
-               $a->internalRedirect('settings/display');
+               DI::baseUrl()->redirect('settings/display');
                return; // NOTREACHED
        }
 
@@ -419,7 +419,7 @@ function settings_post(App $a)
        if (!empty($_POST['resend_relocate'])) {
                Worker::add(PRIORITY_HIGH, 'Notifier', Delivery::RELOCATION, local_user());
                info(L10n::t("Relocate message has been send to your contacts"));
-               $a->internalRedirect('settings');
+               DI::baseUrl()->redirect('settings');
        }
 
        Hook::callAll('settings_post', $_POST);
@@ -638,7 +638,7 @@ function settings_post(App $a)
        // Update the global contact for the user
        GContact::updateForUser(local_user());
 
-       $a->internalRedirect('settings');
+       DI::baseUrl()->redirect('settings');
        return; // NOTREACHED
 }
 
@@ -705,7 +705,7 @@ function settings_content(App $a)
                        BaseModule::checkFormSecurityTokenRedirectOnError('/settings/oauth', 'settings_oauth', 't');
 
                        DBA::delete('clients', ['client_id' => $a->argv[3], 'uid' => local_user()]);
-                       $a->internalRedirect('settings/oauth/', true);
+                       DI::baseUrl()->redirect('settings/oauth/', true);
                        return;
                }
 
@@ -721,7 +721,7 @@ function settings_content(App $a)
                $tpl = Renderer::getMarkupTemplate('settings/oauth.tpl');
                $o .= Renderer::replaceMacros($tpl, [
                        '$form_security_token' => BaseModule::getFormSecurityToken("settings_oauth"),
-                       '$baseurl'      => $a->getBaseURL(true),
+                       '$baseurl'      => DI::baseUrl()->get(true),
                        '$title'        => L10n::t('Connected Apps'),
                        '$add'          => L10n::t('Add application'),
                        '$edit'         => L10n::t('Edit'),
@@ -787,7 +787,7 @@ function settings_content(App $a)
 
                if (!empty($legacy_contact)) {
                        /// @todo Isn't it supposed to be a $a->internalRedirect() call?
-                       $a->page['htmlhead'] = '<meta http-equiv="refresh" content="0; URL=' . System::baseUrl().'/ostatus_subscribe?url=' . urlencode($legacy_contact) . '">';
+                       DI::page()['htmlhead'] = '<meta http-equiv="refresh" content="0; URL=' . System::baseUrl().'/ostatus_subscribe?url=' . urlencode($legacy_contact) . '">';
                }
 
                $settings_connectors = '';
@@ -1127,8 +1127,8 @@ function settings_content(App $a)
        $tpl_addr = Renderer::getMarkupTemplate('settings/nick_set.tpl');
 
        $prof_addr = Renderer::replaceMacros($tpl_addr,[
-               '$desc' => L10n::t("Your Identity Address is <strong>'%s'</strong> or '%s'.", $nickname . '@' . $a->getHostName() . $a->getURLPath(), System::baseUrl() . '/profile/' . $nickname),
-               '$basepath' => $a->getHostName()
+               '$desc' => L10n::t("Your Identity Address is <strong>'%s'</strong> or '%s'.", $nickname . '@' . DI::baseUrl()->getHostname() . DI::baseUrl()->getUrlPath(), System::baseUrl() . '/profile/' . $nickname),
+               '$basepath' => DI::baseUrl()->getHostname()
        ]);
 
        $stpl = Renderer::getMarkupTemplate('settings/settings.tpl');
@@ -1152,7 +1152,7 @@ function settings_content(App $a)
                $private_post = 0;
        }
 
-       $query_str = $a->query_string;
+       $query_str = DI::args()->getQueryString();
        if (strpos($query_str, 'public=1') !== false) {
                $query_str = str_replace(['?public=1', '&public=1'], ['', ''], $query_str);
        }
@@ -1203,7 +1203,7 @@ function settings_content(App $a)
                '$permissions' => L10n::t('Default Post Permissions'),
                '$permdesc' => L10n::t("\x28click to open/close\x29"),
                '$visibility' => $profile['net-publish'],
-               '$aclselect' => ACL::getFullSelectorHTML($a->page, $a->user),
+               '$aclselect' => ACL::getFullSelectorHTML(DI::page(), $a->user),
                '$suggestme' => $suggestme,
                '$blockwall'=> $blockwall, // array('blockwall', L10n::t('Allow friends to post to your profile page:'), !$blockwall, ''),
                '$blocktags'=> $blocktags, // array('blocktags', L10n::t('Allow friends to tag your posts:'), !$blocktags, ''),