Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F121626866
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
Sat, Jul 12, 14:45
Size
1 KB
Mime Type
text/x-php
Expires
Mon, Jul 14, 14:45 (2 d)
Engine
blob
Format
Raw Data
Handle
27361816
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