[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/applications/diviner/view/ -> DivinerReturnTableView.php (source)

   1  <?php
   2  
   3  final class DivinerReturnTableView extends AphrontTagView {
   4  
   5    private $return;
   6    private $header;
   7  
   8    public function setReturn(array $return) {
   9      $this->return = $return;
  10      return $this;
  11    }
  12  
  13    public function setHeader($text) {
  14      $this->header = $text;
  15      return $this;
  16    }
  17  
  18    public function getTagName() {
  19      return 'div';
  20    }
  21  
  22    public function getTagAttributes() {
  23      return array(
  24        'class' => 'diviner-table-view',
  25      );
  26    }
  27  
  28    public function getTagContent() {
  29      require_celerity_resource('diviner-shared-css');
  30  
  31      $return = $this->return;
  32  
  33      $type = idx($return, 'doctype');
  34      if (!$type) {
  35        $type = idx($return, 'type');
  36      }
  37  
  38      $docs = idx($return, 'docs');
  39  
  40      $cells = array();
  41  
  42      $cells[] = phutil_tag(
  43        'td',
  44        array(
  45          'class' => 'diviner-return-table-type diviner-monospace',
  46        ),
  47        $type);
  48  
  49      $cells[] = phutil_tag(
  50        'td',
  51        array(
  52          'class' => 'diviner-return-table-docs',
  53        ),
  54        $docs);
  55  
  56      $rows = phutil_tag(
  57        'tr',
  58        array(),
  59        $cells);
  60  
  61      $table = phutil_tag(
  62        'table',
  63        array(
  64          'class' => 'diviner-return-table-view',
  65        ),
  66        $rows);
  67  
  68      $header = phutil_tag(
  69        'span',
  70        array(
  71          'class' => 'diviner-table-header',
  72        ),
  73        $this->header);
  74  
  75      return array($header, $table);
  76    }
  77  
  78  }


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