Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F97231747
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
Fri, Jan 3, 15:51
Size
2 KB
Mime Type
text/x-php
Expires
Sun, Jan 5, 15:51 (2 d)
Engine
blob
Format
Raw Data
Handle
23360307
Attached To
rPH Phabricator
PhabricatorCountdownListController.php
View Options
<?php
final
class
PhabricatorCountdownListController
extends
PhabricatorCountdownController
{
public
function
processRequest
()
{
$request
=
$this
->
getRequest
();
$user
=
$request
->
getUser
();
$pager
=
new
AphrontPagerView
();
$pager
->
setOffset
(
$request
->
getInt
(
'page'
));
$pager
->
setURI
(
$request
->
getRequestURI
(),
'page'
);
$timers
=
id
(
new
PhabricatorTimer
())->
loadAllWhere
(
'1 = 1 ORDER BY id DESC LIMIT %d, %d'
,
$pager
->
getOffset
(),
$pager
->
getPageSize
()
+
1
);
$timers
=
$pager
->
sliceResults
(
$timers
);
$phids
=
mpull
(
$timers
,
'getAuthorPHID'
);
$handles
=
$this
->
loadViewerHandles
(
$phids
);
$rows
=
array
();
foreach
(
$timers
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
().
'/'
),
'Edit'
);
$delete_button
=
javelin_tag
(
'a'
,
array
(
'class'
=>
'small button grey'
,
'href'
=>
'/countdown/delete/'
.
$timer
->
getID
().
'/'
,
'sigil'
=>
'workflow'
),
'Delete'
);
}
$rows
[]
=
array
(
$timer
->
getID
(),
$handles
[
$timer
->
getAuthorPHID
()]->
renderLink
(),
phutil_tag
(
'a'
,
array
(
'href'
=>
'/countdown/'
.
$timer
->
getID
().
'/'
,
),
$timer
->
getTitle
()),
phabricator_datetime
(
$timer
->
getDatepoint
(),
$user
),
$edit_button
,
$delete_button
,
);
}
$table
=
new
AphrontTableView
(
$rows
);
$table
->
setHeaders
(
array
(
'ID'
,
'Author'
,
'Title'
,
'End Date'
,
''
,
''
));
$table
->
setColumnClasses
(
array
(
null
,
null
,
'wide pri'
,
null
,
'action'
,
'action'
,
));
$panel
=
id
(
new
AphrontPanelView
())
->
appendChild
(
$table
)
->
setHeader
(
'Timers'
)
->
setCreateButton
(
'Create Timer'
,
'/countdown/edit/'
)
->
appendChild
(
$pager
);
return
$this
->
buildStandardPageResponse
(
$panel
,
array
(
'title'
=>
'Countdown'
,
));
}
}
Event Timeline
Log In to Comment