diff --git a/public_html/deployment/inc_functions.php b/public_html/deployment/inc_functions.php index e0396d9bf01f60272ffcb6c4f8f8539c19c3bbdc..7dac3218fbd225981a68407860e72f493d589142 100644 --- a/public_html/deployment/inc_functions.php +++ b/public_html/deployment/inc_functions.php @@ -212,6 +212,11 @@ function getTopArea() { $sBaseUrl = '/deployment/'; $sWikiBaseUrl = 'https://intranet.iml.unibe.ch/wiki/doku.php'; + $sCurrentProject=(array_key_exists("prj", $aParams) && $aParams["prj"] <> "all") ? $aParams["prj"] : false; + $sCurrentAction=(array_key_exists("action", $aParams) && $aParams["action"]) ? $aParams["action"] : false; + $sCurrentPar3=(array_key_exists("par3", $aParams) && $aParams["par3"]) ? $aParams["par3"] : false; + $sLiActive=' class="active"'; + $sReturn = ' <span id="top"></span> <nav class="navbar navbar-inverse" role="navigation"> @@ -252,22 +257,27 @@ function getTopArea() { 'label'=>t("menu").' <span class="caret"></span>', )) .'<ul class="dropdown-menu" role="menu"> - <li>'.$oHtml->getLink(array( + <li'.($sCurrentPar3=== 'new' ? $sLiActive :'') .'>' + .$oHtml->getLink(array( 'href'=>$sBaseUrl . 'all/setup/new/', 'icon'=>'new', 'label'=>t("menu-new-project"), )).'</li> - <li>'.$oHtml->getLink(array( + <li'.($sCurrentPar3=== 'actionlog' ? $sLiActive :'') .'>' + + .$oHtml->getLink(array( 'href'=>$sBaseUrl . 'all/setup/actionlog/', 'icon'=>'actionlog', 'label'=>t("menu-logs"), )).'</li> - <li>'.$oHtml->getLink(array( + <li'.($sCurrentPar3=== 'checklang' ? $sLiActive :'') .'>' + .$oHtml->getLink(array( 'href'=>$sBaseUrl . 'all/setup/checklang/', 'icon'=>'checklang', 'label'=>t("menu-checklang"), )).'</li> - <li>'.$oHtml->getLink(array( + <li'.($sCurrentAction==='setup' && $sCurrentPar3===false ? $sLiActive :'') .'>' + .$oHtml->getLink(array( 'href'=>$sBaseUrl . 'all/setup/', 'icon'=>'setup', 'label'=>t("menu-settings"), @@ -292,7 +302,9 @@ function getTopArea() { $oPrj1 = new project(); foreach ($oPrj1->getProjects() as $sPrj) { $oPrj = new project($sPrj); - $sReturn.='<li>' + $sReturn.='<li' + . ($sCurrentProject===$oPrj->getId() ? $sLiActive:'') + . '>' . $oHtml->getLink(array( 'href'=>$sBaseUrl . $sPrj .'/', 'icon'=>'project', @@ -320,7 +332,7 @@ function getTopArea() { )) .' <ul class="dropdown-menu" role="menu"> - <li>' + <li'.($sCurrentAction===false ? $sLiActive :'') .'>' . $oHtml->getLink(array( 'href'=>$sBaseUrl . $sPrj .'/', 'icon'=>'project-home', @@ -331,7 +343,7 @@ function getTopArea() { $aPhases = $oPrj->getActivePhases(); if (count($aPhases)) { $sReturn.='<li role="separator" class="divider"></li> - <li>' + <li'.($sCurrentAction==='build' ? $sLiActive :'') .'>' .$oHtml->getLink(array( 'href'=>$sBaseUrl . $aParams["prj"] . '/build/', 'icon'=>'build', @@ -341,26 +353,27 @@ function getTopArea() { <li role="separator" class="divider"></li> <li class="dropdown-header">'.t("menu-project-phases").'</li>'; foreach ($aPhases as $sPhase) { - $sReturn.='<li><a href="' . $sBaseUrl . $aParams["prj"] . '/phase/' . $sPhase . '/">' . $oHtml->getIcon('phase').$sPhase . '</a></li>'; + $sReturn.='<li'.(isset($aParams['par3']) && $aParams['par3']===$sPhase ? $sLiActive :'') .'>' + . '<a href="' . $sBaseUrl . $aParams["prj"] . '/phase/' . $sPhase . '/">' . $oHtml->getIcon('phase').$sPhase . '</a></li>'; } } $sReturn.=' <li role="separator" class="divider"></li> - <li>' + <li'.($sCurrentAction==='setup' ? $sLiActive :'') .'>' .$oHtml->getLink(array( 'href'=>$sBaseUrl . $aParams["prj"] . '/setup/', 'icon'=>'setup', 'label'=>t("menu-project-settings"), )) .'</li> - <li>' + <li'.($sCurrentAction==='cleanup' ? $sLiActive :'') .'>' .$oHtml->getLink(array( 'href'=>$sBaseUrl . $aParams["prj"] . '/cleanup/', 'icon'=>'cleanup', 'label'=>t("menu-project-cleanup"), )) .'</li> - <li>' + <li'.($sCurrentAction==='delete' ? $sLiActive :'') .'>' .$oHtml->getLink(array( 'href'=>$sBaseUrl . $aParams["prj"] . '/delete/', 'icon'=>'delete',