diff --git a/public_html/deployment/inc_functions.php b/public_html/deployment/inc_functions.php index 3ec77ca915133922665d3da7428e775eaae45ead..55785c6e1ed9189b6d712154ff02390cfc1129aa 100644 --- a/public_html/deployment/inc_functions.php +++ b/public_html/deployment/inc_functions.php @@ -191,6 +191,118 @@ function aGotop($sClass = "scroll-link btn btn-default") { )); } +function getTopNavLeft($aEmbed=[]) { + global $aParams, $oHtml; + $aReturn = []; + require_once("./classes/project.class.php"); + require_once("./classes/user.class.php"); + $oUser = new user(); + $sBaseUrl = '/deployment/'; + + $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"'; + + if($oUser->getUsername()){ + $oPrj1 = new project(); + $aPrjItems=[]; + foreach ($oPrj1->getProjects() as $sPrj) { + $oPrj = new project($sPrj); + $aPrjItems[]=['href'=>$sBaseUrl . $sPrj .'/', 'label'=>$oPrj->getLabel(), 'class'=>$sCurrentProject===$oPrj->getId() ? 'active' : '']; + } + + $aReturn=[ + [ + 'href'=>$sBaseUrl, 'label'=>t("menu"), 'class'=>(array_key_exists("prj", $aParams) && $aParams['prj']==='all' ? 'active' : ''), + 'children'=>[ + ['href'=>$sBaseUrl . 'all/setup/new/', 'label'=>t("menu-new-project") ], + ['href'=>$sBaseUrl . 'all/setup/actionlog/', 'label'=>t("menu-logs") ], + ['href'=>$sBaseUrl . 'all/setup/checklang/', 'label'=>t("menu-checklang") ], + ['href'=>$sBaseUrl . 'all/setup/', 'label'=>t("menu-settings") ], + ] + ], + [ + 'href'=>'#','label'=>t("menu-projects"), + 'children'=>$aPrjItems + ] + ] + ; + /* + + if (array_key_exists("prj", $aParams) && $aParams["prj"] <> "all") { + $oPrj = new project($aParams["prj"]); + $sReturn.=' + <li class="dropdown active">' + .$oHtml->getLink(array( + 'href'=>'#', + 'class'=>'dropdown-toggle', + 'data-toggle'=>'dropdown', + 'role'=>'button', + 'aria-expanded'=>'false', + 'icon'=>'project', + 'label'=>$oPrj->getLabel() .' <span class="caret"></span>', + )) + .' + <ul class="dropdown-menu" role="menu"> + <li'.($sCurrentAction===false ? $sLiActive :'') .'>' + . $oHtml->getLink(array( + 'href'=>$sBaseUrl . $aParams["prj"] .'/', + 'icon'=>'project-home', + 'label'=>t("project-home"), + )) + .'</li> + '; + $aPhases = $oPrj->getActivePhases(); + if (count($aPhases)) { + $sReturn.='<li role="separator" class="divider"></li> + <li'.($sCurrentAction==='build' ? $sLiActive :'') .'>' + .$oHtml->getLink(array( + 'href'=>$sBaseUrl . $aParams["prj"] . '/build/', + 'icon'=>'build', + 'label'=>t("build"), + )) + .'</li> + <li role="separator" class="divider"></li> + <li class="dropdown-header">'.t("menu-project-phases").'</li>'; + foreach ($aPhases as $sPhase) { + $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'.($sCurrentAction==='setup' ? $sLiActive :'') .'>' + .$oHtml->getLink(array( + 'href'=>$sBaseUrl . $aParams["prj"] . '/setup/', + 'icon'=>'setup', + 'label'=>t("menu-project-settings"), + )) + .'</li> + <li'.($sCurrentAction==='cleanup' ? $sLiActive :'') .'>' + .$oHtml->getLink(array( + 'href'=>$sBaseUrl . $aParams["prj"] . '/cleanup/', + 'icon'=>'cleanup', + 'label'=>t("menu-project-cleanup"), + )) + .'</li> + <li'.($sCurrentAction==='delete' ? $sLiActive :'') .'>' + .$oHtml->getLink(array( + 'href'=>$sBaseUrl . $aParams["prj"] . '/delete/', + 'icon'=>'delete', + 'label'=>t("menu-project-delete"), + )) + .'</li> + </ul></li>'; + } + */ + } + // echo '<pre>'.print_r($aReturn, 1); die(__FUNCTION__); + return $aReturn; +} + /** * auto generate upper part of the page with header and navigation * @global type $aParams diff --git a/public_html/deployment/index.php b/public_html/deployment/index.php index 627335b6139941e2210945e349aa987f75cc1426..65a2fb148ea9ddbb9889a431aee9b2ba75cef9b9 100644 --- a/public_html/deployment/index.php +++ b/public_html/deployment/index.php @@ -208,7 +208,7 @@ if(!$sTabApp && !$sPpage){ return true; } -*/ + $aTopnav = [ ['href'=>'#', 'label'=>'Menu A', 'icon'=>'fa-solid fa-home' ], ['href'=>'#', 'label'=>'Menu B', 'icon'=>'fa-solid fa-tv'], @@ -219,6 +219,8 @@ $aTopnav = [ ] ] ]; +*/ +$aTopnav=getTopNavLeft(); $aReplace['{{NAVI_TOP}}']='' . $renderAdminLTE->addWrapper( diff --git a/public_html/deployment/main.css b/public_html/deployment/main.css index 7efa7efbd4bf0e602b57460e4e07294a3c3598d4..12c2a7f43c30f059c6028afd84e947c4bdb092a4 100644 --- a/public_html/deployment/main.css +++ b/public_html/deployment/main.css @@ -57,7 +57,7 @@ body{padding-top: 0; */ } -div#navtop, div#navbuttom{background: #d0d8e0; padding: 0.5em;} +div#navtop, div#navbuttom{background: #e0e4e8; padding: 0.5em;} div#navtop{margin-bottom: 2em;} div#navtop .current{font-size: 170%; color: #667; padding: 0 0.2em; position: absolute;} div#navbuttom{ diff --git a/public_html/deployment/main_new_ui.css b/public_html/deployment/main_new_ui.css index fa956cec382b0a07bd1f75e5daa67ffab34f3861..73da8a215eb69a891eae6d6220caeadc081721c6 100644 --- a/public_html/deployment/main_new_ui.css +++ b/public_html/deployment/main_new_ui.css @@ -1,3 +1,9 @@ li.nav-item .active{background-color: #e8e8e8;} pre.config{background:#f4f4f4; color:#448; border-radius: 0.5em; max-height: auto; transition: all ease-in-out 0.2s;} .hidden{max-height: 0px; padding: 0; margin: 0;} + +.nav-tabs .nav-item.show .nav-link, .nav-tabs .nav-link.active { + color: #f8f8f8; + background-color: #456; + border-color: #dee2e6 #dee2e6 #fff; +} \ No newline at end of file