3 final class PHUICrumbView
extends AphrontView
{
11 private $alwaysVisible;
13 public function setAural($aural) {
14 $this->aural
= $aural;
18 public function getAural() {
23 * Make this crumb always visible, even on devices where it would normally
26 * @param bool True to make the crumb always visible.
29 public function setAlwaysVisible($always_visible) {
30 $this->alwaysVisible
= $always_visible;
34 public function getAlwaysVisible() {
35 return $this->alwaysVisible
;
38 public function setWorkflow($workflow) {
39 $this->workflow
= $workflow;
43 public function setName($name) {
48 public function getName() {
52 public function setHref($href) {
57 public function setIcon($icon) {
62 protected function canAppendChild() {
66 public function setIsLastCrumb($is_last_crumb) {
67 $this->isLastCrumb
= $is_last_crumb;
71 public function render() {
77 if ($this->aural
!== null) {
88 $classes[] = 'phui-crumb-has-icon';
89 $icon = id(new PHUIIconView())
90 ->setIcon($this->icon
);
93 // Surround the crumb name with spaces so that double clicking it only
94 // selects the crumb itself.
95 $name = array(' ', $this->name
);
100 'class' => 'phui-crumb-name',
104 // Because of text-overflow and safari, put the second space on the
105 // outside of the element.
106 $name = array($name, ' ');
109 if (!$this->isLastCrumb
) {
110 $divider = id(new PHUIIconView())
111 ->setIcon('fa-angle-right')
112 ->addClass('phui-crumb-divider')
113 ->addClass('phui-crumb-view');
115 $classes[] = 'phabricator-last-crumb';
118 if ($this->getAlwaysVisible()) {
119 $classes[] = 'phui-crumb-always-visible';
123 $this->href ?
'a' : 'span',
125 'sigil' => $this->workflow ?
'workflow' : null,
126 'href' => $this->href
,
127 'class' => implode(' ', $classes),
129 array($aural, $icon, $name));
131 return array($tag, $divider);