[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/applications/files/view/ -> PhabricatorGlobalUploadTargetView.php (source)

   1  <?php
   2  
   3  final class PhabricatorGlobalUploadTargetView extends AphrontView {
   4  
   5    private $showIfSupportedID;
   6  
   7    public function setShowIfSupportedID($show_if_supported_id) {
   8      $this->showIfSupportedID = $show_if_supported_id;
   9      return $this;
  10    }
  11  
  12    public function getShowIfSupportedID() {
  13      return $this->showIfSupportedID;
  14    }
  15  
  16    public function render() {
  17      $viewer = $this->getUser();
  18      if (!$viewer->isLoggedIn()) {
  19        return null;
  20      }
  21  
  22      $instructions_id = celerity_generate_unique_node_id();
  23  
  24      require_celerity_resource('global-drag-and-drop-css');
  25  
  26      Javelin::initBehavior('global-drag-and-drop', array(
  27        'ifSupported'   => $this->showIfSupportedID,
  28        'instructions'  => $instructions_id,
  29        'uploadURI'     => '/file/dropupload/',
  30        'browseURI'     => '/file/query/authored/',
  31        'viewPolicy'    => PhabricatorPolicies::getMostOpenPolicy(),
  32      ));
  33  
  34      return phutil_tag(
  35        'div',
  36        array(
  37          'id'    => $instructions_id,
  38          'class' => 'phabricator-global-upload-instructions',
  39          'style' => 'display: none;',
  40        ),
  41        pht("\xE2\x87\xAA Drop Files to Upload"));
  42    }
  43  }


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