本文整理匯總了PHP中Kronolith::quickAdd方法的典型用法代碼示例。如果您正苦於以下問題:PHP Kronolith::quickAdd方法的具體用法?PHP Kronolith::quickAdd怎麽用?PHP Kronolith::quickAdd使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Kronolith
的用法示例。
在下文中一共展示了Kronolith::quickAdd方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: quickSaveEvent
/**
* 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: quickAdd
/**
* 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;
}