Differential D20010 Diff 47774 src/applications/auth/controller/contact/PhabricatorAuthContactNumberViewController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/auth/controller/contact/PhabricatorAuthContactNumberViewController.php
Show First 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | final class PhabricatorAuthContactNumberViewController | ||||
private function buildHeaderView(PhabricatorAuthContactNumber $number) { | private function buildHeaderView(PhabricatorAuthContactNumber $number) { | ||||
$viewer = $this->getViewer(); | $viewer = $this->getViewer(); | ||||
$view = id(new PHUIHeaderView()) | $view = id(new PHUIHeaderView()) | ||||
->setViewer($viewer) | ->setViewer($viewer) | ||||
->setHeader($number->getObjectName()) | ->setHeader($number->getObjectName()) | ||||
->setPolicyObject($number); | ->setPolicyObject($number); | ||||
if ($number->isDisabled()) { | |||||
$view->setStatus('fa-ban', 'red', pht('Disabled')); | |||||
} | |||||
return $view; | return $view; | ||||
} | } | ||||
private function buildPropertiesView( | private function buildPropertiesView( | ||||
PhabricatorAuthContactNumber $number) { | PhabricatorAuthContactNumber $number) { | ||||
$viewer = $this->getViewer(); | $viewer = $this->getViewer(); | ||||
$view = id(new PHUIPropertyListView()) | $view = id(new PHUIPropertyListView()) | ||||
Show All 22 Lines | private function buildCurtain(PhabricatorAuthContactNumber $number) { | ||||
$curtain->addAction( | $curtain->addAction( | ||||
id(new PhabricatorActionView()) | id(new PhabricatorActionView()) | ||||
->setName(pht('Edit Contact Number')) | ->setName(pht('Edit Contact Number')) | ||||
->setIcon('fa-pencil') | ->setIcon('fa-pencil') | ||||
->setHref($this->getApplicationURI("contact/edit/{$id}/")) | ->setHref($this->getApplicationURI("contact/edit/{$id}/")) | ||||
->setDisabled(!$can_edit) | ->setDisabled(!$can_edit) | ||||
->setWorkflow(!$can_edit)); | ->setWorkflow(!$can_edit)); | ||||
if ($number->isDisabled()) { | |||||
$disable_uri = $this->getApplicationURI("contact/enable/{$id}/"); | |||||
$disable_name = pht('Enable Contact Number'); | |||||
$disable_icon = 'fa-check'; | |||||
} else { | |||||
$disable_uri = $this->getApplicationURI("contact/disable/{$id}/"); | |||||
$disable_name = pht('Disable Contact Number'); | |||||
$disable_icon = 'fa-ban'; | |||||
} | |||||
$curtain->addAction( | |||||
id(new PhabricatorActionView()) | |||||
->setName($disable_name) | |||||
->setIcon($disable_icon) | |||||
->setHref($disable_uri) | |||||
->setWorkflow(true)); | |||||
return $curtain; | return $curtain; | ||||
} | } | ||||
} | } |