2012-10-24 13:22:24 -07:00
|
|
|
<?php
|
|
|
|
|
2014-07-23 10:03:09 +10:00
|
|
|
final class PhabricatorCalendarApplication extends PhabricatorApplication {
|
2012-10-24 13:22:24 -07:00
|
|
|
|
2014-07-23 23:52:50 +10:00
|
|
|
public function getName() {
|
|
|
|
return pht('Calendar');
|
|
|
|
}
|
|
|
|
|
2012-10-24 13:22:24 -07:00
|
|
|
public function getShortDescription() {
|
2014-05-29 12:17:54 -07:00
|
|
|
return pht('Upcoming Events');
|
2012-10-24 13:22:24 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
public function getFlavorText() {
|
|
|
|
return pht('Never miss an episode ever again.');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getBaseURI() {
|
|
|
|
return '/calendar/';
|
|
|
|
}
|
|
|
|
|
2015-01-24 23:41:43 -08:00
|
|
|
public function getFontIcon() {
|
|
|
|
return 'fa-calendar';
|
|
|
|
}
|
|
|
|
|
2012-10-24 13:22:24 -07:00
|
|
|
public function getTitleGlyph() {
|
|
|
|
// Unicode has a calendar character but it's in some distant code plane,
|
|
|
|
// use "keyboard" since it looks vaguely similar.
|
|
|
|
return "\xE2\x8C\xA8";
|
|
|
|
}
|
|
|
|
|
2014-09-17 18:25:57 -07:00
|
|
|
public function isPrototype() {
|
2013-01-19 10:12:44 -08:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2015-04-27 14:27:34 -07:00
|
|
|
public function getRemarkupRules() {
|
|
|
|
return array(
|
|
|
|
new PhabricatorCalendarRemarkupRule(),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2012-10-24 13:22:24 -07:00
|
|
|
public function getRoutes() {
|
|
|
|
return array(
|
2015-04-27 14:26:25 -07:00
|
|
|
'/E(?P<id>[1-9]\d*)' => 'PhabricatorCalendarEventViewController',
|
2012-10-24 13:22:24 -07:00
|
|
|
'/calendar/' => array(
|
2014-03-05 08:24:45 -08:00
|
|
|
'' => 'PhabricatorCalendarViewController',
|
|
|
|
'all/' => 'PhabricatorCalendarBrowseController',
|
2014-02-06 10:10:07 -08:00
|
|
|
'event/' => array(
|
2014-07-23 10:03:09 +10:00
|
|
|
'(?:query/(?P<queryKey>[^/]+)/)?'
|
|
|
|
=> 'PhabricatorCalendarEventListController',
|
|
|
|
'create/'
|
|
|
|
=> 'PhabricatorCalendarEventEditController',
|
|
|
|
'edit/(?P<id>[1-9]\d*)/'
|
|
|
|
=> 'PhabricatorCalendarEventEditController',
|
|
|
|
'delete/(?P<id>[1-9]\d*)/'
|
|
|
|
=> 'PhabricatorCalendarEventDeleteController',
|
2012-10-24 13:22:24 -07:00
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2014-01-29 15:41:30 -08:00
|
|
|
public function getQuickCreateItems(PhabricatorUser $viewer) {
|
|
|
|
$items = array();
|
|
|
|
|
|
|
|
$item = id(new PHUIListItemView())
|
|
|
|
->setName(pht('Calendar Event'))
|
2014-05-12 13:34:00 -07:00
|
|
|
->setIcon('fa-calendar')
|
2014-02-06 10:10:07 -08:00
|
|
|
->setHref($this->getBaseURI().'event/create/');
|
2014-01-29 15:41:30 -08:00
|
|
|
$items[] = $item;
|
|
|
|
|
|
|
|
return $items;
|
|
|
|
}
|
|
|
|
|
2012-10-24 13:22:24 -07:00
|
|
|
}
|