quickAdd() 공개 메소드

Imports an event parsed from a string.
public quickAdd ( string $text, string $calendar = null ) : array
$text string The text to parse into an event
$calendar string The calendar into which the event will be imported. If 'null', the user's default calendar will be used.
리턴 array The UID of all events that were added.
예제 #1
0
파일: Handler.php 프로젝트: kossamums/horde
 /**
  * TODO
  */
 public function quickSaveEvent()
 {
     $cal = explode('|', $this->vars->cal, 2);
     try {
         $event = Kronolith::quickAdd($this->vars->text, $cal[1]);
         return $this->_saveEvent($event);
     } catch (Horde_Exception $e) {
         $GLOBALS['notification']->push($e);
         $result = $this->_signedResponse($this->vars->cal);
         $result->error = true;
         return $result;
     }
 }
예제 #2
0
파일: Api.php 프로젝트: horde/horde
 /**
  * Imports an event parsed from a string.
  *
  * @param string $text      The text to parse into an event
  * @param string $calendar  The calendar into which the event will be
  *                          imported.  If 'null', the user's default
  *                          calendar will be used.
  *
  * @return array  The UID of all events that were added.
  * @throws Kronolith_Exception
  */
 public function quickAdd($text, $calendar = null)
 {
     if (!isset($calendar)) {
         $calendar = Kronolith::getDefaultCalendar(Horde_Perms::EDIT);
     } elseif (!Kronolith::hasPermission($calendar, Horde_Perms::EDIT)) {
         throw new Horde_Exception_PermissionDenied();
     }
     $event = Kronolith::quickAdd($text, $calendar);
     return $event->uid;
 }