Page MenuHomec4science

PhabricatorProjectProfileMenuEngine.php
No OneTemporary

File Metadata

Created
Sat, Oct 19, 21:04

PhabricatorProjectProfileMenuEngine.php

<?php
final class PhabricatorProjectProfileMenuEngine
extends PhabricatorProfileMenuEngine {
protected function isMenuEngineConfigurable() {
return true;
}
public function getItemURI($path) {
$project = $this->getProfileObject();
$id = $project->getID();
return "/project/{$id}/item/{$path}";
}
protected function getBuiltinProfileItems($object) {
$items = array();
$items[] = $this->newItem()
->setBuiltinKey(PhabricatorProject::ITEM_PROFILE)
->setMenuItemKey(PhabricatorProjectDetailsProfileMenuItem::MENUITEMKEY);
$items[] = $this->newItem()
->setBuiltinKey(PhabricatorProject::ITEM_POINTS)
->setMenuItemKey(PhabricatorProjectPointsProfileMenuItem::MENUITEMKEY);
$items[] = $this->newItem()
->setBuiltinKey(PhabricatorProject::ITEM_WORKBOARD)
->setMenuItemKey(PhabricatorProjectWorkboardProfileMenuItem::MENUITEMKEY)
->setVisibility(PhabricatorProfileMenuItemConfiguration::VISIBILITY_DISABLED);
$items[] = $this->newItem()
->setBuiltinKey(PhabricatorProject::ITEM_MEMBERS)
->setMenuItemKey(PhabricatorProjectMembersProfileMenuItem::MENUITEMKEY);
$items[] = $this->newItem()
->setBuiltinKey(PhabricatorProject::ITEM_SUBPROJECTS)
->setMenuItemKey(
PhabricatorProjectSubprojectsProfileMenuItem::MENUITEMKEY)
->setVisibility(PhabricatorProfileMenuItemConfiguration::VISIBILITY_DISABLED);
$project = $this->getProfileObject();
$items[] = $this->newItem()
->setBuiltinKey('project.repo')
->setMenuItemKey(PhabricatorLinkProfileMenuItem::MENUITEMKEY)
->setMenuItemProperty('icon', 'diffusion')
->setMenuItemProperty('name', pht('Repositories'))
->setMenuItemProperty('uri', '/diffusion/?status=open&projectPHIDs='
. $project->getPHID() . '#R');
$items[] = $this->newItem()
->setBuiltinKey(PhabricatorProjectWikiProfileMenuItem::MENUITEM_WIKI)
->setMenuItemKey(PhabricatorProjectWikiProfileMenuItem::MENUITEMKEY)
->setVisibility(PhabricatorProfileMenuItemConfiguration::VISIBILITY_DISABLED);
$items[] = $this->newItem()
->setBuiltinKey(PhabricatorProject::ITEM_MANAGE)
->setMenuItemKey(PhabricatorProjectManageProfileMenuItem::MENUITEMKEY);
return $items;
}
}

Event Timeline