Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F123433399
PholioMockListController.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
Sun, Jul 27, 09:19
Size
1 KB
Mime Type
text/x-php
Expires
Tue, Jul 29, 09:19 (2 d)
Engine
blob
Format
Raw Data
Handle
27637620
Attached To
rPH Phabricator
PholioMockListController.php
View Options
<?php
/**
* @group pholio
*/
final
class
PholioMockListController
extends
PholioController
{
private
$view
;
public
function
willProcessRequest
(
array
$data
)
{
$this
->
view
=
idx
(
$data
,
'view'
);
}
public
function
processRequest
()
{
$request
=
$this
->
getRequest
();
$user
=
$request
->
getUser
();
$query
=
id
(
new
PholioMockQuery
())
->
setViewer
(
$user
);
$nav
=
$this
->
buildSideNav
();
$filter
=
$nav
->
selectFilter
(
'view/'
.
$this
->
view
,
'view/all'
);
switch
(
$filter
)
{
case
'view/all'
:
default
:
$title
=
'All Mocks'
;
break
;
}
$pager
=
new
AphrontCursorPagerView
();
$pager
->
readFromRequest
(
$request
);
$mocks
=
$query
->
executeWithCursorPager
(
$pager
);
$board
=
new
PhabricatorPinboardView
();
foreach
(
$mocks
as
$mock
)
{
$board
->
addItem
(
id
(
new
PhabricatorPinboardItemView
())
->
setHeader
(
$mock
->
getName
())
->
setURI
(
'/M'
.
$mock
->
getID
()));
}
$header
=
id
(
new
PhabricatorHeaderView
())
->
setHeader
(
$title
);
$content
=
array
(
$header
,
$board
,
$pager
,
);
$nav
->
appendChild
(
$content
);
return
$this
->
buildApplicationPage
(
$nav
,
array
(
'title'
=>
$title
,
));
}
}
Event Timeline
Log In to Comment