/** * Creates the html-code for one single navigationpoint. The check if the user has the needed rights should have been made before! * * @param class_module_navigation_point $objPointData * @param bool $bitActive * @param int $intLevel * @param bool $bitFirst * @param bool $bitLast * * @return string */ private function createNavigationPoint(class_module_navigation_point $objPointData, $bitActive, $intLevel, $bitFirst = false, $bitLast = false) { //and start to create a link and all needed stuff $arrTemp = array(); $arrTemp["page_intern"] = $objPointData->getStrPageI(); $arrTemp["page_extern"] = $objPointData->getStrPageE(); $arrTemp["systemid"] = $objPointData->getSystemid(); $arrTemp["text"] = $objPointData->getStrName(); $arrTemp["link"] = getLinkPortal($arrTemp["page_intern"], $arrTemp["page_extern"], $objPointData->getStrTarget(), $arrTemp["text"], $objPointData->getStrLinkAction(), "", $objPointData->getStrLinkSystemid()); $arrTemp["href"] = getLinkPortalHref($arrTemp["page_intern"], $arrTemp["page_extern"], $objPointData->getStrLinkAction(), "", $objPointData->getStrLinkSystemid()); $arrTemp["target"] = $objPointData->getStrTarget(); if ($objPointData->getStrImage() != "") { $arrTemp["image"] = getLinkPortal($arrTemp["page_intern"], $arrTemp["page_extern"], $objPointData->getStrTarget(), "<img src=\"" . _webpath_ . $objPointData->getStrImage() . "\" border=\"0\" alt=\"" . $arrTemp["text"] . "\"/>", $objPointData->getStrLinkAction(), "", $objPointData->getStrSystemid()); $arrTemp["image_src"] = $objPointData->getStrImage(); } if ($objPointData->getStrPageI() != "") { $objPage = class_module_pages_page::getPageByName($objPointData->getStrPageI()); if ($objPage != null && $objPage->getIntLmTime() != "") { $arrTemp["lastmodified"] = strftime("%Y-%m-%dT%H:%M:%S", $objPage->getIntLmTime()); } } //Load the correct template $strSection = "level_" . $intLevel . "_" . ($bitActive ? "active" : "inactive") . ($bitFirst ? "_first" : "") . ($bitLast ? "_last" : ""); $strTemplateId = $this->objTemplate->readTemplate("/module_navigation/" . $this->arrElementData["navigation_template"], $strSection); //Fill the template $strReturn = $this->objTemplate->fillTemplate($arrTemp, $strTemplateId, false); //BUT: if we received an empty string and are in the situation of a first or last point, then maybe the template // didn't supply a first / last section. so we'll try to load a regular point if ($strReturn == "" && ($bitFirst || $bitLast)) { $strSection = "level_" . $intLevel . "_" . ($bitActive ? "active" : "inactive"); $strTemplateId = $this->objTemplate->readTemplate("/module_navigation/" . $this->arrElementData["navigation_template"], $strSection); //And fill it once more $strReturn = $this->objTemplate->fillTemplate($arrTemp, $strTemplateId, false); } return $strReturn; }
private function processSinglePoint(class_module_navigation_point $objPoint) { $strReturn = ""; $bitError = false; $strReturn .= $objPoint->getStrName() . ": "; if ($objPoint->getStrPageI() == "" && $objPoint->getStrPageE() == "") { $strReturn .= $this->getLang("systemtask_navigationcheck_invalidEmpty"); $bitError = true; } else { if ($objPoint->getStrPageI() != "" && $objPoint->getStrPageE() != "") { $strReturn .= $this->getLang("systemtask_navigationcheck_invalidBoth"); $bitError = true; } else { if ($objPoint->getStrPageI() != "" && $objPoint->getStrPageE() == "") { //try to load internal page and check if it exists $objPage = class_module_pages_page::getPageByName($objPoint->getStrPageI()); if ($objPage == null) { $strReturn .= $this->getLang("systemtask_navigationcheck_invalidInternal") . " " . $objPoint->getStrPageI() . ")"; $bitError = true; } else { $strReturn .= $this->getLang("systemtask_navigationcheck_valid") . " " . $objPoint->getStrPageI() . $objPoint->getStrPageE() . ")"; } } else { $strReturn .= $this->getLang("systemtask_navigationcheck_valid") . " " . $objPoint->getStrPageI() . $objPoint->getStrPageE() . ")"; } } } if ($bitError) { $strReturn = "<b>" . $strReturn . "</b>"; } return $strReturn . "<br />"; }