crumbs[] = $crumb; return $this; } public function addAction(PhabricatorMenuItemView $action) { $this->actions[] = $action; return $this; } public function render() { require_celerity_resource('phabricator-crumbs-view-css'); $action_view = null; if ($this->actions) { $actions = array(); foreach ($this->actions as $action) { $icon = null; if ($action->getIcon()) { $icon = phutil_tag( 'span', array( 'class' => 'sprite-icon action-'.$action->getIcon(), ), ''); } $actions[] = javelin_tag( 'a', array( 'href' => $action->getHref(), 'class' => 'phabricator-crumbs-action', 'sigil' => $action->getWorkflow() ? 'workflow' : null, ), array( $icon, $action->getName(), )); } $action_view = phutil_tag( 'div', array( 'class' => 'phabricator-crumbs-actions', ), $this->renderHTMLView($actions)); } if ($this->crumbs) { last($this->crumbs)->setIsLastCrumb(true); } return phutil_tag( 'div', array( 'class' => 'phabricator-crumbs-view '. 'sprite-gradient gradient-breadcrumbs', ), $this->renderHTMLView( array( $action_view, $this->crumbs, ))); } }