コード例 #1
0
ファイル: NavigationItem.php プロジェクト: 0svald/icingaweb2
 /**
  * Return this item rendered to HTML
  *
  * @return  string
  */
 public function render()
 {
     try {
         return $this->getRenderer()->setItem($this)->render();
     } catch (Exception $e) {
         Logger::error('Could not invoke custom navigation item renderer. %s in %s:%d with message: %s', get_class($e), $e->getFile(), $e->getLine(), $e->getMessage());
         $renderer = new NavigationItemRenderer();
         return $renderer->render($this);
     }
 }
コード例 #2
0
 /**
  * Render the given navigation item as HTML anchor with a badge
  *
  * @param   NavigationItem  $item
  *
  * @return  string
  */
 public function render(NavigationItem $item = null)
 {
     if ($item === null) {
         $item = $this->getItem();
     }
     $item->setCssClass('badge-nav-item');
     $this->setEscapeLabel(false);
     $label = $this->view()->escape($item->getLabel());
     if (($icon = $item->getIcon()) !== null) {
         $label = $this->view()->icon($icon) . $label;
         $item->setIcon(null);
     }
     $item->setLabel($this->renderBadge() . $label);
     $html = parent::render($item);
     if ($icon) {
         $item->setIcon(true);
     }
     return $html;
 }
コード例 #3
0
 public function render(NavigationItem $item = null)
 {
     return parent::render($item);
 }
コード例 #4
0
 /**
  * {@inheritdoc}
  */
 public function render()
 {
     foreach ($this as $item) {
         /** @var NavigationItem $item */
         if ($item->shouldRender()) {
             if ($this->getUseStandardItemRenderer()) {
                 $renderer = new NavigationItemRenderer();
                 $content = $renderer->render($item);
             } else {
                 $content = $item->render();
             }
             $this->content[] = $this->getInnerIterator()->beginItemMarkup($item);
             $this->content[] = $content;
             if (!$item->hasChildren()) {
                 $this->content[] = $this->getInnerIterator()->endItemMarkup();
             }
         }
     }
     return join("\n", $this->content);
 }
コード例 #5
0
 /**
  * Render the given navigation item as HTML anchor with a badge
  *
  * @param   NavigationItem  $item
  *
  * @return  string
  */
 public function render(NavigationItem $item = null)
 {
     return $this->renderBadge() . parent::render($item);
 }
コード例 #6
0
 public function render(NavigationItem $item = null)
 {
     return '<div class="clearfix">' . $this->getAvatar() . parent::render($item) . '</div>';
 }