Path: blob/master/src/applications/calendar/application/PhabricatorCalendarApplication.php
12253 views
<?php12final class PhabricatorCalendarApplication extends PhabricatorApplication {34public function getName() {5return pht('Calendar');6}78public function getShortDescription() {9return pht('Upcoming Events');10}1112public function getFlavorText() {13return pht('Never miss an episode ever again.');14}1516public function getBaseURI() {17return '/calendar/';18}1920public function getIcon() {21return 'fa-calendar';22}2324public function getTitleGlyph() {25// Unicode has a calendar character but it's in some distant code plane,26// use "keyboard" since it looks vaguely similar.27return "\xE2\x8C\xA8";28}2930public function getApplicationGroup() {31return self::GROUP_UTILITIES;32}3334public function isPrototype() {35return true;36}3738public function getRemarkupRules() {39return array(40new PhabricatorCalendarRemarkupRule(),41);42}4344public function getRoutes() {45return array(46'/E(?P<id>[1-9]\d*)(?:/(?P<sequence>\d+)/)?'47=> 'PhabricatorCalendarEventViewController',48'/calendar/' => array(49'(?:query/(?P<queryKey>[^/]+)/(?:(?P<year>\d+)/'.50'(?P<month>\d+)/)?(?:(?P<day>\d+)/)?)?'51=> 'PhabricatorCalendarEventListController',52'event/' => array(53$this->getEditRoutePattern('edit/')54=> 'PhabricatorCalendarEventEditController',55'drag/(?P<id>[1-9]\d*)/'56=> 'PhabricatorCalendarEventDragController',57'cancel/(?P<id>[1-9]\d*)/'58=> 'PhabricatorCalendarEventCancelController',59'(?P<action>join|decline|accept)/(?P<id>[1-9]\d*)/'60=> 'PhabricatorCalendarEventJoinController',61'export/(?P<id>[1-9]\d*)/(?P<filename>[^/]*)'62=> 'PhabricatorCalendarEventExportController',63'availability/(?P<id>[1-9]\d*)/(?P<availability>[^/]+)/'64=> 'PhabricatorCalendarEventAvailabilityController',65),66'export/' => array(67$this->getQueryRoutePattern()68=> 'PhabricatorCalendarExportListController',69$this->getEditRoutePattern('edit/')70=> 'PhabricatorCalendarExportEditController',71'(?P<id>[1-9]\d*)/'72=> 'PhabricatorCalendarExportViewController',73'ics/(?P<secretKey>[^/]+)/(?P<filename>[^/]*)'74=> 'PhabricatorCalendarExportICSController',75'disable/(?P<id>[1-9]\d*)/'76=> 'PhabricatorCalendarExportDisableController',77),78'import/' => array(79$this->getQueryRoutePattern()80=> 'PhabricatorCalendarImportListController',81$this->getEditRoutePattern('edit/')82=> 'PhabricatorCalendarImportEditController',83'(?P<id>[1-9]\d*)/'84=> 'PhabricatorCalendarImportViewController',85'disable/(?P<id>[1-9]\d*)/'86=> 'PhabricatorCalendarImportDisableController',87'delete/(?P<id>[1-9]\d*)/'88=> 'PhabricatorCalendarImportDeleteController',89'reload/(?P<id>[1-9]\d*)/'90=> 'PhabricatorCalendarImportReloadController',91'drop/'92=> 'PhabricatorCalendarImportDropController',93'log/' => array(94$this->getQueryRoutePattern()95=> 'PhabricatorCalendarImportLogListController',96),97),98),99);100}101102public function getHelpDocumentationArticles(PhabricatorUser $viewer) {103return array(104array(105'name' => pht('Calendar User Guide'),106'href' => PhabricatorEnv::getDoclink('Calendar User Guide'),107),108array(109'name' => pht('Importing Events'),110'href' => PhabricatorEnv::getDoclink(111'Calendar User Guide: Importing Events'),112),113array(114'name' => pht('Exporting Events'),115'href' => PhabricatorEnv::getDoclink(116'Calendar User Guide: Exporting Events'),117),118);119}120121public function getMailCommandObjects() {122return array(123'event' => array(124'name' => pht('Email Commands: Events'),125'header' => pht('Interacting with Calendar Events'),126'object' => new PhabricatorCalendarEvent(),127'summary' => pht(128'This page documents the commands you can use to interact with '.129'events in Calendar. These commands work when creating new tasks '.130'via email and when replying to existing tasks.'),131),132);133}134135protected function getCustomCapabilities() {136return array(137PhabricatorCalendarEventDefaultViewCapability::CAPABILITY => array(138'caption' => pht('Default view policy for newly created events.'),139'template' => PhabricatorCalendarEventPHIDType::TYPECONST,140'capability' => PhabricatorPolicyCapability::CAN_VIEW,141),142PhabricatorCalendarEventDefaultEditCapability::CAPABILITY => array(143'caption' => pht('Default edit policy for newly created events.'),144'template' => PhabricatorCalendarEventPHIDType::TYPECONST,145'capability' => PhabricatorPolicyCapability::CAN_EDIT,146),147);148}149150}151152153