Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F91029052
PhabricatorFavoritesMainController.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, Nov 7, 02:21
Size
1 KB
Mime Type
text/x-php
Expires
Sat, Nov 9, 02:21 (2 d)
Engine
blob
Format
Raw Data
Handle
22180717
Attached To
rPH Phabricator
PhabricatorFavoritesMainController.php
View Options
<?php
final
class
PhabricatorFavoritesMainController
extends
PhabricatorFavoritesController
{
public
function
shouldAllowPublic
()
{
return
false
;
}
public
function
handleRequest
(
AphrontRequest
$request
)
{
$viewer
=
$request
->
getViewer
();
if
(!
$viewer
->
getIsAdmin
())
{
$uri
=
'/favorites/personal/item/configure/'
;
return
id
(
new
AphrontRedirectResponse
())->
setURI
(
$uri
);
}
$menu
=
id
(
new
PHUIObjectItemListView
())
->
setUser
(
$viewer
);
$menu
->
addItem
(
id
(
new
PHUIObjectItemView
())
->
setHeader
(
pht
(
'Personal Menu Items'
))
->
setHref
(
$this
->
getApplicationURI
(
'personal/item/configure/'
))
->
setImageURI
(
$viewer
->
getProfileImageURI
())
->
addAttribute
(
pht
(
'Edit favorites for your personal account.'
)));
$icon
=
id
(
new
PHUIIconView
())
->
setIcon
(
'fa-globe'
)
->
setBackground
(
'bg-blue'
);
$menu
->
addItem
(
id
(
new
PHUIObjectItemView
())
->
setHeader
(
pht
(
'Global Menu Items'
))
->
setHref
(
$this
->
getApplicationURI
(
'global/item/configure/'
))
->
setImageIcon
(
$icon
)
->
addAttribute
(
pht
(
'Edit global default favorites for all users.'
)));
$crumbs
=
$this
->
buildApplicationCrumbs
();
$crumbs
->
addTextCrumb
(
pht
(
'Manage'
));
$crumbs
->
setBorder
(
true
);
$box
=
id
(
new
PHUIObjectBoxView
())
->
setObjectList
(
$menu
);
$header
=
id
(
new
PHUIHeaderView
())
->
setHeader
(
pht
(
'Manage Favorites'
))
->
setHeaderIcon
(
'fa-star-o'
);
$view
=
id
(
new
PHUITwoColumnView
())
->
setHeader
(
$header
)
->
setFooter
(
array
(
$box
,
));
return
$this
->
newPage
()
->
setTitle
(
pht
(
'Manage'
))
->
setCrumbs
(
$crumbs
)
->
appendChild
(
$view
);
}
}
Event Timeline
Log In to Comment