Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F100774455
ConpherenceFileWidgetView.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
Sun, Feb 2, 15:51
Size
1 KB
Mime Type
text/x-php
Expires
Tue, Feb 4, 15:51 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
24029517
Attached To
rPH Phabricator
ConpherenceFileWidgetView.php
View Options
<?php
final
class
ConpherenceFileWidgetView
extends
ConpherenceWidgetView
{
public
function
render
()
{
$conpherence
=
$this
->
getConpherence
();
$widget_data
=
$conpherence
->
getWidgetData
();
$files
=
$widget_data
[
'files'
];
$files_authors
=
$widget_data
[
'files_authors'
];
$files_html
=
array
();
foreach
(
$files
as
$file
)
{
$icon_class
=
$file
->
getDisplayIconForMimeType
();
$icon_view
=
phutil_tag
(
'div'
,
array
(
'class'
=>
'file-icon phui-font-fa phui-icon-view '
.
$icon_class
,
),
''
);
$file_view
=
id
(
new
PhabricatorFileLinkView
())
->
setFilePHID
(
$file
->
getPHID
())
->
setFileName
(
id
(
new
PhutilUTF8StringTruncator
())
->
setMaximumGlyphs
(
28
)
->
truncateString
(
$file
->
getName
()))
->
setFileViewable
(
$file
->
isViewableImage
())
->
setFileViewURI
(
$file
->
getBestURI
())
->
setCustomClass
(
'file-title'
);
$who_done_it_text
=
''
;
// system generated files don't have authors
if
(
$file
->
getAuthorPHID
())
{
$who_done_it_text
=
pht
(
'By %s '
,
$files_authors
[
$file
->
getPHID
()]->
renderLink
());
}
$date_text
=
phabricator_relative_date
(
$file
->
getDateCreated
(),
$this
->
getUser
());
$who_done_it
=
phutil_tag
(
'div'
,
array
(
'class'
=>
'file-uploaded-by'
,
),
pht
(
'%s%s.'
,
$who_done_it_text
,
$date_text
));
$files_html
[]
=
phutil_tag
(
'div'
,
array
(
'class'
=>
'file-entry'
,
),
array
(
$icon_view
,
$file_view
,
$who_done_it
,
));
}
if
(
empty
(
$files
))
{
$files_html
[]
=
javelin_tag
(
'div'
,
array
(
'class'
=>
'no-files'
,
'sigil'
=>
'no-files'
,
),
pht
(
'No files.'
));
}
return
phutil_tag
(
'div'
,
array
(
'class'
=>
'file-list'
),
$files_html
);
}
}
Event Timeline
Log In to Comment