本文整理匯總了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;
}