]> git.mxchange.org Git - friendica.git/commitdiff
Normalize base URL usage in admin templates
authorHypolite Petovan <hypolite@mrpetovan.com>
Sat, 12 Mar 2022 03:40:27 +0000 (22:40 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Sat, 12 Mar 2022 04:14:21 +0000 (23:14 -0500)
mod/ping.php
src/Module/Admin/Logs/View.php
src/Module/Admin/Site.php
src/Module/Admin/Themes/Details.php
src/Module/Admin/Themes/Embed.php
src/Module/Admin/Themes/Index.php
src/Module/Register.php
view/templates/admin/logs/view.tpl
view/templates/admin/summary.tpl
view/theme/frio/templates/admin/logs/view.tpl
view/theme/frio/templates/admin/summary.tpl

index 81aa9ec6202615c617d9ae6972291e6e0abba7bd..1afab5f726794adc2bffc1a23133492ce631c179 100644 (file)
@@ -283,7 +283,7 @@ function ping_init(App $a)
                                foreach ($regs as $reg) {
                                        $notif = [
                                                'id'      => 0,
-                                               'href'    => DI::baseUrl() . '/admin/users/pending',
+                                               'href'    => DI::baseUrl()->get(true) . '/admin/users/pending',
                                                'name'    => $reg['name'],
                                                'url'     => $reg['url'],
                                                'photo'   => $reg['micro'],
@@ -296,7 +296,7 @@ function ping_init(App $a)
                        } else {
                                $notif = [
                                        'id'      => 0,
-                                       'href'    => DI::baseUrl() . '/admin/users/pending',
+                                       'href'    => DI::baseUrl()->get(true) . '/admin/users/pending',
                                        'name'    => $regs[0]['name'],
                                        'url'     => $regs[0]['url'],
                                        'photo'   => $regs[0]['micro'],
index 1104212f6b0ff944a3f91903399b5585232de1e4..d56e02061594aaffc951709b8734d8afd3dde1a6 100644 (file)
@@ -21,9 +21,9 @@
 
 namespace Friendica\Module\Admin\Logs;
 
-use Friendica\DI;
 use Friendica\Core\Renderer;
 use Friendica\Core\Theme;
+use Friendica\DI;
 use Friendica\Module\BaseAdmin;
 use Psr\Log\LogLevel;
 
@@ -80,9 +80,10 @@ class View extends BaseAdmin
                        }
                }
                return Renderer::replaceMacros($t, [
-                       '$title' => DI::l10n()->t('Administration'),
-                       '$page'  => DI::l10n()->t('View Logs'),
-                       '$l10n'  => [
+                       '$baseurl'       => DI::baseUrl()->get(true),
+                       '$title'         => DI::l10n()->t('Administration'),
+                       '$page'          => DI::l10n()->t('View Logs'),
+                       '$l10n'          => [
                                'Search'                => DI::l10n()->t('Search'),
                                'Search_in_logs'        => DI::l10n()->t('Search in logs'),
                                'Show_all'              => DI::l10n()->t('Show all'),
index 0f440f253a2f5a93f3b5ab90139904161d3ccc1b..4c5c38ea542d4998cf3af4016297c46fbb6a03d6 100644 (file)
@@ -526,7 +526,7 @@ class Site extends BaseAdmin
                        '$touch_icon'       => ['touch_icon', DI::l10n()->t('Touch icon'), DI::config()->get('system', 'touch_icon'), DI::l10n()->t('Link to an icon that will be used for tablets and mobiles.')],
                        '$additional_info'  => ['additional_info', DI::l10n()->t('Additional Info'), $additional_info, DI::l10n()->t('For public servers: you can add additional information here that will be listed at %s/servers.', Search::getGlobalDirectory())],
                        '$language'         => ['language', DI::l10n()->t('System language'), DI::config()->get('system', 'language'), '', $lang_choices],
-                       '$theme'            => ['theme', DI::l10n()->t('System theme'), DI::config()->get('system', 'theme'), DI::l10n()->t('Default system theme - may be over-ridden by user profiles - <a href="/admin/themes" id="cnftheme">Change default theme settings</a>'), $theme_choices],
+                       '$theme'            => ['theme', DI::l10n()->t('System theme'), DI::config()->get('system', 'theme'), DI::l10n()->t('Default system theme - may be over-ridden by user profiles - <a href="%s" id="cnftheme">Change default theme settings</a>', DI::baseUrl()->get(true) . '/admin/themes'), $theme_choices],
                        '$theme_mobile'     => ['theme_mobile', DI::l10n()->t('Mobile system theme'), DI::config()->get('system', 'mobile-theme', '---'), DI::l10n()->t('Theme for mobile devices'), $theme_choices_mobile],
                        '$ssl_policy'       => ['ssl_policy', DI::l10n()->t('SSL link policy'), DI::config()->get('system', 'ssl_policy'), DI::l10n()->t('Determines whether generated links should be forced to use SSL'), $ssl_choices],
                        '$force_ssl'        => ['force_ssl', DI::l10n()->t('Force SSL'), DI::config()->get('system', 'force_ssl'), DI::l10n()->t('Force all Non-SSL requests to SSL - Attention: on some systems it could lead to endless loops.')],
index 25724dc728432b2767173c98657800cdc8245cab..dc6bf58184496c60bc5e0f27cb8c283ec36f0e31 100644 (file)
@@ -76,7 +76,7 @@ class Details extends BaseAdmin
                        require_once "view/theme/$theme/config.php";
 
                        if (function_exists('theme_admin')) {
-                               $admin_form = '<iframe onload="resizeIframe(this);" src="/admin/themes/' . $theme . '/embed?mode=minimal" width="100%" height="600px" frameborder="no"></iframe>';
+                               $admin_form = '<iframe onload="resizeIframe(this);" src="' . DI::baseUrl()->get(true) . '/admin/themes/' . $theme . '/embed?mode=minimal" width="100%" height="600px" frameborder="no"></iframe>';
                        }
                }
 
index 132a35b67b3b051683775726df0ecb725932f5cf..439e78e64258bda8863f3c0bef276d88f368acb4 100644 (file)
@@ -24,6 +24,7 @@ namespace Friendica\Module\Admin\Themes;
 use Friendica\App;
 use Friendica\Core\L10n;
 use Friendica\Core\Renderer;
+use Friendica\DI;
 use Friendica\Module\BaseAdmin;
 use Friendica\Module\Response;
 use Friendica\Util\Profiler;
@@ -94,7 +95,7 @@ class Embed extends BaseAdmin
 
                $t = Renderer::getMarkupTemplate('admin/addons/embed.tpl');
                return Renderer::replaceMacros($t, [
-                       '$action' => '/admin/themes/' . $theme . '/embed?mode=minimal',
+                       '$action' => DI::baseUrl()->get(true) . '/admin/themes/' . $theme . '/embed?mode=minimal',
                        '$form' => $admin_form,
                        '$form_security_token' => self::getFormSecurityToken("admin_theme_settings"),
                ]);
index 9677ce30f2ca2b01d49c5a8ed87852ce71b2c0b7..cf0ddcfc6ea7a604067dbafdac81ed1f75517f4e 100644 (file)
@@ -37,7 +37,7 @@ class Index extends BaseAdmin
 
                // reload active themes
                if (!empty($_GET['action'])) {
-                       self::checkFormSecurityTokenRedirectOnError(DI::baseUrl()->get() . '/admin/themes', 'admin_themes', 't');
+                       self::checkFormSecurityTokenRedirectOnError('/admin/themes', 'admin_themes', 't');
 
                        switch ($_GET['action']) {
                                case 'reload':
index d415abf74cab69243fba1c7cb0f5c6b4b8ec06b6..9c09baef82d937f76dc993a027dd35ef1cfe4062 100644 (file)
@@ -380,11 +380,11 @@ class Register extends BaseModule
                                        'type'         => Model\Notification\Type::SYSTEM,
                                        'event'        => 'SYSTEM_REGISTER_REQUEST',
                                        'uid'          => $admin['uid'],
-                                       'link'         => $base_url . '/admin/users/',
+                                       'link'         => DI::baseUrl()->get(true) . '/admin/users/',
                                        'source_name'  => $user['username'],
                                        'source_mail'  => $user['email'],
                                        'source_nick'  => $user['nickname'],
-                                       'source_link'  => $base_url . '/admin/users/',
+                                       'source_link'  => DI::baseUrl()->get(true) . '/admin/users/',
                                        'source_photo' => User::getAvatarUrl($user, Proxy::SIZE_THUMB),
                                        'show_in_notification_page' => false
                                ]);
index 97b5c0625fbf5473712224721d88c3e55cef1de7..50e166f1bad95439ec8ccda997a400b820d072d6 100644 (file)
@@ -11,7 +11,7 @@
                        <p>
                                <input type="search" name="q" value="{{$q}}" placeholder="{{$l10n.Search}}"></input>
                                <input type="submit" value="{{$l10n.Search}}">
-                               <a href="/admin/logs/view">{{$l10n.Show_all}}</a>
+                               <a href="{{$baseurl}}/admin/logs/view">{{$l10n.Show_all}}</a>
                        </p>
 
 
index 121eb833b9ae1284add8cd50d0cfc6eed9caf1d3..2421658d6c035d289f30251f3b3accfa6f1f820a 100644 (file)
@@ -34,7 +34,7 @@
                <dt>{{$addons.0}}</dt>
                
                {{foreach $addons.1 as $p}}
-                       <dd><a href="/admin/addons/{{$p}}/">{{$p}}</a></dd>
+                       <dd><a href="{{$baseurl}}/admin/addons/{{$p}}/">{{$p}}</a></dd>
                {{/foreach}}
                
        </dl>
index cab8882683fea6e174c8614396518c960dcb9eaa..d47c0361de7110b83dfb09a04aa475a338cb3cbc 100755 (executable)
@@ -18,7 +18,7 @@
                                </div>
                        </div>
                        <div class="xol-xs-4">
-                               <a href="/admin/logs/view" class="btn btn-default">{{$l10n.Show_all}}</a>
+                               <a href="{{$baseurl}}/admin/logs/view" class="btn btn-default">{{$l10n.Show_all}}</a>
                        </div>
                </form>
 
@@ -33,7 +33,7 @@
                                                <ul class="dropdown-menu" aria-labelledby="level">
                                                        {{foreach $filtersvalues.level as $v }}
                                                                <li {{if $filters.level == $v}}class="active"{{/if}}>
-                                                                       <a href="/admin/logs/view?level={{$v}}" data-filter="level" data-filter-value="{{$v}}">
+                                                                       <a href="{{$baseurl}}/admin/logs/view?level={{$v}}" data-filter="level" data-filter-value="{{$v}}">
                                                                                {{if $v == ""}}{{$l10n.ALL}}{{/if}}{{$v}}
                                                                        </a>
                                                                </li>
@@ -47,7 +47,7 @@
                                                <ul class="dropdown-menu" aria-labelledby="context">
                                                        {{foreach $filtersvalues.context as $v }}
                                                                <li {{if $filters.context == $v}}class="active"{{/if}}>
-                                                                       <a href="/admin/logs/view?context={{$v}}" data-filter="context" data-filter-value="{{$v}}">
+                                                                       <a href="{{$baseurl}}/admin/logs/view?context={{$v}}" data-filter="context" data-filter-value="{{$v}}">
                                                                                {{if $v == ""}}{{$l10n.ALL}}{{/if}}{{$v}}
                                                                        </a>
                                                                </li>
index 0fd599b051b0d5be389bde23a928b344c9a947e3..6f5645dca7282d9b7bcb8c5c1fbab3baaded5512 100644 (file)
@@ -46,7 +46,7 @@
                        <div class="col-lg-4 col-md-4 col-sm-4 col-xs-12 admin-summary-label-name text-muted">{{$addons.0}}</div>
                        <div class="col-lg-8 col-md-8 col-sm-8 col-xs-12 admin-summary-entry">
                                {{foreach $addons.1 as $p}}
-                               <a href="/admin/addons/{{$p}}/">{{$p}}</a><br>
+                               <a href="{{$baseurl}}/admin/addons/{{$p}}/">{{$p}}</a><br>
                                {{/foreach}}
                        </div>
                </div>