Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F97950646
PhabricatorPeopleMainMenuBarExtension.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
Tue, Jan 7, 21:51
Size
1 KB
Mime Type
text/x-php
Expires
Thu, Jan 9, 21:51 (2 d)
Engine
blob
Format
Raw Data
Handle
23451914
Attached To
rPH Phabricator
PhabricatorPeopleMainMenuBarExtension.php
View Options
<?php
final
class
PhabricatorPeopleMainMenuBarExtension
extends
PhabricatorMainMenuBarExtension
{
const
MAINMENUBARKEY
=
'people'
;
public
function
buildMainMenus
()
{
$viewer
=
$this
->
getViewer
();
// TODO: This should get cached.
$profile
=
id
(
new
PhabricatorPeopleQuery
())
->
setViewer
(
$viewer
)
->
needProfileImage
(
true
)
->
withPHIDs
(
array
(
$viewer
->
getPHID
()))
->
executeOne
();
$image
=
$profile
->
getProfileImageURI
();
$bar_item
=
id
(
new
PHUIListItemView
())
->
setName
(
$viewer
->
getUsername
())
->
setHref
(
'/p/'
.
$viewer
->
getUsername
().
'/'
)
->
addClass
(
'core-menu-item'
)
->
setAural
(
pht
(
'Profile'
));
$classes
=
array
(
'phabricator-core-menu-icon'
,
'phabricator-core-menu-profile-image'
,
);
$bar_item
->
appendChild
(
phutil_tag
(
'span'
,
array
(
'class'
=>
implode
(
' '
,
$classes
),
'style'
=>
'background-image: url('
.
$image
.
')'
,
),
''
));
$profile_menu
=
id
(
new
PHUIMainMenuView
())
->
setOrder
(
100
)
->
setMenuBarItem
(
$bar_item
);
return
array
(
$profile_menu
,
);
}
}
Event Timeline
Log In to Comment