Changeset View
Changeset View
Standalone View
Standalone View
src/applications/files/view/PhabricatorGlobalUploadTargetView.php
<?php | <?php | ||||
/** | |||||
* IMPORTANT: If you use this, make sure to implement | |||||
* | |||||
* public function isGlobalDragAndDropUploadEnabled() { | |||||
* return true; | |||||
* } | |||||
* | |||||
* on the controller(s) that render this class...! This is necessary | |||||
* to make sure Quicksand works properly with the javascript in this | |||||
* UI. | |||||
*/ | |||||
final class PhabricatorGlobalUploadTargetView extends AphrontView { | final class PhabricatorGlobalUploadTargetView extends AphrontView { | ||||
private $showIfSupportedID; | private $showIfSupportedID; | ||||
public function setShowIfSupportedID($show_if_supported_id) { | public function setShowIfSupportedID($show_if_supported_id) { | ||||
$this->showIfSupportedID = $show_if_supported_id; | $this->showIfSupportedID = $show_if_supported_id; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getShowIfSupportedID() { | public function getShowIfSupportedID() { | ||||
return $this->showIfSupportedID; | return $this->showIfSupportedID; | ||||
} | } | ||||
public function render() { | public function render() { | ||||
$viewer = $this->getUser(); | $viewer = $this->getUser(); | ||||
if (!$viewer->isLoggedIn()) { | if (!$viewer->isLoggedIn()) { | ||||
return null; | return null; | ||||
} | } | ||||
$instructions_id = celerity_generate_unique_node_id(); | $instructions_id = 'phabricator-global-drag-and-drop-upload-instructions'; | ||||
btrahan: I was getting errors on this being dynamic - differs per page - so I just figured making it a… | |||||
require_celerity_resource('global-drag-and-drop-css'); | require_celerity_resource('global-drag-and-drop-css'); | ||||
// Use the configured default view policy. Drag and drop uploads use | // Use the configured default view policy. Drag and drop uploads use | ||||
// a more restrictive view policy if we don't specify a policy explicitly, | // a more restrictive view policy if we don't specify a policy explicitly, | ||||
// as the more restrictive policy is correct for most drop targets (like | // as the more restrictive policy is correct for most drop targets (like | ||||
// Pholio uploads and Remarkup text areas). | // Pholio uploads and Remarkup text areas). | ||||
Show All 21 Lines |
I was getting errors on this being dynamic - differs per page - so I just figured making it a big long unique string would work.