Skip to content
Snippets Groups Projects

V2.0

Merged Hahn Axel (hahn) requested to merge v2.0 into master
4 files
+ 122
2
Compare changes
  • Side-by-side
  • Inline
Files
4
@@ -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
Loading