Changeset View
Changeset View
Standalone View
Standalone View
src/applications/search/engine/PhabricatorProfileMenuEngine.php
Show First 20 Lines • Show All 551 Lines • ▼ Show 20 Lines | private function buildItemConfigureContent(array $items) { | ||||
$object = $this->getProfileObject(); | $object = $this->getProfileObject(); | ||||
$filtered_groups = mgroup($items, 'getMenuItemKey'); | $filtered_groups = mgroup($items, 'getMenuItemKey'); | ||||
foreach ($filtered_groups as $group) { | foreach ($filtered_groups as $group) { | ||||
$first_item = head($group); | $first_item = head($group); | ||||
$first_item->willBuildNavigationItems($group); | $first_item->willBuildNavigationItems($group); | ||||
} | } | ||||
// Users only need to be able to edit the object which this menu appears | |||||
// on if they're editing global menu items. For example, users do not need | |||||
// to be able to edit the Favorites application to add new items to the | |||||
// Favorites menu. | |||||
if (!$this->getCustomPHID()) { | |||||
PhabricatorPolicyFilter::requireCapability( | PhabricatorPolicyFilter::requireCapability( | ||||
$viewer, | $viewer, | ||||
$object, | $object, | ||||
PhabricatorPolicyCapability::CAN_EDIT); | PhabricatorPolicyCapability::CAN_EDIT); | ||||
} | |||||
$list_id = celerity_generate_unique_node_id(); | $list_id = celerity_generate_unique_node_id(); | ||||
Javelin::initBehavior( | Javelin::initBehavior( | ||||
'reorder-profile-menu-items', | 'reorder-profile-menu-items', | ||||
array( | array( | ||||
'listID' => $list_id, | 'listID' => $list_id, | ||||
'orderURI' => $this->getItemURI('reorder/'), | 'orderURI' => $this->getItemURI('reorder/'), | ||||
▲ Show 20 Lines • Show All 490 Lines • Show Last 20 Lines |