1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-02 19:52:44 +01:00
phorge-phorge/src/applications/project/profilepanel/PhabricatorProjectMembersProfilePanel.php
epriestley 468031d1fd Rough initial cut of profile new profile menu
Summary:
Ref T10054. I haven't done any of the big-picture layout stuff yet, but this should get look-and-feel somewhere in the ballpark of reasonablness, I think.

Major missing stuff:

  - No "collapse" state or action yet.
  - Menu is not full-height (requires changes to the rendering pipeline).

Test Plan: {F1060941}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10054

Differential Revision: https://secure.phabricator.com/D15016
2016-01-15 09:12:09 -08:00

59 lines
1.2 KiB
PHP

<?php
final class PhabricatorProjectMembersProfilePanel
extends PhabricatorProfilePanel {
const PANELKEY = 'project.members';
public function getPanelTypeName() {
return pht('Project Members');
}
private function getDefaultName() {
return pht('Members');
}
public function getDisplayName(
PhabricatorProfilePanelConfiguration $config) {
$name = $config->getPanelProperty('name');
if (strlen($name)) {
return $name;
}
return $this->getDefaultName();
}
public function buildEditEngineFields(
PhabricatorProfilePanelConfiguration $config) {
return array(
id(new PhabricatorTextEditField())
->setKey('name')
->setLabel(pht('Name'))
->setPlaceholder($this->getDefaultName())
->setValue($config->getPanelProperty('name')),
);
}
protected function newNavigationMenuItems(
PhabricatorProfilePanelConfiguration $config) {
$project = $config->getProfileObject();
$id = $project->getID();
$name = $this->getDisplayName($config);
$icon = 'fa-group';
$href = "/project/members/{$id}/";
$item = $this->newItem()
->setHref($href)
->setName($name)
->setIcon($icon);
return array(
$item,
);
}
}