diff --git a/admin_settings.php b/admin_settings.php index c11ef5e2..8935789f 100644 --- a/admin_settings.php +++ b/admin_settings.php @@ -26,9 +26,7 @@ Database::needSqlData(); $sql_root = Database::getSqlData(); Database::needRoot(false); -if (($page == 'settings' || $page == 'overview') - && $userinfo['change_serversettings'] == '1' -) { +if ($page == 'overview' && $userinfo['change_serversettings'] == '1') { $settings_data = loadConfigArrayDir('./actions/admin/settings/'); $settings = loadSettings($settings_data); diff --git a/lib/functions/output/function.buildNavigation.php b/lib/functions/output/function.buildNavigation.php index 14cfe7a8..a9a6e879 100644 --- a/lib/functions/output/function.buildNavigation.php +++ b/lib/functions/output/function.buildNavigation.php @@ -26,99 +26,79 @@ * @author Florian Lippert */ -function buildNavigation($navigation, $userinfo) -{ +function buildNavigation($navigation, $userinfo) { global $theme; $returnvalue = ''; - - foreach($navigation as $box) - { - if((!isset($box['show_element']) || $box['show_element'] === true) && - (!isset($box['required_resources']) || $box['required_resources'] == '' || (isset($userinfo[$box['required_resources']]) && ((int)$userinfo[$box['required_resources']] > 0 || $userinfo[$box['required_resources']] == '-1')))) - { + + foreach($navigation as $box) { + if ((!isset($box['show_element']) || $box['show_element'] === true) && + (!isset($box['required_resources']) || $box['required_resources'] == '' || (isset($userinfo[$box['required_resources']]) && ((int)$userinfo[$box['required_resources']] > 0 || $userinfo[$box['required_resources']] == '-1')))) { $navigation_links = ''; - foreach($box['elements'] as $element_id => $element) - { - if((!isset($element['show_element']) || $element['show_element'] === true) && - (!isset($element['required_resources']) || $element['required_resources'] == '' || (isset($userinfo[$element['required_resources']]) && ((int)$userinfo[$element['required_resources']] > 0 || $userinfo[$element['required_resources']] == '-1')))) - { - if(isset($element['url']) && trim($element['url']) != '') - { + foreach ($box['elements'] as $element_id => $element) { + if ((!isset($element['show_element']) || $element['show_element'] === true) && + (!isset($element['required_resources']) || $element['required_resources'] == '' || (isset($userinfo[$element['required_resources']]) && ((int)$userinfo[$element['required_resources']] > 0 || $userinfo[$element['required_resources']] == '-1')))) { + if (isset($element['url']) && trim($element['url']) != '') { // append sid only to local - - if(!preg_match('/^https?\:\/\//', $element['url']) - && (isset($userinfo['hash']) && $userinfo['hash'] != '')) - { + + if (!preg_match('/^https?\:\/\//', $element['url']) + && (isset($userinfo['hash']) && $userinfo['hash'] != '')) { // generate sid with ? oder & - - if(strpos($element['url'], '?') !== false) - { + + if (strpos($element['url'], '?') !== false) { $element['url'].= '&s=' . $userinfo['hash']; - } - else - { + } else { $element['url'].= '?s=' . $userinfo['hash']; } } - + $target = ''; - - if(isset($element['new_window']) && $element['new_window'] == true) - { + if (isset($element['new_window']) && $element['new_window'] == true) { $target = ' target="_blank"'; } - - $completeLink = '' . $element['label'] . ''; - } - else - { + + $active = ''; + if (isset($_GET['page']) && substr_count($element['url'], "page=" . $_GET['page']) > 0 && substr_count($element['url'], basename($_SERVER["SCRIPT_FILENAME"])) > 0) { + $active = ' active'; + } + + $completeLink = '' . $element['label'] . ''; + } else { $completeLink = $element['label']; } - + eval("\$navigation_links .= \"" . getTemplate("navigation_link", 1) . "\";"); } } - - if($navigation_links != '') - { - if(isset($box['url']) && trim($box['url']) != '') - { + + if ($navigation_links != '') { + if (isset($box['url']) && trim($box['url']) != '') { // append sid only to local - - if(!preg_match('/^https?\:\/\//', $box['url']) - && (isset($userinfo['hash']) && $userinfo['hash'] != '')) - { + + if (!preg_match('/^https?\:\/\//', $box['url']) && (isset($userinfo['hash']) && $userinfo['hash'] != '')) { // generate sid with ? oder & - - if(strpos($box['url'], '?') !== false) - { + + if (strpos($box['url'], '?') !== false) { $box['url'].= '&s=' . $userinfo['hash']; - } - else - { + } else { $box['url'].= '?s=' . $userinfo['hash']; } } - + $target = ''; - - if(isset($box['new_window']) && $box['new_window'] == true) - { + if (isset($box['new_window']) && $box['new_window'] == true) { $target = ' target="_blank"'; } - + $completeLink = '' . $box['label'] . ''; - } - else - { + } else { $completeLink = $box['label']; } - + eval("\$returnvalue .= \"" . getTemplate("navigation_element", 1) . "\";"); } } } - + return $returnvalue; } diff --git a/lib/navigation/00.froxlor.main.php b/lib/navigation/00.froxlor.main.php index c0050a40..ce6eaefd 100644 --- a/lib/navigation/00.froxlor.main.php +++ b/lib/navigation/00.froxlor.main.php @@ -206,7 +206,7 @@ return array ( 'required_resources' => 'change_serversettings', ), array ( - 'url' => 'admin_settings.php?page=settings', + 'url' => 'admin_settings.php?page=overview', 'label' => $lng['admin']['serversettings'], 'required_resources' => 'change_serversettings', ), diff --git a/templates/Froxlor/assets/css/main.css b/templates/Froxlor/assets/css/main.css index 72df05b5..b827383c 100644 --- a/templates/Froxlor/assets/css/main.css +++ b/templates/Froxlor/assets/css/main.css @@ -395,6 +395,10 @@ a:hover { text-decoration: underline; } +a.active { + font-weight: bold; +} + .infotext { font-size: 11px; } diff --git a/templates/Sparkle/assets/css/main.css b/templates/Sparkle/assets/css/main.css index 70088a2d..3f6bd7a4 100644 --- a/templates/Sparkle/assets/css/main.css +++ b/templates/Sparkle/assets/css/main.css @@ -488,6 +488,10 @@ a:hover { text-decoration:underline; } +a.active { + font-weight: bold; +} + .infotext { font-size:11px; }