本文整理汇总了PHP中Calendar::allCalendars方法的典型用法代码示例。如果您正苦于以下问题:PHP Calendar::allCalendars方法的具体用法?PHP Calendar::allCalendars怎么用?PHP Calendar::allCalendars使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Calendar
的用法示例。
在下文中一共展示了Calendar::allCalendars方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
$timeNow = time();
//test
$checkOffset = new \DateTime(date('d.m.Y', $timeNow), new \DateTimeZone(self::$tz));
$calcSumWin = $checkOffset->getOffset();
$this->nowTime = strtotime(date('d.m.Y H:i', $timeNow)) + $calcSumWin;
if (\OC::$server->getSession()->get('public_link_token')) {
$linkItem = \OCP\Share::getShareByToken(\OC::$server->getSession()->get('public_link_token', false));
if (is_array($linkItem) && isset($linkItem['uid_owner'])) {
if ($linkItem['item_type'] === App::SHARECALENDAR) {
$sPrefix = App::SHARECALENDARPREFIX;
}
if ($linkItem['item_type'] === App::SHAREEVENT) {
$sPrefix = App::SHAREEVENTPREFIX;
}
if ($linkItem['item_type'] === App::SHARETODO) {
$sPrefix = App::SHARETODOPREFIX;
}
$itemSource = App::validateItemSource($linkItem['item_source'], $sPrefix);
$rootLinkItem = Calendar::find($itemSource);
$this->aCalendars[] = $rootLinkItem;
}
} else {
$this->aCalendars = Calendar::allCalendars(\OCP\User::getUser());
$this->checkAlarm();
}
}
示例2: deleteUser
/**
* @brief Deletes all calendars of a certain user
* @param paramters parameters from postDeleteUser-Hook
* @return array
*/
public static function deleteUser($parameters)
{
\OCP\Util::writeLog('calendarplus', 'Hook DEL ID-> ' . $parameters['uid'], \OCP\Util::DEBUG);
$calendars = Calendar::allCalendars($parameters['uid']);
foreach ($calendars as $calendar) {
if ($parameters['uid'] === $calendar['userid']) {
Calendar::deleteCalendar($calendar['id']);
}
}
//delete preferences
return true;
}
示例3: createCalendarName
public function createCalendarName()
{
$calendars = Calendar::allCalendars($this->userid);
$calendarname = $guessedcalendarname = !is_null($this->guessCalendarName()) ? $this->guessCalendarName() : App::$l10n->t('New Calendar');
$i = 1;
while (!Calendar::isCalendarNameavailable($calendarname, $this->userid)) {
$calendarname = $guessedcalendarname . ' (' . $i . ')';
$i++;
}
return $calendarname;
}