Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F98040472
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
Wed, Jan 8, 23:53
Size
1 KB
Mime Type
text/x-php
Expires
Fri, Jan 10, 23:53 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23500410
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