oSystem=&$oSystem; } function gbLoadMenu($sName,$sMenuTypeTPL="simple",$sAdditionalURL="") { $this->msKKK=$sName; if(defined("PATHMENUTPL")==1) { if($sMenuTypeTPL===false) { $this->mbCanBeRendered=false; if($this->oMenuData=$this->oSystem->oDB->goQuery("SELECT * FROM tdMenu WHERE MenuName='".$sName."'")) { $oMenu=$oMenu->goGetRecord(); $this->msMenuKey=$oMenu->MenuName; } } else { $sTPLFile=PATHMENUTPL."menu.".$sMenuTypeTPL.".tpl"; if(file_exists($sTPLFile)) { $this->oMenuTPL=$this->oSystem->goGetTPLParser($sTPLFile); $this->oMenuTPL->gbSetValue("BACKTOLIST",$sAdditionalURL); if($oMenuData=$this->oSystem->oDB->goGetResultView("menuitems",array("MenuName"=>$sName))) { $this->masMenuData=$oMenuData->gaaGetAllRecords(true); } echo mysql_error(); } } } else { $this->oSystem->oError->gsGenerateFinalError("no.menu"); } } function gbSetData($asData) { $this->masGetData=$asData; } function gsRenderMenu($asToThis=array(),$sActive="",$asAddData=array("xwidth"=>"110"),$sAPP=false,$asGetData=false) { if($this->mbCanBeRendered===true) { if(is_array($this->masMenuData)) { $asSet=array(); $sComp=join(":",$this->stripDROPSESSIONANWEISUNG()); foreach($this->masMenuData as $asItem) { $asX=explode(":",$asItem["Action"]); $sCurrentAction=$asX[0]=="DS"?$asX[1]:$asX[0]; $asAction=$asToThis; $asAction=array_merge($asAction,$asX); $asItem["Class"]=$asItem["Class"]=="false"?$this->oSystem->oControl->msCurrentClass:$asItem["Class"]; unset($asPush); $asPush=$asAddData; if($asItem["CellWidth"]!="__false__") $asPush["xwidth"]=$asItem["CellWidth"]; $asPush["ActionURL"]=$this->oSystem->oControl->oURL->gsGetURL($asItem["Class"],$asAction,$sAPP,$asGetData); $asPush["Display"]=$asItem["Display"]; $asPush["ActiveIMG"]=$asItem["Active"]; $asPush["HotKeyCode"]=$asItem["AltHotKey"]; $asPush["classActive"]=$asItem["Active"]; $asPush["classHOver"]=$asItem["Hover"]; $asPush["classNormal"]=$asItem["Active"]; $asPush["ActivePassive"]=$asItem["Normal"]; if(is_array($this->oSystem->oControl->masParameter)) if($this->oSystem->oControl->msCurrentClass==$asItem["Class"]) { if($this->msKKK=="main"||$this->msKKK=="intramain") { $asPush["ActivePassive"]=$asItem["Active"]; } else { if($asItem["Action"]=="false") $asPush["ActivePassive"]=$asItem["Active"]; else { $sAction=$sCurrentAction;//join(":",$asX); if(sizeof($asToThis)>0) { $sAction=join(":",$asToThis).":".$sAction; } if(substr($sComp,0,strlen($sAction))==$sAction) { $this->CurrentItemPK=$asItem["MenuItemPK"]; $asPush["ActivePassive"]=$asItem["Active"]; } } } } $asPush["HOver"]=$asItem["Hover"]; if($asItem["DontShow"]!="dontshow") { array_push($asSet,$asPush); } } $this->oMenuTPL->gbSetBlock("menu",$asSet); $oTPL=$this->oSystem->goGetTPLParser($this->oMenuTPL->gsParse(),"false"); $sMenu=$oTPL->gsParse(); return $sMenu; } else { $this->oSystem->oError->gsGenerateFinalError("no.menu"); } } else $this->oSystem->oError->gsGenerateFinalError("no.menu"); } function gasGetMenuLinks($asToThis=array(),$sActive="") { if(is_array($this->masMenuData)) { $asSet=array(); foreach($this->masMenuData as $asItem) { $asBuffer=$asToThis; array_push($asBuffer,$asItem["Action"]); $asItem["Class"]=$asItem["Class"]=="false"?$this->oSystem->oControl->msCurrentClass:$asItem["Class"]; $asAction=explode(":",$asItem["Action"]); $asPush["ActionURL"]=$this->oSystem->oControl->oURL->gsGetURL($asItem["Class"],$asAction); $asPush["Display"]=$asItem["Display"]; $asPush["ActiveIMG"]=$asItem["Hover"]; $asPush["ActivePassive"]=$asItem["Normal"]; if(is_array($this->oSystem->oControl->masParameter)) $sComp=join(":",$this->oSystem->oControl->masParameter); if($this->oSystem->oControl->msCurrentClass==$asItem["Class"]) { if($asItem["Action"]=="false") { $asPush["ActivePassive"]=$asItem["Active"]; } else { $sAction=$asItem["Action"]; if(substr($sComp,0,strlen($sAction))==$sAction) $asPush["ActivePassive"]=$asItem["Active"]; } } $asPush["HOver"]=$asItem["Hover"]; $sItemName=$this->msMenuKey."_".$asItem["RF"]; $asSet[$sItemName]=$asPush; } return $asSet; } else $this->oSystem->oError->gsGenerateFinalError("no.menu"); } function stripDROPSESSIONANWEISUNG() { $asData=$this->oSystem->oControl->masParameter; foreach($asData as $sKey=>$sData) { if($sData=="DS" || $sData=="") { unset($asData[$sKey]); } } return $asData; } }