Path: blob/master/src/applications/calendar/controller/PhabricatorCalendarController.php
12256 views
<?php12abstract class PhabricatorCalendarController extends PhabricatorController {34protected function newICSResponse(5PhabricatorUser $viewer,6$file_name,7array $events) {89$ics_data = id(new PhabricatorCalendarICSWriter())10->setViewer($viewer)11->setEvents($events)12->writeICSDocument();1314return id(new AphrontFileResponse())15->setDownload($file_name)16->setMimeType('text/calendar')17->setContent($ics_data);18}1920protected function newImportedEventResponse(PhabricatorCalendarEvent $event) {21if (!$event->isImportedEvent()) {22return null;23}2425// Give the user a specific, detailed message if they try to edit an26// imported event via common web paths. Other edits (including those via27// the API) are blocked by the normal policy system, but this makes it more28// clear exactly why the event can't be edited.2930return $this->newDialog()31->setTitle(pht('Can Not Edit Imported Event'))32->appendParagraph(33pht(34'This event has been imported from an external source and '.35'can not be edited.'))36->addCancelButton($event->getURI(), pht('Done'));37}3839}404142