Differential D21863 Diff 52118 src/applications/search/menuitem/PhabricatorConpherenceProfileMenuItem.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/search/menuitem/PhabricatorConpherenceProfileMenuItem.php
Show First 20 Lines • Show All 63 Lines • ▼ Show 20 Lines | final class PhabricatorConpherenceProfileMenuItem | ||||
public function getDisplayName( | public function getDisplayName( | ||||
PhabricatorProfileMenuItemConfiguration $config) { | PhabricatorProfileMenuItemConfiguration $config) { | ||||
$room = $this->getConpherence($config); | $room = $this->getConpherence($config); | ||||
if (!$room) { | if (!$room) { | ||||
return pht('(Restricted/Invalid Conpherence)'); | return pht('(Restricted/Invalid Conpherence)'); | ||||
} | } | ||||
$name = $this->getName($config); | $default = $room->getTitle(); | ||||
if (strlen($name)) { | return $this->getNameFromConfig($config, $default); | ||||
return $name; | |||||
} | |||||
return $room->getTitle(); | |||||
} | } | ||||
public function buildEditEngineFields( | public function buildEditEngineFields( | ||||
PhabricatorProfileMenuItemConfiguration $config) { | PhabricatorProfileMenuItemConfiguration $config) { | ||||
return array( | return array( | ||||
id(new PhabricatorDatasourceEditField()) | id(new PhabricatorDatasourceEditField()) | ||||
->setKey(self::FIELD_CONPHERENCE) | ->setKey(self::FIELD_CONPHERENCE) | ||||
->setLabel(pht('Conpherence Room')) | ->setLabel(pht('Conpherence Room')) | ||||
->setDatasource(new ConpherenceThreadDatasource()) | ->setDatasource(new ConpherenceThreadDatasource()) | ||||
->setIsRequired(true) | ->setIsRequired(true) | ||||
->setSingleValue($config->getMenuItemProperty('conpherence')), | ->setSingleValue($config->getMenuItemProperty('conpherence')), | ||||
id(new PhabricatorTextEditField()) | id(new PhabricatorTextEditField()) | ||||
->setKey('name') | ->setKey('name') | ||||
->setLabel(pht('Name')) | ->setLabel(pht('Name')) | ||||
->setValue($this->getName($config)), | ->setValue($this->getNameFromConfig($config)), | ||||
); | ); | ||||
} | } | ||||
private function getName( | |||||
PhabricatorProfileMenuItemConfiguration $config) { | |||||
return $config->getMenuItemProperty('name'); | |||||
} | |||||
protected function newMenuItemViewList( | protected function newMenuItemViewList( | ||||
PhabricatorProfileMenuItemConfiguration $config) { | PhabricatorProfileMenuItemConfiguration $config) { | ||||
$viewer = $this->getViewer(); | $viewer = $this->getViewer(); | ||||
$room = $this->getConpherence($config); | $room = $this->getConpherence($config); | ||||
if (!$room) { | if (!$room) { | ||||
return array(); | return array(); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 68 Lines • Show Last 20 Lines |