/** * Renders HTML for a Drupal administration toolbar item * * @param $item * * @return string */ public function renderToolbarItem($item) { if (null === $this->toolbar) { $this->toolbar = toolbar_view(); } return render($this->toolbar[$item]); }
public function renderToolbar() { if ($this->requestStack->getCurrentRequest() === $this->requestStack->getMasterRequest()) { $toolbar = array('#pre_render' => array('toolbar_pre_render', 'shortcut_toolbar_pre_render'), '#access' => user_access('access toolbar'), 'toolbar_drawer' => array()); $toolbar = array_merge($toolbar, toolbar_view()); $content = render($toolbar); return $content; } }