Changeset View
Changeset View
Standalone View
Standalone View
src/applications/calendar/parser/ics/PhutilICSWriter.php
Show First 20 Lines • Show All 122 Lines • ▼ Show 20 Lines | private function getDocumentNodeProperties( | ||||
$properties = array(); | $properties = array(); | ||||
$properties[] = $this->newTextProperty( | $properties[] = $this->newTextProperty( | ||||
'VERSION', | 'VERSION', | ||||
'2.0'); | '2.0'); | ||||
$properties[] = $this->newTextProperty( | $properties[] = $this->newTextProperty( | ||||
'PRODID', | 'PRODID', | ||||
'-//Phacility//Phabricator//EN'); | self::getICSPRODID()); | ||||
cspeckmim: Oh I hadn't gotten to the calendar application yet, I'll have to learn about the ICS… | |||||
return $properties; | return $properties; | ||||
} | } | ||||
public static function getICSPRODID() { | |||||
return '-//Phacility//Phabricator//EN'; | |||||
} | |||||
private function getEventNodeProperties(PhutilCalendarEventNode $event) { | private function getEventNodeProperties(PhutilCalendarEventNode $event) { | ||||
$properties = array(); | $properties = array(); | ||||
$uid = $event->getUID(); | $uid = $event->getUID(); | ||||
if (!strlen($uid)) { | if (!strlen($uid)) { | ||||
throw new Exception( | throw new Exception( | ||||
pht( | pht( | ||||
'Unable to write ICS document: event has no UID, but each event '. | 'Unable to write ICS document: event has no UID, but each event '. | ||||
▲ Show 20 Lines • Show All 244 Lines • Show Last 20 Lines |
Oh I hadn't gotten to the calendar application yet, I'll have to learn about the ICS format/protocol 😬