1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-13 10:22:42 +01:00
phorge-phorge/src/applications/calendar/controller/PhabricatorCalendarController.php
lkassianik 5ca0070446 Left nav should no longer offer to create Calendar event and create event page should no longer show left nav.
Summary: Closes T7934, Left nav should no longer offer to create Calendar event and create event page should no longer show left nav.

Test Plan: Open Calendar, left nav should be missing the Create Event option, create event, create view should no longer show left nav.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Maniphest Tasks: T7934

Differential Revision: https://secure.phabricator.com/D12638
2015-04-30 16:18:15 -07:00

38 lines
1,022 B
PHP

<?php
abstract class PhabricatorCalendarController extends PhabricatorController {
protected function buildSideNavView(PhabricatorCalendarEvent $status = null) {
$nav = new AphrontSideNavFilterView();
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
$nav->addLabel(pht('Calendar'));
$nav->addFilter('/', pht('My Events'));
$nav->addFilter('all/', pht('View All'));
if ($status && $status->getID()) {
$nav->addFilter('event/edit/'.$status->getID().'/', pht('Edit Event'));
}
$nav->addFilter('event/', pht('Upcoming Events'));
return $nav;
}
public function buildApplicationMenu() {
return $this->buildSideNavView()->getMenu();
}
protected function buildApplicationCrumbs() {
$crumbs = parent::buildApplicationCrumbs();
$crumbs->addAction(
id(new PHUIListItemView())
->setName(pht('Create Event'))
->setHref($this->getApplicationURI().'event/create')
->setIcon('fa-plus-square'));
return $crumbs;
}
}