Files
phabricator/src/applications/conpherence/controller/ConpherenceController.php
Chad Little 05628de90d Clean up random junk in Conpherence
Summary: Fixes T10781. Re-uses sidenav styles from global space, though a little hacky. Fix crumb border, fix nux experience. Fiddle spacing.

Test Plan:
Use Conpherence as new user, make a room, post some messages.

{F1805658}

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T10781

Differential Revision: https://secure.phabricator.com/D16528
2016-09-09 07:16:39 -07:00

101 lines
2.6 KiB
PHP

<?php
abstract class ConpherenceController extends PhabricatorController {
private $conpherence;
public function setConpherence(ConpherenceThread $conpherence) {
$this->conpherence = $conpherence;
return $this;
}
public function getConpherence() {
return $this->conpherence;
}
public function buildApplicationMenu() {
$nav = new PHUIListView();
$nav->newLink(
pht('New Room'),
$this->getApplicationURI('new/'));
$nav->addMenuItem(
id(new PHUIListItemView())
->setName(pht('Add Participants'))
->setType(PHUIListItemView::TYPE_LINK)
->setHref('#')
->addSigil('conpherence-widget-adder')
->setMetadata(array('widget' => 'widgets-people')));
return $nav;
}
protected function buildApplicationCrumbs() {
return $this->buildConpherenceApplicationCrumbs();
}
protected function buildConpherenceApplicationCrumbs($is_rooms = false) {
$crumbs = parent::buildApplicationCrumbs();
$crumbs->setBorder(true);
$crumbs->addAction(
id(new PHUIListItemView())
->setName(pht('Search'))
->setHref($this->getApplicationURI('search/'))
->setIcon('fa-search'));
if ($is_rooms) {
$crumbs
->addAction(
id(new PHUIListItemView())
->setName(pht('New Room'))
->setHref($this->getApplicationURI('new/'))
->setIcon('fa-plus-square')
->setWorkflow(true));
} else {
$crumbs
->addAction(
id(new PHUIListItemView())
->setName(pht('New Room'))
->setHref($this->getApplicationURI('new/'))
->setIcon('fa-plus-square')
->setWorkflow(true))
->addAction(
id(new PHUIListItemView())
->setName(pht('Room'))
->setHref('#')
->setIcon('fa-bars')
->setStyle('display: none;')
->addClass('device-widgets-selector')
->addSigil('device-widgets-selector'));
}
return $crumbs;
}
protected function buildHeaderPaneContent(
ConpherenceThread $conpherence,
array $policy_objects) {
assert_instances_of($policy_objects, 'PhabricatorPolicy');
$crumbs = $this->buildApplicationCrumbs();
$data = $conpherence->getDisplayData($this->getViewer());
$crumbs->addCrumb(
id(new PHUICrumbView())
->setName($data['title'])
->setHref('/'.$conpherence->getMonogram()));
return hsprintf(
'%s',
array(
phutil_tag(
'div',
array(
'class' => 'header-loading-mask',
),
''),
$crumbs,
));
}
}