Skip to content
Snippets Groups Projects
Commit ba5e9e11 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

add first top menu items

parent efc82aad
No related branches found
No related tags found
1 merge request!62V2.0
...@@ -191,6 +191,118 @@ function aGotop($sClass = "scroll-link btn btn-default") { ...@@ -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 * auto generate upper part of the page with header and navigation
* @global type $aParams * @global type $aParams
......
...@@ -208,7 +208,7 @@ if(!$sTabApp && !$sPpage){ ...@@ -208,7 +208,7 @@ if(!$sTabApp && !$sPpage){
return true; return true;
} }
*/
$aTopnav = [ $aTopnav = [
['href'=>'#', 'label'=>'Menu A', 'icon'=>'fa-solid fa-home' ], ['href'=>'#', 'label'=>'Menu A', 'icon'=>'fa-solid fa-home' ],
['href'=>'#', 'label'=>'Menu B', 'icon'=>'fa-solid fa-tv'], ['href'=>'#', 'label'=>'Menu B', 'icon'=>'fa-solid fa-tv'],
...@@ -219,6 +219,8 @@ $aTopnav = [ ...@@ -219,6 +219,8 @@ $aTopnav = [
] ]
] ]
]; ];
*/
$aTopnav=getTopNavLeft();
$aReplace['{{NAVI_TOP}}']='' $aReplace['{{NAVI_TOP}}']=''
. $renderAdminLTE->addWrapper( . $renderAdminLTE->addWrapper(
......
...@@ -57,7 +57,7 @@ body{padding-top: 0; ...@@ -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{margin-bottom: 2em;}
div#navtop .current{font-size: 170%; color: #667; padding: 0 0.2em; position: absolute;} div#navtop .current{font-size: 170%; color: #667; padding: 0 0.2em; position: absolute;}
div#navbuttom{ div#navbuttom{
......
li.nav-item .active{background-color: #e8e8e8;} 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;} 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;} .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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment