Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F122049935
PhabricatorCountdownListController.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, Jul 15, 11:57
Size
2 KB
Mime Type
text/x-php
Expires
Thu, Jul 17, 11:57 (2 d)
Engine
blob
Format
Raw Data
Handle
27427810
Attached To
rPH Phabricator
PhabricatorCountdownListController.php
View Options
<?php
/**
* @group countdown
*/
final
class
PhabricatorCountdownListController
extends
PhabricatorCountdownController
{
public
function
processRequest
()
{
$request
=
$this
->
getRequest
();
$user
=
$request
->
getUser
();
$pager
=
new
AphrontCursorPagerView
();
$pager
->
readFromRequest
(
$request
);
$query
=
id
(
new
CountdownQuery
())
->
setViewer
(
$user
);
$countdowns
=
$query
->
executeWithCursorPager
(
$pager
);
$phids
=
mpull
(
$countdowns
,
'getAuthorPHID'
);
$handles
=
$this
->
loadViewerHandles
(
$phids
);
$rows
=
array
();
foreach
(
$countdowns
as
$timer
)
{
$edit_button
=
null
;
$delete_button
=
null
;
if
(
$user
->
getIsAdmin
()
||
(
$user
->
getPHID
()
==
$timer
->
getAuthorPHID
()))
{
$edit_button
=
phutil_tag
(
'a'
,
array
(
'class'
=>
'small button grey'
,
'href'
=>
'/countdown/edit/'
.
$timer
->
getID
().
'/'
),
pht
(
'Edit'
));
$delete_button
=
javelin_tag
(
'a'
,
array
(
'class'
=>
'small button grey'
,
'href'
=>
'/countdown/delete/'
.
$timer
->
getID
().
'/'
,
'sigil'
=>
'workflow'
),
pht
(
'Delete'
));
}
$rows
[]
=
array
(
$timer
->
getID
(),
$handles
[
$timer
->
getAuthorPHID
()]->
renderLink
(),
phutil_tag
(
'a'
,
array
(
'href'
=>
'/countdown/'
.
$timer
->
getID
().
'/'
,
),
$timer
->
getTitle
()),
phabricator_datetime
(
$timer
->
getEpoch
(),
$user
),
$edit_button
,
$delete_button
,
);
}
$table
=
new
AphrontTableView
(
$rows
);
$table
->
setHeaders
(
array
(
pht
(
'ID'
),
pht
(
'Author'
),
pht
(
'Title'
),
pht
(
'End Date'
),
''
,
''
));
$table
->
setColumnClasses
(
array
(
null
,
null
,
'wide pri'
,
null
,
'action'
,
'action'
,
));
$panel
=
id
(
new
AphrontPanelView
())
->
appendChild
(
$table
)
->
setHeader
(
pht
(
'Countdowns'
))
->
setNoBackground
()
->
appendChild
(
$pager
);
$crumbs
=
$this
->
buildApplicationCrumbs
()
->
addCrumb
(
id
(
new
PhabricatorCrumbView
())
->
setName
(
pht
(
'All Countdowns'
))
->
setHref
(
$this
->
getApplicationURI
()));
return
$this
->
buildApplicationPage
(
array
(
$crumbs
,
$panel
),
array
(
'title'
=>
pht
(
'Countdown'
),
'device'
=>
true
,
));
}
}
Event Timeline
Log In to Comment