Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93591040
PhortuneMerchantProfileController.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, Nov 30, 00:04
Size
2 KB
Mime Type
text/x-php
Expires
Mon, Dec 2, 00:04 (2 d)
Engine
blob
Format
Raw Data
Handle
22670024
Attached To
rPH Phabricator
PhortuneMerchantProfileController.php
View Options
<?php
abstract
class
PhortuneMerchantProfileController
extends
PhortuneController
{
private
$merchant
;
public
function
setMerchant
(
PhortuneMerchant
$merchant
)
{
$this
->
merchant
=
$merchant
;
return
$this
;
}
public
function
getMerchant
()
{
return
$this
->
merchant
;
}
public
function
buildApplicationMenu
()
{
return
$this
->
buildSideNavView
()->
getMenu
();
}
protected
function
buildHeaderView
()
{
$viewer
=
$this
->
getViewer
();
$merchant
=
$this
->
getMerchant
();
$title
=
$merchant
->
getName
();
$header
=
id
(
new
PHUIHeaderView
())
->
setHeader
(
$title
)
->
setUser
(
$viewer
)
->
setPolicyObject
(
$merchant
)
->
setImage
(
$merchant
->
getProfileImageURI
());
return
$header
;
}
protected
function
buildApplicationCrumbs
()
{
$merchant
=
$this
->
getMerchant
();
$id
=
$merchant
->
getID
();
$merchant_uri
=
$this
->
getApplicationURI
(
"/merchant/{$id}/"
);
$crumbs
=
parent
::
buildApplicationCrumbs
();
$crumbs
->
addTextCrumb
(
$merchant
->
getName
(),
$merchant_uri
);
$crumbs
->
setBorder
(
true
);
return
$crumbs
;
}
protected
function
buildSideNavView
(
$filter
=
null
)
{
$viewer
=
$this
->
getViewer
();
$merchant
=
$this
->
getMerchant
();
$id
=
$merchant
->
getID
();
$can_edit
=
PhabricatorPolicyFilter
::
hasCapability
(
$viewer
,
$merchant
,
PhabricatorPolicyCapability
::
CAN_EDIT
);
$nav
=
id
(
new
AphrontSideNavFilterView
())
->
setBaseURI
(
new
PhutilURI
(
$this
->
getApplicationURI
()));
$nav
->
addLabel
(
pht
(
'Merchant'
));
$nav
->
addFilter
(
'overview'
,
pht
(
'Overview'
),
$this
->
getApplicationURI
(
"/merchant/{$id}/"
),
'fa-building-o'
);
if
(
$can_edit
)
{
$nav
->
addFilter
(
'orders'
,
pht
(
'Orders'
),
$this
->
getApplicationURI
(
"merchant/orders/{$id}/"
),
'fa-retweet'
);
$nav
->
addFilter
(
'subscriptions'
,
pht
(
'Subscriptions'
),
$this
->
getApplicationURI
(
"merchant/{$id}/subscription/"
),
'fa-shopping-cart'
);
$nav
->
addFilter
(
'managers'
,
pht
(
'Managers'
),
$this
->
getApplicationURI
(
"/merchant/manager/{$id}/"
),
'fa-group'
);
}
$nav
->
selectFilter
(
$filter
);
return
$nav
;
}
}
Event Timeline
Log In to Comment