[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/applications/countdown/view/ -> PhabricatorCountdownView.php (source)

   1  <?php
   2  
   3  final class PhabricatorCountdownView extends AphrontTagView {
   4  
   5    private $countdown;
   6    private $headless;
   7  
   8  
   9    public function setHeadless($headless) {
  10      $this->headless = $headless;
  11      return $this;
  12    }
  13  
  14    public function setCountdown(PhabricatorCountdown $countdown) {
  15      $this->countdown = $countdown;
  16      return $this;
  17    }
  18  
  19  
  20    public function getTagContent() {
  21      $countdown = $this->countdown;
  22  
  23      require_celerity_resource('phabricator-countdown-css');
  24  
  25      $header = null;
  26      if (!$this->headless) {
  27        $header = phutil_tag(
  28          'div',
  29          array(
  30            'class' => 'phabricator-timer-header',
  31          ),
  32          array(
  33            'C'.$countdown->getID(),
  34            ' ',
  35            phutil_tag(
  36              'a',
  37              array(
  38                'href' => '/countdown/'.$countdown->getID(),
  39              ),
  40              $countdown->getTitle()),
  41          ));
  42      }
  43  
  44  
  45      $ths = array(
  46        phutil_tag('th', array(), pht('Days')),
  47        phutil_tag('th', array(), pht('Hours')),
  48        phutil_tag('th', array(), pht('Minutes')),
  49        phutil_tag('th', array(), pht('Seconds')),
  50      );
  51  
  52      $dashes = array(
  53        javelin_tag('td', array('sigil' => 'phabricator-timer-days'), '-'),
  54        javelin_tag('td', array('sigil' => 'phabricator-timer-hours'), '-'),
  55        javelin_tag('td', array('sigil' => 'phabricator-timer-minutes'), '-'),
  56        javelin_tag('td', array('sigil' => 'phabricator-timer-seconds'), '-'),
  57      );
  58  
  59      $container = celerity_generate_unique_node_id();
  60      $content = phutil_tag(
  61        'div',
  62        array('class' => 'phabricator-timer', 'id' => $container),
  63        array(
  64          $header,
  65          phutil_tag('table', array('class' => 'phabricator-timer-table'), array(
  66            phutil_tag('tr', array(), $ths),
  67            phutil_tag('tr', array(), $dashes),
  68          )),
  69        ));
  70  
  71      Javelin::initBehavior('countdown-timer', array(
  72        'timestamp' => $countdown->getEpoch(),
  73        'container' => $container,
  74      ));
  75  
  76      return $content;
  77    }
  78  
  79  }


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