[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/view/control/ -> AphrontAbstractAttachedFileView.php (source)

   1  <?php
   2  
   3  abstract class AphrontAbstractAttachedFileView extends AphrontView {
   4  
   5    private $file;
   6  
   7    final public function setFile(PhabricatorFile $file) {
   8      $this->file = $file;
   9      return $this;
  10    }
  11  
  12    final protected function getFile() {
  13      return $this->file;
  14    }
  15  
  16    final protected function getName() {
  17      $file = $this->getFile();
  18      return phutil_tag(
  19        'a',
  20        array(
  21          'href'    => $file->getViewURI(),
  22          'target'  => '_blank',
  23        ),
  24        $file->getName());
  25    }
  26  
  27    final protected function getRemoveElement() {
  28      $file = $this->getFile();
  29      return javelin_tag(
  30        'a',
  31        array(
  32          'class' => 'button grey',
  33          'sigil' => 'aphront-attached-file-view-remove',
  34          // NOTE: Using 'ref' here instead of 'meta' because the file upload
  35          // endpoint doesn't receive request metadata and thus can't generate
  36          // a valid response with node metadata.
  37          'ref'   => $file->getPHID(),
  38        ),
  39        "\xE2\x9C\x96"); // "Heavy Multiplication X"
  40    }
  41  }


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