Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93032181
PhabricatorFileLinkListView.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
Mon, Nov 25, 16:55
Size
925 B
Mime Type
text/x-php
Expires
Wed, Nov 27, 16:55 (1 d, 21 h)
Engine
blob
Format
Raw Data
Handle
22561852
Attached To
rPH Phabricator
PhabricatorFileLinkListView.php
View Options
<?php
final
class
PhabricatorFileLinkListView
extends
AphrontView
{
private
$files
;
public
function
setFiles
(
array
$files
)
{
assert_instances_of
(
$files
,
'PhabricatorFile'
);
$this
->
files
=
$files
;
return
$this
;
}
private
function
getFiles
()
{
return
$this
->
files
;
}
public
function
render
()
{
$files
=
$this
->
getFiles
();
if
(!
$files
)
{
return
''
;
}
require_celerity_resource
(
'phabricator-remarkup-css'
);
$file_links
=
array
();
foreach
(
$this
->
getFiles
()
as
$file
)
{
$view
=
id
(
new
PhabricatorFileLinkView
())
->
setFilePHID
(
$file
->
getPHID
())
->
setFileName
(
$file
->
getName
())
->
setFileDownloadURI
(
$file
->
getDownloadURI
())
->
setFileViewURI
(
$file
->
getBestURI
())
->
setFileViewable
(
$file
->
isViewableImage
());
$file_links
[]
=
$view
->
render
();
}
return
phutil_implode_html
(
phutil_tag
(
'br'
),
$file_links
);
}
}
Event Timeline
Log In to Comment