コード例 #1
0
ファイル: HeaderView.php プロジェクト: qubes/defero
 public function render()
 {
     // Main nav
     $nav = new Nav(Nav::NAV_DEFAULT);
     $nav->addItem(new NavItem(new HtmlElement("a", ["href" => "/wizard"], "<strong>**Wizard**</strong>"), $this->_getNavItemState("/wizard")))->addItem(new NavItem(new HtmlElement("a", ["href" => "/campaigns"], "Campaigns"), $this->_getNavItemState("/campaigns")))->addItem(new NavItem(new HtmlElement("a", ["href" => "/contacts"], "Contacts"), $this->_getNavItemState("/contacts")))->addItem(new NavItem(new HtmlElement("a", ["href" => "/stats"], "Stats"), $this->_getNavItemState("/stats")));
     // Global typeahead search
     $searchForm = (new TypeAheadSearchFormView(TypeAheadEnum::ALL()))->setNavBarSearch();
     // Logo or brand
     $brand = new HtmlElement("a", ["class" => "brand", "href" => "/"], "Defero");
     return $brand . $nav . $searchForm;
 }
コード例 #2
0
ファイル: WalkthroughSidebar.php プロジェクト: qubes/support
 /**
  * @return string
  */
 public function render()
 {
     $menu = new Nav(Nav::NAV_DEFAULT);
     $walkthrough = $this->getWalkthrough();
     foreach ($walkthrough->getSteps() as $step) {
         $state = NavItem::STATE_NONE;
         $item = new NavItem(sprintf('<a href="%s">%s</a>', $this->getUrl($step), $step->title), $state);
         $menu->addItem($item);
     }
     return $menu->render();
 }
コード例 #3
0
ファイル: CategorySidebar.php プロジェクト: qubes/support
 /**
  * @return string
  */
 public function render()
 {
     $currentCategory = $this->getCategory();
     $menu = new Nav(Nav::NAV_DEFAULT);
     foreach ($currentCategory->getSiblingCategories() as $category) {
         if ($category->id() == $currentCategory->id()) {
             $state = NavItem::STATE_ACTIVE;
         } else {
             $state = NavItem::STATE_NONE;
         }
         $item = new NavItem(sprintf('<a href="%s">%s</a>', $this->getUrl($category), $category->title), $state);
         $item->setAttribute('id', sprintf('sidebar-category-%d', $category->id()));
         $menu->addItem($item);
     }
     return $menu->render();
 }