Changeset View
Changeset View
Standalone View
Standalone View
src/applications/conpherence/controller/ConpherenceController.php
Show First 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | abstract class ConpherenceController extends PhabricatorController { | ||||
protected function buildHeaderPaneContent( | protected function buildHeaderPaneContent( | ||||
ConpherenceThread $conpherence) { | ConpherenceThread $conpherence) { | ||||
$viewer = $this->getViewer(); | $viewer = $this->getViewer(); | ||||
$header = null; | $header = null; | ||||
if ($conpherence->getID()) { | if ($conpherence->getID()) { | ||||
$data = $conpherence->getDisplayData($this->getViewer()); | $data = $conpherence->getDisplayData($this->getViewer()); | ||||
$topic = id(new PHUITagView()) | |||||
->setName($data['topic']) | |||||
->setShade(PHUITagView::COLOR_VIOLET) | |||||
->setType(PHUITagView::TYPE_SHADE) | |||||
->addClass('conpherence-header-topic'); | |||||
$header = id(new PHUIHeaderView()) | $header = id(new PHUIHeaderView()) | ||||
->setViewer($viewer) | ->setViewer($viewer) | ||||
->setHeader($data['title']) | ->setHeader($data['title']) | ||||
->addTag($topic) | |||||
->setPolicyObject($conpherence) | ->setPolicyObject($conpherence) | ||||
->setImage($data['image']); | ->setImage($data['image']); | ||||
if (strlen($data['topic'])) { | |||||
epriestley: Excellent! | |||||
$topic = id(new PHUITagView()) | |||||
->setName($data['topic']) | |||||
->setShade(PHUITagView::COLOR_VIOLET) | |||||
->setType(PHUITagView::TYPE_SHADE) | |||||
->addClass('conpherence-header-topic'); | |||||
$header->addTag($topic); | |||||
} | |||||
$can_edit = PhabricatorPolicyFilter::hasCapability( | $can_edit = PhabricatorPolicyFilter::hasCapability( | ||||
$viewer, | $viewer, | ||||
$conpherence, | $conpherence, | ||||
PhabricatorPolicyCapability::CAN_EDIT); | PhabricatorPolicyCapability::CAN_EDIT); | ||||
if ($can_edit) { | if ($can_edit) { | ||||
$header->setImageURL( | $header->setImageURL( | ||||
$this->getApplicationURI('picture/'.$conpherence->getID().'/')); | $this->getApplicationURI('picture/'.$conpherence->getID().'/')); | ||||
▲ Show 20 Lines • Show All 144 Lines • Show Last 20 Lines |
Excellent!