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


PHP OC_Calendar_Calendar::allCalendarsWherePrincipalURIIs方法代码示例

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


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

示例1: getCalendarsForUser

 /**
  * Returns a list of calendars for a principal.
  *
  * Every project is an array with the following keys:
  *  * id, a unique id that will be used by other functions to modify the
  *	calendar. This can be the same as the uri or a database key.
  *  * uri, which the basename of the uri with which the calendar is
  *	accessed.
  *  * principalUri. The owner of the calendar. Almost always the same as
  *	principalUri passed to this method.
  *
  * Furthermore it can contain webdav properties in clark notation. A very
  * common one is '{DAV:}displayname'.
  *
  * @param string $principalUri
  * @return array
  */
 public function getCalendarsForUser($principalUri)
 {
     $raw = OC_Calendar_Calendar::allCalendarsWherePrincipalURIIs($principalUri);
     $calendars = array();
     foreach ($raw as $row) {
         $components = explode(',', $row['components']);
         if ($row['userid'] != OCP\USER::getUser()) {
             $row['uri'] = $row['uri'] . '_shared_by_' . $row['userid'];
         }
         $calendar = array('id' => $row['id'], 'uri' => $row['uri'], 'principaluri' => 'principals/' . $row['userid'], '{' . \Sabre\CalDAV\Plugin::NS_CALENDARSERVER . '}getctag' => $row['ctag'] ? $row['ctag'] : '0', '{' . \Sabre\CalDAV\Plugin::NS_CALDAV . '}supported-calendar-component-set' => new \Sabre\CalDAV\Property\SupportedCalendarComponentSet($components));
         foreach ($this->propertyMap as $xmlName => $dbName) {
             $calendar[$xmlName] = isset($row[$dbName]) ? $row[$dbName] : '';
         }
         $calendars[] = $calendar;
     }
     if (\OCP\App::isEnabled('contacts')) {
         $ctag = 0;
         $app = new \OCA\Contacts\App();
         $addressBooks = $app->getAddressBooksForUser();
         foreach ($addressBooks as $addressBook) {
             $tmp = $addressBook->lastModified();
             if (!is_null($tmp)) {
                 $ctag = max($ctag, $tmp);
             }
         }
         $ctag++;
         $calendars[] = array('id' => 'contact_birthdays', 'uri' => 'contact_birthdays', '{DAV:}displayname' => (string) OC_Calendar_App::$l10n->t('Contact birthdays'), 'principaluri' => 'principals/contact_birthdays', '{' . \Sabre\CalDAV\Plugin::NS_CALENDARSERVER . '}getctag' => $ctag, '{' . \Sabre\CalDAV\Plugin::NS_CALDAV . '}supported-calendar-component-set' => new \Sabre\CalDAV\Property\SupportedCalendarComponentSet(array('VEVENT')), '{http://apple.com/ns/ical/}calendar-color' => '#CCCCCC');
     }
     return $calendars;
 }
开发者ID:AlfredoCubitos,项目名称:calendar,代码行数:47,代码来源:backend.php

示例2: getCalendarsForUser

 /**
  * Returns a list of calendars for a principal.
  *
  * Every project is an array with the following keys:
  *  * id, a unique id that will be used by other functions to modify the
  *	calendar. This can be the same as the uri or a database key.
  *  * uri, which the basename of the uri with which the calendar is
  *	accessed.
  *  * principalUri. The owner of the calendar. Almost always the same as
  *	principalUri passed to this method.
  *
  * Furthermore it can contain webdav properties in clark notation. A very
  * common one is '{DAV:}displayname'.
  *
  * @param string $principalUri
  * @return array
  */
 public function getCalendarsForUser($principalUri)
 {
     $raw = OC_Calendar_Calendar::allCalendarsWherePrincipalURIIs($principalUri);
     $calendars = array();
     foreach ($raw as $row) {
         $components = explode(',', $row['components']);
         $calendar = array('id' => $row['id'], 'uri' => $row['uri'], 'principaluri' => 'principals/' . $row['userid'], '{' . Sabre_CalDAV_Plugin::NS_CALENDARSERVER . '}getctag' => $row['ctag'] ? $row['ctag'] : '0', '{' . Sabre_CalDAV_Plugin::NS_CALDAV . '}supported-calendar-component-set' => new Sabre_CalDAV_Property_SupportedCalendarComponentSet($components));
         foreach ($this->propertyMap as $xmlName => $dbName) {
             $calendar[$xmlName] = $row[$dbName];
         }
         $calendars[] = $calendar;
     }
     return $calendars;
 }
开发者ID:jaeindia,项目名称:ownCloud-Enhancements,代码行数:31,代码来源:connector_sabre.php

示例3: getCalendarsForUser

 /**
  * Returns a list of calendars for a principal.
  *
  * Every project is an array with the following keys:
  *  * id, a unique id that will be used by other functions to modify the
  *	calendar. This can be the same as the uri or a database key.
  *  * uri, which the basename of the uri with which the calendar is
  *	accessed.
  *  * principalUri. The owner of the calendar. Almost always the same as
  *	principalUri passed to this method.
  *
  * Furthermore it can contain webdav properties in clark notation. A very
  * common one is '{DAV:}displayname'.
  *
  * @param string $principalUri
  * @return array
  */
 public function getCalendarsForUser($principalUri)
 {
     $raw = OC_Calendar_Calendar::allCalendarsWherePrincipalURIIs($principalUri);
     $calendars = array();
     foreach ($raw as $row) {
         $components = explode(',', $row['components']);
         if ($row['userid'] != OCP\USER::getUser()) {
             $row['uri'] = $row['uri'] . '_shared_by_' . $row['userid'];
         }
         $calendar = array('id' => $row['id'], 'uri' => $row['uri'], 'principaluri' => 'principals/' . $row['userid'], '{' . Sabre_CalDAV_Plugin::NS_CALENDARSERVER . '}getctag' => $row['ctag'] ? $row['ctag'] : '0', '{' . Sabre_CalDAV_Plugin::NS_CALDAV . '}supported-calendar-component-set' => new Sabre_CalDAV_Property_SupportedCalendarComponentSet($components));
         foreach ($this->propertyMap as $xmlName => $dbName) {
             $calendar[$xmlName] = $row[$dbName];
         }
         $calendars[] = $calendar;
     }
     if (\OCP\App::isEnabled('contacts')) {
         \OCP\Share::registerBackend('addressbook', 'OCA\\Contacts\\Share\\Addressbook', 'contact');
         $app = new \OCA\Contacts\App(\OCP\User::getUser());
         $calendars[] = array('id' => 'contact_birthdays', 'uri' => 'contact_birthdays', '{DAV:}displayname' => (string) OC_Calendar_App::$l10n->t('Contact birthdays'), 'principaluri' => 'principals/contact_birthdays', '{' . Sabre_CalDAV_Plugin::NS_CALENDARSERVER . '}getctag' => '0', '{' . Sabre_CalDAV_Plugin::NS_CALDAV . '}supported-calendar-component-set' => new Sabre_CalDAV_Property_SupportedCalendarComponentSet(array('VEVENT')));
     }
     return $calendars;
 }
开发者ID:omusico,项目名称:isle-web-framework,代码行数:39,代码来源:backend.php


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