Exemplo n.º 1
0
 /**
  * Creates a new file
  *
  * The contents of the new file must be a valid ICalendar string.
  *
  * @param string $name
  * @param resource $calendarData
  * @return string|null
  */
 public function createFile($name, $calendarData = null)
 {
     if (is_resource($calendarData)) {
         $calendarData = stream_get_contents($calendarData);
     }
     return $this->caldavBackend->createCalendarObject($this->calendarInfo['id'], $name, $calendarData);
 }
Exemplo n.º 2
0
 /**
  * Creates a new file
  *
  * The contents of the new file must be a valid ICalendar string.
  * 
  * @param string $name 
  * @param resource $calendarData 
  * @return void
  */
 public function createFile($name, $calendarData = null)
 {
     $calendarData = stream_get_contents($calendarData);
     $supportedComponents = $this->calendarInfo['{' . Sabre_CalDAV_Plugin::NS_CALDAV . '}supported-calendar-component-set']->getValue();
     Sabre_CalDAV_ICalendarUtil::validateICalendarObject($calendarData, $supportedComponents);
     $this->caldavBackend->createCalendarObject($this->calendarInfo['id'], $name, $calendarData);
 }
Exemplo n.º 3
0
 /**
  * Creates a new file
  *
  * The contents of the new file must be a valid ICalendar string.
  * 
  * @param string $name 
  * @param resource $calendarData 
  * @return void
  */
 public function createFile($name, $calendarData = null)
 {
     if (!$this->hasPrivilege()) {
         throw new Sabre_DAV_Exception_Forbidden('Permission denied to access this calendar');
     }
     $calendarData = stream_get_contents($calendarData);
     $supportedComponents = $this->calendarInfo['{' . Sabre_CalDAV_Plugin::NS_CALDAV . '}supported-calendar-component-set']->getValue();
     Sabre_CalDAV_ICalendarUtil::validateICalendarObject($calendarData, $supportedComponents);
     $this->caldavBackend->createCalendarObject($this->calendarInfo['id'], $name, $calendarData);
 }
Exemplo n.º 4
0
 /**
  * Creates a new file
  *
  * The contents of the new file must be a valid ICalendar string.
  * 
  * @param string $name 
  * @param resource $calendarData 
  * @return void
  */
 public function createFile($name, $calendarData = null)
 {
     $calendarData = stream_get_contents($calendarData);
     // Converting to UTF-8, if needed
     $calendarData = Sabre_DAV_StringUtil::ensureUTF8($calendarData);
     $supportedComponents = $this->calendarInfo['{' . Sabre_CalDAV_Plugin::NS_CALDAV . '}supported-calendar-component-set'];
     if ($supportedComponents) {
         $supportedComponents = $supportedComponents->getValue();
     } else {
         $supportedComponents = null;
     }
     Sabre_CalDAV_ICalendarUtil::validateICalendarObject($calendarData, $supportedComponents);
     $this->caldavBackend->createCalendarObject($this->calendarInfo['id'], $name, $calendarData);
 }