Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F75289909
PhortuneChargeListController.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
Thu, Aug 1, 10:48
Size
1 KB
Mime Type
text/x-php
Expires
Sat, Aug 3, 10:48 (2 d)
Engine
blob
Format
Raw Data
Handle
19514665
Attached To
rPH Phabricator
PhortuneChargeListController.php
View Options
<?php
final
class
PhortuneChargeListController
extends
PhortuneController
{
private
$account
;
public
function
handleRequest
(
AphrontRequest
$request
)
{
$viewer
=
$request
->
getViewer
();
$querykey
=
$request
->
getURIData
(
'queryKey'
);
$account_id
=
$request
->
getURIData
(
'accountID'
);
$engine
=
new
PhortuneChargeSearchEngine
();
if
(
$account_id
)
{
$account
=
id
(
new
PhortuneAccountQuery
())
->
setViewer
(
$viewer
)
->
withIDs
(
array
(
$account_id
))
->
requireCapabilities
(
array
(
PhabricatorPolicyCapability
::
CAN_VIEW
,
PhabricatorPolicyCapability
::
CAN_EDIT
,
))
->
executeOne
();
if
(!
$account
)
{
return
new
Aphront404Response
();
}
$this
->
account
=
$account
;
$engine
->
setAccount
(
$account
);
}
else
{
return
new
Aphront404Response
();
}
$controller
=
id
(
new
PhabricatorApplicationSearchController
())
->
setQueryKey
(
$querykey
)
->
setSearchEngine
(
$engine
)
->
setNavigation
(
$this
->
buildSideNavView
());
return
$this
->
delegateToController
(
$controller
);
}
public
function
buildSideNavView
()
{
$viewer
=
$this
->
getViewer
();
$nav
=
new
AphrontSideNavFilterView
();
$nav
->
setBaseURI
(
new
PhutilURI
(
$this
->
getApplicationURI
()));
id
(
new
PhortuneChargeSearchEngine
())
->
setViewer
(
$viewer
)
->
addNavigationItems
(
$nav
->
getMenu
());
$nav
->
selectFilter
(
null
);
return
$nav
;
}
protected
function
buildApplicationCrumbs
()
{
$crumbs
=
parent
::
buildApplicationCrumbs
();
$account
=
$this
->
account
;
if
(
$account
)
{
$id
=
$account
->
getID
();
$crumbs
->
addTextCrumb
(
$account
->
getName
(),
$this
->
getApplicationURI
(
"{$id}/"
));
$crumbs
->
addTextCrumb
(
pht
(
'Charges'
),
$this
->
getApplicationURI
(
"{$id}/charge/"
));
}
return
$crumbs
;
}
}
Event Timeline
Log In to Comment