Skip to content

Commit b8fe0a5

Browse files
committed
non-expand section System in the menu
1 parent a9a1199 commit b8fe0a5

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

htdocs/modules/system/themes/modern/modern.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -390,13 +390,16 @@ private function buildMenu(&$tpl)
390390
}
391391

392392
// Detect whether system panel should be opened
393-
$requestUri = \Xmf\Request::getString('REQUEST_URI', '', 'SERVER');
394-
$path = (string) parse_url($requestUri, PHP_URL_PATH); // strip query string
393+
$requestUri = \Xmf\Request::getString('REQUEST_URI', '', 'SERVER');
394+
$pathUri = (string) parse_url($requestUri, PHP_URL_PATH); // strip query string
395+
$httpReferer = \Xmf\Request::getString('HTTP_REFERER', '', 'SERVER');
396+
$pathReferer = (string) parse_url($httpReferer, PHP_URL_PATH);
395397
$basePath = rtrim((string) parse_url(XOOPS_URL, PHP_URL_PATH), '/'); // '' on root, '/xoops27' on WAMP
396398

397-
$isSystemAdmin = ($path === $basePath . '/modules/system/admin.php');
398-
$isControlPanelHome = ($path === $basePath . '/admin.php');
399-
$tpl->assign('showSystemServices', $isSystemAdmin || $isControlPanelHome);
399+
$isSystemAdmin = ($pathUri === $basePath . '/modules/system/admin.php');
400+
$isRefererSystem = ($pathReferer === $basePath . '/modules/system/admin.php');
401+
$isControlPanelHome = ($pathUri === $basePath . '/admin.php');
402+
$tpl->assign('showSystemServices', ($isSystemAdmin && $isRefererSystem) || $isControlPanelHome);
400403

401404
// assign vars
402405
$tpl->assign('sys_options', $system_services);

0 commit comments

Comments
 (0)