Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F455592
PhabricatorHomeProfileMenuEngine.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
PhabricatorHomeProfileMenuEngine.php
View Options
<?php
final
class
PhabricatorHomeProfileMenuEngine
extends
PhabricatorProfileMenuEngine
{
protected
function
isMenuEngineConfigurable
()
{
return
true
;
}
public
function
getItemURI
(
$path
)
{
$object
=
$this
->
getProfileObject
();
$custom
=
$this
->
getCustomPHID
();
if
(
$custom
)
{
return
"/home/menu/personal/item/{$path}"
;
}
else
{
return
"/home/menu/global/item/{$path}"
;
}
}
protected
function
getBuiltinProfileItems
(
$object
)
{
$viewer
=
$this
->
getViewer
();
$items
=
array
();
$custom_phid
=
$this
->
getCustomPHID
();
$applications
=
id
(
new
PhabricatorApplicationQuery
())
->
setViewer
(
$viewer
)
->
withInstalled
(
true
)
->
withUnlisted
(
false
)
->
withLaunchable
(
true
)
->
execute
();
// Default Home Dashboard
$items
[]
=
$this
->
newItem
()
->
setBuiltinKey
(
PhabricatorHomeConstants
::
ITEM_HOME
)
->
setMenuItemKey
(
PhabricatorHomeProfileMenuItem
::
MENUITEMKEY
);
foreach
(
$applications
as
$application
)
{
if
(!
$application
->
isPinnedByDefault
(
$viewer
))
{
continue
;
}
$properties
=
array
(
'name'
=>
$application
->
getName
(),
'application'
=>
$application
->
getPHID
(),
);
$items
[]
=
$this
->
newItem
()
->
setBuiltinKey
(
$application
->
getPHID
())
->
setMenuItemKey
(
PhabricatorApplicationProfileMenuItem
::
MENUITEMKEY
)
->
setMenuItemProperties
(
$properties
);
}
// Hotlink to More Applications Launcher...
$items
[]
=
$this
->
newItem
()
->
setBuiltinKey
(
PhabricatorHomeConstants
::
ITEM_LAUNCHER
)
->
setMenuItemKey
(
PhabricatorHomeLauncherProfileMenuItem
::
MENUITEMKEY
);
// Single Manage Item, switches URI based on admin/user
$items
[]
=
$this
->
newItem
()
->
setBuiltinKey
(
PhabricatorHomeConstants
::
ITEM_MANAGE
)
->
setMenuItemKey
(
PhabricatorHomeManageProfileMenuItem
::
MENUITEMKEY
);
return
$items
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 5, 7:06 AM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
69848
Default Alt Text
PhabricatorHomeProfileMenuEngine.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment