Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92961327
PhabricatorFlagListView.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, 04:26
Size
1 KB
Mime Type
text/x-php
Expires
Wed, Nov 27, 04:26 (2 d)
Engine
blob
Format
Raw Data
Handle
22546327
Attached To
rPH Phabricator
PhabricatorFlagListView.php
View Options
<?php
final
class
PhabricatorFlagListView
extends
AphrontView
{
private
$flags
;
public
function
setFlags
(
array
$flags
)
{
assert_instances_of
(
$flags
,
'PhabricatorFlag'
);
$this
->
flags
=
$flags
;
return
$this
;
}
public
function
render
()
{
$user
=
$this
->
user
;
require_celerity_resource
(
'phabricator-flag-css'
);
$rows
=
array
();
foreach
(
$this
->
flags
as
$flag
)
{
$class
=
PhabricatorFlagColor
::
getCSSClass
(
$flag
->
getColor
());
$rows
[]
=
array
(
phutil_tag
(
'div'
,
array
(
'class'
=>
'phabricator-flag-icon '
.
$class
,
),
''
),
$flag
->
getHandle
()->
renderLink
(),
phutil_escape_html
(
$flag
->
getNote
()),
phabricator_datetime
(
$flag
->
getDateCreated
(),
$user
),
phabricator_render_form
(
$user
,
array
(
'method'
=>
'POST'
,
'action'
=>
'/flag/edit/'
.
$flag
->
getObjectPHID
().
'/'
,
'sigil'
=>
'workflow'
,
),
phutil_tag
(
'button'
,
array
(
'class'
=>
'small grey'
,
),
'Edit Flag'
)),
phabricator_render_form
(
$user
,
array
(
'method'
=>
'POST'
,
'action'
=>
'/flag/delete/'
.
$flag
->
getID
().
'/'
,
'sigil'
=>
'workflow'
,
),
phutil_tag
(
'button'
,
array
(
'class'
=>
'small grey'
,
),
'Remove Flag'
)),
);
}
$table
=
new
AphrontTableView
(
$rows
);
$table
->
setHeaders
(
array
(
''
,
'Flagged Object'
,
'Note'
,
'Flagged On'
,
''
,
''
,
));
$table
->
setColumnClasses
(
array
(
'narrow'
,
'wrap pri'
,
'wrap'
,
'narrow'
,
'narrow action'
,
'narrow action'
,
));
$table
->
setNoDataString
(
'No flags.'
);
return
$table
->
render
();
}
}
Event Timeline
Log In to Comment