/**
  * @param \Render\APIs\APIv1\RenderAPI $renderApi
  * @param \Render\APIs\APIv1\Page $page
  * @return string
  */
 private function getUrl($renderApi, $page)
 {
     return $renderApi->isEditMode() ? 'javascript:void(0);' : $page->getUrl();
 }
Beispiel #2
0
 /**
  * @param \Render\APIs\APIv1\RenderAPI  $renderApi
  * @param \Render\Unit                  $unit
  * @param \Render\APIs\APIv1\Navigation $navigation
  * @param array                         $navigatorIds
  * @param \Render\APIs\APIv1\Page       $page
  * @param int                           $level
  * @param string                        $childrenMarkup
  *
  * @return string
  */
 protected function getNavItemMarkup($renderApi, $unit, $navigation, array &$navigatorIds, $page, $level, $childrenMarkup)
 {
     $pageId = $page->getPageId();
     $linkTag = new HtmlTagBuilder('a', array('class' => 'navLink'), array($page->getNavigationTitle()));
     $listTag = new HtmlTagBuilder('li', array('class' => 'navItem'), array($linkTag, $childrenMarkup));
     // get url
     if ($renderApi->isEditMode()) {
         $linkTag->set('href', 'javascript:void(0);');
     } else {
         $linkTag->set('href', $page->getUrl());
     }
     // collect classes
     if ($this->isItemActive($pageId, $navigatorIds)) {
         $listTag->addClass('navItemActive');
         $linkTag->addClass('navLinkActive');
     }
     if ($pageId == $navigation->getCurrentPageId()) {
         $listTag->addClass('navItemCurrent');
         $linkTag->addClass('navLinkCurrent');
     }
     if ($this->hasChildPages($pageId, $navigation)) {
         $listTag->addClass('hasChildPages');
         $linkTag->addClass('hasChildPages');
     }
     return $listTag;
     // return $listTag->toString();
 }