Differential D20358 Diff 48609 src/applications/project/menuitem/PhabricatorProjectPictureProfileMenuItem.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/project/menuitem/PhabricatorProjectPictureProfileMenuItem.php
Show All 26 Lines | public function getDisplayName( | ||||
return $this->getDefaultName(); | return $this->getDefaultName(); | ||||
} | } | ||||
public function buildEditEngineFields( | public function buildEditEngineFields( | ||||
PhabricatorProfileMenuItemConfiguration $config) { | PhabricatorProfileMenuItemConfiguration $config) { | ||||
return array(); | return array(); | ||||
} | } | ||||
protected function newNavigationMenuItems( | protected function newMenuItemViewList( | ||||
PhabricatorProfileMenuItemConfiguration $config) { | PhabricatorProfileMenuItemConfiguration $config) { | ||||
$project = $config->getProfileObject(); | $project = $config->getProfileObject(); | ||||
require_celerity_resource('people-picture-menu-item-css'); | |||||
$picture = $project->getProfileImageURI(); | $picture = $project->getProfileImageURI(); | ||||
$href = $project->getProfileURI(); | |||||
$classes = array(); | $item = $this->newItemView() | ||||
$classes[] = 'people-menu-image'; | ->setDisabled($project->isArchived()); | ||||
if ($project->isArchived()) { | |||||
$classes[] = 'phui-image-disabled'; | |||||
} | |||||
$photo = phutil_tag( | |||||
'img', | |||||
array( | |||||
'src' => $picture, | |||||
'class' => implode(' ', $classes), | |||||
)); | |||||
$view = phutil_tag_div('people-menu-image-container', $photo); | |||||
$view = phutil_tag( | |||||
'a', | |||||
array( | |||||
'href' => $href, | |||||
), | |||||
$view); | |||||
$item = $this->newItem() | $item->newProfileImage($picture); | ||||
->appendChild($view); | |||||
return array( | return array( | ||||
$item, | $item, | ||||
); | ); | ||||
} | } | ||||
} | } |