Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F81449807
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
Fri, Sep 6, 03:23
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Sep 8, 03:23 (1 d, 22 h)
Engine
blob
Format
Raw Data
Handle
20569746
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_form
(
$user
,
array
(
'method'
=>
'POST'
,
'action'
=>
'/flag/edit/'
.
$flag
->
getObjectPHID
().
'/'
,
'sigil'
=>
'workflow'
,
),
phutil_tag
(
'button'
,
array
(
'class'
=>
'small grey'
,
),
'Edit Flag'
)),
phabricator_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