Changeset View
Changeset View
Standalone View
Standalone View
src/applications/conpherence/controller/ConpherenceController.php
Show First 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | public function buildApplicationMenu() { | ||||
return $nav; | return $nav; | ||||
} | } | ||||
protected function buildHeaderPaneContent( | protected function buildHeaderPaneContent( | ||||
ConpherenceThread $conpherence) { | ConpherenceThread $conpherence) { | ||||
$viewer = $this->getViewer(); | $viewer = $this->getViewer(); | ||||
$header = null; | $header = null; | ||||
$id = $conpherence->getID(); | |||||
if ($conpherence->getID()) { | if ($id) { | ||||
$data = $conpherence->getDisplayData($this->getViewer()); | $data = $conpherence->getDisplayData($this->getViewer()); | ||||
$header = id(new PHUIHeaderView()) | $header = id(new PHUIHeaderView()) | ||||
->setViewer($viewer) | ->setViewer($viewer) | ||||
->setHeader($data['title']) | ->setHeader($data['title']) | ||||
->setPolicyObject($conpherence) | ->setPolicyObject($conpherence) | ||||
->setImage($data['image']); | ->setImage($data['image']); | ||||
if (strlen($data['topic'])) { | if (strlen($data['topic'])) { | ||||
$topic = id(new PHUITagView()) | $topic = id(new PHUITagView()) | ||||
->setName($data['topic']) | ->setName($data['topic']) | ||||
->setShade(PHUITagView::COLOR_VIOLET) | ->setShade(PHUITagView::COLOR_VIOLET) | ||||
->setType(PHUITagView::TYPE_SHADE) | ->setType(PHUITagView::TYPE_SHADE) | ||||
->addClass('conpherence-header-topic'); | ->addClass('conpherence-header-topic'); | ||||
$header->addTag($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/{$id}/")); | ||||
} | } | ||||
$participating = $conpherence->getParticipantIfExists($viewer->getPHID()); | $participating = $conpherence->getParticipantIfExists($viewer->getPHID()); | ||||
$header->addActionItem( | $header->addActionItem( | ||||
id(new PHUIIconCircleView()) | id(new PHUIIconCircleView()) | ||||
->setHref( | ->setHref($this->getApplicationURI("update/{$id}/")) | ||||
$this->getApplicationURI('update/'.$conpherence->getID()).'/') | |||||
->setIcon('fa-pencil') | ->setIcon('fa-pencil') | ||||
->addClass('hide-on-device') | ->addClass('hide-on-device') | ||||
->setColor('violet') | ->setColor('violet') | ||||
->setWorkflow(true)); | ->setWorkflow(true)); | ||||
$header->addActionItem( | $header->addActionItem( | ||||
id(new PHUIIconCircleView()) | id(new PHUIIconCircleView()) | ||||
->setHref( | ->setHref($this->getApplicationURI("preferences/{$id}/")) | ||||
$this->getApplicationURI('update/'.$conpherence->getID()).'/'. | |||||
'?action='.ConpherenceUpdateActions::NOTIFICATIONS) | |||||
->setIcon('fa-gear') | ->setIcon('fa-gear') | ||||
->addClass('hide-on-device') | ->addClass('hide-on-device') | ||||
->setColor('pink') | ->setColor('pink') | ||||
->setWorkflow(true)); | ->setWorkflow(true)); | ||||
$widget_key = PhabricatorConpherenceWidgetVisibleSetting::SETTINGKEY; | $widget_key = PhabricatorConpherenceWidgetVisibleSetting::SETTINGKEY; | ||||
$widget_view = (bool)$viewer->getUserSetting($widget_key, false); | $widget_view = (bool)$viewer->getUserSetting($widget_key, false); | ||||
Show All 18 Lines | if ($id) { | ||||
->addSigil('conpherence-search-toggle') | ->addSigil('conpherence-search-toggle') | ||||
->setIcon('fa-search') | ->setIcon('fa-search') | ||||
->setHref('#') | ->setHref('#') | ||||
->setColor('green') | ->setColor('green') | ||||
->addClass('conpherence-search-toggle')); | ->addClass('conpherence-search-toggle')); | ||||
if (!$participating) { | if (!$participating) { | ||||
$action = ConpherenceUpdateActions::JOIN_ROOM; | $action = ConpherenceUpdateActions::JOIN_ROOM; | ||||
$uri = $this->getApplicationURI('update/'.$conpherence->getID().'/'); | $uri = $this->getApplicationURI("update/{$id}/"); | ||||
$button = phutil_tag( | $button = phutil_tag( | ||||
'button', | 'button', | ||||
array( | array( | ||||
'type' => 'SUBMIT', | 'type' => 'SUBMIT', | ||||
'class' => 'button green mlr', | 'class' => 'button green mlr', | ||||
), | ), | ||||
pht('Join Room')); | pht('Join Room')); | ||||
▲ Show 20 Lines • Show All 83 Lines • Show Last 20 Lines |