Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92654283
PhabricatorPeopleProfileMenuEngine.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
Fri, Nov 22, 10:34
Size
2 KB
Mime Type
text/x-php
Expires
Sun, Nov 24, 10:34 (1 d, 18 h)
Engine
blob
Format
Raw Data
Handle
22479321
Attached To
rPH Phabricator
PhabricatorPeopleProfileMenuEngine.php
View Options
<?php
final
class
PhabricatorPeopleProfileMenuEngine
extends
PhabricatorProfileMenuEngine
{
const
ITEM_PROFILE
=
'people.profile'
;
const
ITEM_MANAGE
=
'people.manage'
;
const
ITEM_PICTURE
=
'people.picture'
;
const
ITEM_BADGES
=
'people.badges'
;
const
ITEM_TASKS
=
'people.tasks'
;
const
ITEM_COMMITS
=
'people.commits'
;
const
ITEM_REVISIONS
=
'people.revisions'
;
protected
function
isMenuEngineConfigurable
()
{
return
false
;
}
public
function
getItemURI
(
$path
)
{
$user
=
$this
->
getProfileObject
();
$username
=
$user
->
getUsername
();
$username
=
phutil_escape_uri
(
$username
);
return
"/p/{$username}/item/{$path}"
;
}
protected
function
getBuiltinProfileItems
(
$object
)
{
$viewer
=
$this
->
getViewer
();
$items
=
array
();
$items
[]
=
$this
->
newItem
()
->
setBuiltinKey
(
self
::
ITEM_PICTURE
)
->
setMenuItemKey
(
PhabricatorPeoplePictureProfileMenuItem
::
MENUITEMKEY
);
$items
[]
=
$this
->
newItem
()
->
setBuiltinKey
(
self
::
ITEM_PROFILE
)
->
setMenuItemKey
(
PhabricatorPeopleDetailsProfileMenuItem
::
MENUITEMKEY
);
$have_badges
=
PhabricatorApplication
::
isClassInstalledForViewer
(
'PhabricatorBadgesApplication'
,
<<<<<<<
HEAD
$viewer
);
if
(
$have_badges
)
{
$items
[]
=
$this
->
newItem
()
->
setBuiltinKey
(
self
::
ITEM_BADGES
)
->
setMenuItemKey
(
PhabricatorPeopleBadgesProfileMenuItem
::
MENUITEMKEY
);
=======
$viewer
);
if
(
$have_badges
)
{
$items
[]
=
$this
->
newItem
()
->
setBuiltinKey
(
self
::
ITEM_BADGES
)
->
setMenuItemKey
(
PhabricatorPeopleBadgesProfileMenuItem
::
MENUITEMKEY
);
}
$have_maniphest
=
PhabricatorApplication
::
isClassInstalledForViewer
(
'PhabricatorManiphestApplication'
,
$viewer
);
if
(
$have_maniphest
)
{
$items
[]
=
$this
->
newItem
()
->
setBuiltinKey
(
self
::
ITEM_TASKS
)
->
setMenuItemKey
(
PhabricatorPeopleTasksProfileMenuItem
::
MENUITEMKEY
);
>>>>>>>
upstream
/
stable
}
$have_maniphest
=
PhabricatorApplication
::
isClassInstalledForViewer
(
'PhabricatorManiphestApplication'
,
$viewer
);
<<<<<<<
HEAD
if
(
$have_maniphest
)
{
$items
[]
=
$this
->
newItem
()
->
setBuiltinKey
(
self
::
ITEM_TASKS
)
->
setMenuItemKey
(
PhabricatorPeopleTasksProfileMenuItem
::
MENUITEMKEY
);
=======
if
(
$have_differential
)
{
$items
[]
=
$this
->
newItem
()
->
setBuiltinKey
(
self
::
ITEM_REVISIONS
)
->
setMenuItemKey
(
PhabricatorPeopleRevisionsProfileMenuItem
::
MENUITEMKEY
);
>>>>>>>
upstream
/
stable
}
$have_diffusion
=
PhabricatorApplication
::
isClassInstalledForViewer
(
'PhabricatorDiffusionApplication'
,
$viewer
);
if
(
$have_diffusion
)
{
$items
[]
=
$this
->
newItem
()
->
setBuiltinKey
(
self
::
ITEM_COMMITS
)
->
setMenuItemKey
(
PhabricatorPeopleCommitsProfileMenuItem
::
MENUITEMKEY
);
}
$items
[]
=
$this
->
newItem
()
->
setBuiltinKey
(
self
::
ITEM_MANAGE
)
->
setMenuItemKey
(
PhabricatorPeopleManageProfileMenuItem
::
MENUITEMKEY
);
return
$items
;
}
}
Event Timeline
Log In to Comment