oSystem=&$oSystem; } function gbLoadMenu($sName,$sMenuTypeTPL="simple") { 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); if($oMenuData=$this->oSystem->oDB->goGetResultView("menuitems",array("MenuName"=>$sName))) { $this->masMenuData=$oMenuData->gaaGetAllRecords(true); } } } } 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(); foreach($this->masMenuData as $asItem) { $asX=explode(":",$asItem["Action"]); $asAction=$asToThis; $asAction=array_merge($asAction,$asX); $asItem["Class"]=$asItem["Class"]=="false"?$this->oSystem->oControl->msCurrentClass:$asItem["Class"]; unset($asPush); $asPush=$asAddData; $asPush["ActionURL"]=$this->oSystem->oControl->oURL->gsGetURL($asItem["Class"],$asAction,$sAPP,$asGetData); $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=array_shift($asX); if(sizeof($asToThis)>0) $sAction=join(":",$asToThis).":".$sAction; if(substr($sComp,0,strlen($sAction))==$sAction) $asPush["ActivePassive"]=$asItem["Active"]; } } $asPush["HOver"]=$asItem["Hover"]; 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"); } }