Page MenuHomePhorge

PhabricatorPeopleDetailsProfileMenuItem.php
No OneTemporary

PhabricatorPeopleDetailsProfileMenuItem.php

<?php
final class PhabricatorPeopleDetailsProfileMenuItem
extends PhabricatorProfileMenuItem {
const MENUITEMKEY = 'people.details';
public function getMenuItemTypeName() {
return pht('User Details');
}
private function getDefaultName() {
return pht('User Details');
}
public function getDisplayName(
PhabricatorProfileMenuItemConfiguration $config) {
$name = $config->getMenuItemProperty('name');
if (strlen($name)) {
return $name;
}
return $this->getDefaultName();
}
public function buildEditEngineFields(
PhabricatorProfileMenuItemConfiguration $config) {
return array(
id(new PhabricatorTextEditField())
->setKey('name')
->setLabel(pht('Name'))
->setPlaceholder($this->getDefaultName())
->setValue($config->getMenuProperty('name')),
);
}
protected function newMenuItemViewList(
PhabricatorProfileMenuItemConfiguration $config) {
$user = $config->getProfileObject();
$uri = urisprintf(
'/p/%s/',
$user->getUsername());
$item = $this->newItemView()
->setURI($uri)
->setName(pht('Profile'))
->setIcon('fa-user');
return array(
$item,
);
}
}

File Metadata

Mime Type
text/x-php
Expires
Sun, Jan 19, 13:31 (3 w, 3 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1125086
Default Alt Text
PhabricatorPeopleDetailsProfileMenuItem.php (1 KB)

Event Timeline