当前位置: 首页>>代码示例>>PHP>>正文


PHP OC_Calendar_Object::allInPeriod方法代码示例

本文整理汇总了PHP中OC_Calendar_Object::allInPeriod方法的典型用法代码示例。如果您正苦于以下问题:PHP OC_Calendar_Object::allInPeriod方法的具体用法?PHP OC_Calendar_Object::allInPeriod怎么用?PHP OC_Calendar_Object::allInPeriod使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OC_Calendar_Object的用法示例。


在下文中一共展示了OC_Calendar_Object::allInPeriod方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getrequestedEvents

 public static function getrequestedEvents($calendarid, $start, $end)
 {
     $events = array();
     if ($calendarid == 'shared_rw' || $calendarid == 'shared_r') {
         $calendars = OC_Calendar_Share::allSharedwithuser(OCP\USER::getUser(), OC_Calendar_Share::CALENDAR, 1, $_GET['calendar_id'] == 'shared_rw' ? 'rw' : 'r');
         foreach ($calendars as $calendar) {
             $calendarevents = OC_Calendar_Object::allInPeriod($calendar['calendarid'], $start, $end);
             foreach ($calendarevents as $event) {
                 $event['summary'] .= ' (' . self::$l10n->t('by') . ' ' . OC_Calendar_Object::getowner($event['id']) . ')';
             }
             $events = array_merge($events, $calendarevents);
         }
         $singleevents = OC_Calendar_Share::allSharedwithuser(OCP\USER::getUser(), OC_Calendar_Share::EVENT, 1, $_GET['calendar_id'] == 'shared_rw' ? 'rw' : 'r');
         foreach ($singleevents as $singleevent) {
             $event = OC_Calendar_Object::find($singleevent['eventid']);
             if (!array_key_exists('summary', $event)) {
                 $event['summary'] = self::$l10n->t('unnamed');
             }
             $event['summary'] .= ' (' . self::$l10n->t('by') . ' ' . OC_Calendar_Object::getowner($event['id']) . ')';
             $events[] = $event;
         }
     } else {
         if (is_numeric($calendarid)) {
             $calendar = self::getCalendar($calendarid);
             OCP\Response::enableCaching(0);
             OCP\Response::setETagHeader($calendar['ctag']);
             $events = OC_Calendar_Object::allInPeriod($calendarid, $start, $end);
         } else {
             OCP\Util::emitHook('OC_Calendar', 'getEvents', array('calendar_id' => $calendarid, 'events' => &$events));
         }
     }
     return $events;
 }
开发者ID:noci2012,项目名称:owncloud,代码行数:33,代码来源:app.php

示例2: getrequestedEvents

 /**
  * @brief analyses the parameter for calendar parameter and returns the objects
  * @param (string) $calendarid - calendarid
  * @param (int) $start - unixtimestamp of start
  * @param (int) $end - unixtimestamp of end
  * @return (array) $events
  */
 public static function getrequestedEvents($calendarid, $start, $end)
 {
     $events = array();
     if ($calendarid == 'shared_events') {
         $singleevents = OCP\Share::getItemsSharedWith('event', OC_Share_Backend_Event::FORMAT_EVENT);
         $calendars = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser());
         foreach ($singleevents as $singleevent) {
             // Skip this single event if the whole calendar is already shared with the user.
             $calendarShared = false;
             foreach ($calendars as $calendar) {
                 if ($singleevent['calendarid'] === $calendar['id']) {
                     $calendarShared = true;
                     break;
                 }
             }
             if ($calendarShared === true) {
                 continue;
             }
             $singleevent['summary'] .= ' (' . self::$l10n->t('by') . ' ' . OC_Calendar_Object::getowner($singleevent['id']) . ')';
             $events[] = $singleevent;
         }
     } else {
         if (is_numeric($calendarid)) {
             $calendar = self::getCalendar($calendarid);
             OCP\Response::enableCaching(0);
             OCP\Response::setETagHeader($calendar['ctag']);
             $events = OC_Calendar_Object::allInPeriod($calendarid, $start, $end, $calendar['userid'] !== OCP\User::getUser());
         } else {
             OCP\Util::emitHook('OC_Calendar', 'getEvents', array('calendar_id' => $calendarid, 'events' => &$events));
         }
     }
     return $events;
 }
开发者ID:yheric455042,项目名称:owncloud82,代码行数:40,代码来源:app.php

示例3: getrequestedEvents

 /**
  * @brief analyses the parameter for calendar parameter and returns the objects
  * @param (string) $calendarid - calendarid
  * @param (int) $start - unixtimestamp of start
  * @param (int) $end - unixtimestamp of end
  * @return (array) $events
  */
 public static function getrequestedEvents($calendarid, $start, $end)
 {
     $events = array();
     if ($calendarid == 'shared_events') {
         $singleevents = OCP\Share::getItemsSharedWith('event', OC_Share_Backend_Event::FORMAT_EVENT);
         foreach ($singleevents as $singleevent) {
             $singleevent['summary'] .= ' (' . self::$l10n->t('by') . ' ' . OC_Calendar_Object::getowner($singleevent['id']) . ')';
             $events[] = $singleevent;
         }
     } else {
         if (is_numeric($calendarid)) {
             $calendar = self::getCalendar($calendarid);
             OCP\Response::enableCaching(0);
             OCP\Response::setETagHeader($calendar['ctag']);
             $events = OC_Calendar_Object::allInPeriod($calendarid, $start, $end);
         } else {
             OCP\Util::emitHook('OC_Calendar', 'getEvents', array('calendar_id' => $calendarid, 'events' => &$events));
         }
     }
     return $events;
 }
开发者ID:blablubli,项目名称:owncloudapps,代码行数:28,代码来源:app.php


注:本文中的OC_Calendar_Object::allInPeriod方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。