Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93152260
PhabricatorObjectListView.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
Tue, Nov 26, 14:52
Size
1 KB
Mime Type
text/x-php
Expires
Thu, Nov 28, 14:52 (1 d, 21 h)
Engine
blob
Format
Raw Data
Handle
22582258
Attached To
rPH Phabricator
PhabricatorObjectListView.php
View Options
<?php
final
class
PhabricatorObjectListView
extends
AphrontView
{
private
$handles
=
array
();
private
$buttons
=
array
();
public
function
setHandles
(
array
$handles
)
{
assert_instances_of
(
$handles
,
'PhabricatorObjectHandle'
);
$this
->
handles
=
$handles
;
return
$this
;
}
public
function
addButton
(
PhabricatorObjectHandle
$handle
,
$button
)
{
$this
->
buttons
[
$handle
->
getPHID
()][]
=
$button
;
return
$this
;
}
public
function
render
()
{
$handles
=
$this
->
handles
;
require_celerity_resource
(
'phabricator-object-list-view-css'
);
$out
=
array
();
foreach
(
$handles
as
$handle
)
{
$buttons
=
idx
(
$this
->
buttons
,
$handle
->
getPHID
(),
array
());
if
(
$buttons
)
{
$buttons
=
phutil_tag
(
'div'
,
array
(
'class'
=>
'phabricator-object-list-view-buttons'
,
),
$buttons
);
}
else
{
$buttons
=
null
;
}
$out
[]
=
javelin_tag
(
'div'
,
array
(
'class'
=>
'phabricator-object-list-view-item'
,
'style'
=>
'background-image: url('
.
$handle
->
getImageURI
().
');'
,
),
array
(
$handle
->
renderLink
(),
$buttons
,
));
}
return
phutil_tag
(
'div'
,
array
(
'class'
=>
'phabricator-object-list-view'
,
),
$out
);
}
}
Event Timeline
Log In to Comment