本文整理汇总了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;
}