Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F108507668
PhabricatorGlobalUploadTargetView.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Apr 17, 04:04
Size
1 KB
Mime Type
text/x-php
Expires
Sat, Apr 19, 04:04 (2 d)
Engine
blob
Format
Raw Data
Handle
25616532
Attached To
rPH Phabricator
PhabricatorGlobalUploadTargetView.php
View Options
<?php
final
class
PhabricatorGlobalUploadTargetView
extends
AphrontView
{
private
$showIfSupportedID
;
public
function
setShowIfSupportedID
(
$show_if_supported_id
)
{
$this
->
showIfSupportedID
=
$show_if_supported_id
;
return
$this
;
}
public
function
getShowIfSupportedID
()
{
return
$this
->
showIfSupportedID
;
}
public
function
render
()
{
$viewer
=
$this
->
getUser
();
if
(!
$viewer
->
isLoggedIn
())
{
return
null
;
}
$instructions_id
=
celerity_generate_unique_node_id
();
require_celerity_resource
(
'global-drag-and-drop-css'
);
// Use the configured default view policy. Drag and drop uploads use
// 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
// Pholio uploads and Remarkup text areas).
$view_policy
=
PhabricatorFile
::
initializeNewFile
()->
getViewPolicy
();
Javelin
::
initBehavior
(
'global-drag-and-drop'
,
array
(
'ifSupported'
=>
$this
->
showIfSupportedID
,
'instructions'
=>
$instructions_id
,
'uploadURI'
=>
'/file/dropupload/'
,
'browseURI'
=>
'/file/query/authored/'
,
'viewPolicy'
=>
$view_policy
,
'chunkThreshold'
=>
PhabricatorFileStorageEngine
::
getChunkThreshold
(),
));
return
phutil_tag
(
'div'
,
array
(
'id'
=>
$instructions_id
,
'class'
=>
'phabricator-global-upload-instructions'
,
'style'
=>
'display: none;'
,
),
pht
(
"
\x
E2
\x
87
\x
AA Drop Files to Upload"
));
}
}
Event Timeline
Log In to Comment