[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/view/layout/ -> PhabricatorCrumbView.php (source)

   1  <?php
   2  
   3  final class PhabricatorCrumbView extends AphrontView {
   4  
   5    private $name;
   6    private $href;
   7    private $icon;
   8    private $isLastCrumb;
   9    private $workflow;
  10    private $aural;
  11  
  12    public function setAural($aural) {
  13      $this->aural = $aural;
  14      return $this;
  15    }
  16  
  17    public function getAural() {
  18      return $this->aural;
  19    }
  20  
  21    public function setWorkflow($workflow) {
  22      $this->workflow = $workflow;
  23      return $this;
  24    }
  25  
  26    public function setName($name) {
  27      $this->name = $name;
  28      return $this;
  29    }
  30  
  31    public function getName() {
  32      return $this->name;
  33    }
  34  
  35    public function setHref($href) {
  36      $this->href = $href;
  37      return $this;
  38    }
  39  
  40    public function setIcon($icon) {
  41      $this->icon = $icon;
  42      return $this;
  43    }
  44  
  45    protected function canAppendChild() {
  46      return false;
  47    }
  48  
  49    public function setIsLastCrumb($is_last_crumb) {
  50      $this->isLastCrumb = $is_last_crumb;
  51      return $this;
  52    }
  53  
  54    public function render() {
  55      $classes = array(
  56        'phabricator-crumb-view',
  57      );
  58  
  59      $aural = null;
  60      if ($this->aural !== null) {
  61        $aural = javelin_tag(
  62          'span',
  63          array(
  64            'aural' => true,
  65          ),
  66          $this->aural);
  67      }
  68  
  69      $icon = null;
  70      if ($this->icon) {
  71        $classes[] = 'phabricator-crumb-has-icon';
  72        $icon = phutil_tag(
  73          'span',
  74          array(
  75            'class' => 'phabricator-crumb-icon '.
  76                       'sprite-apps-large apps-'.$this->icon.'-dark-large',
  77          ),
  78          '');
  79      }
  80  
  81      $name = phutil_tag(
  82        'span',
  83        array(
  84          'class' => 'phabricator-crumb-name',
  85        ),
  86        $this->name);
  87  
  88      $divider = null;
  89      if (!$this->isLastCrumb) {
  90        $divider = phutil_tag(
  91          'span',
  92          array(
  93            'class' => 'sprite-menu phabricator-crumb-divider',
  94          ),
  95          '');
  96      } else {
  97        $classes[] = 'phabricator-last-crumb';
  98      }
  99  
 100      return javelin_tag(
 101        $this->href ? 'a' : 'span',
 102          array(
 103            'sigil' => $this->workflow ? 'workflow' : null,
 104            'href'  => $this->href,
 105            'class' => implode(' ', $classes),
 106          ),
 107          array($aural, $icon, $name, $divider));
 108    }
 109  }


Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1