]> git.mxchange.org Git - friendica-addons.git/blob - dav/common/dav_caldav_root.inc.php
Fix problems when friendica is installed in a subpath; small CSS-Fixes
[friendica-addons.git] / dav / common / dav_caldav_root.inc.php
1 <?php
2
3 /**
4  * Users collection 
5  *
6  * This object is responsible for generating a collection of users.
7  *
8  * @package Sabre
9  * @subpackage CalDAV
10  * @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved.
11  * @author Evert Pot (http://www.rooftopsolutions.nl/) 
12  * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
13  */
14 class Sabre_CalDAV_AnimexxCalendarRootNode extends Sabre_DAVACL_AbstractPrincipalCollection {
15
16     /**
17      * CalDAV backend 
18      * 
19      * @var array|Sabre_CalDAV_Backend_Abstract[]
20      */
21     protected $caldavBackends;
22
23         /**
24          * Constructor
25          *
26          * This constructor needs both an authentication and a caldav backend.
27          *
28          * @param Sabre_DAVACL_IPrincipalBackend $principalBackend
29          * @param array|Sabre_CalDAV_Backend_Abstract[] $caldavBackends
30          * @param string $principalPrefix
31          */
32     public function __construct(Sabre_DAVACL_IPrincipalBackend $principalBackend,$caldavBackends, $principalPrefix = 'principals/users') {
33
34         parent::__construct($principalBackend, $principalPrefix);
35         $this->caldavBackends = $caldavBackends;
36
37     }
38
39     /**
40      * Returns the nodename
41      *
42      * We're overriding this, because the default will be the 'principalPrefix',
43      * and we want it to be Sabre_CalDAV_Plugin::CALENDAR_ROOT 
44      *
45          * @return string
46      */
47     public function getName() {
48
49         return Sabre_CalDAV_Plugin::CALENDAR_ROOT;
50
51     }
52
53         /**
54          * This method returns a node for a principal.
55          *
56          * The passed array contains principal information, and is guaranteed to
57          * at least contain a uri item. Other properties may or may not be
58          * supplied by the authentication backend.
59          *
60          * @param array $principal
61          * @return \Sabre_CalDAV_AnimexxUserCalendars|\Sabre_DAVACL_IPrincipal
62          */
63     public function getChildForPrincipal(array $principal) {
64
65         return new Sabre_CalDAV_AnimexxUserCalendars($this->principalBackend, $this->caldavBackends, $principal['uri']);
66
67     }
68
69 }