ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Sabre\CalDAV\Subscriptions\Plugin Class Reference

This plugin adds calendar-subscription support to your CalDAV server. More...

+ Inheritance diagram for Sabre\CalDAV\Subscriptions\Plugin:
+ Collaboration diagram for Sabre\CalDAV\Subscriptions\Plugin:

Public Member Functions

 initialize (Server $server)
 This initializes the plugin. More...
 
 getFeatures ()
 This method should return a list of server-features. More...
 
 propFind (PropFind $propFind, INode $node)
 Triggered after properties have been fetched. More...
 
 getPluginName ()
 Returns a plugin name. More...
 
 getPluginInfo ()
 Returns a bunch of meta-data about the plugin. More...
 
- Public Member Functions inherited from Sabre\DAV\ServerPlugin
 initialize (Server $server)
 This initializes the plugin. More...
 
 getFeatures ()
 This method should return a list of server-features. More...
 
 getHTTPMethods ($path)
 Use this method to tell the server this plugin defines additional HTTP methods. More...
 
 getPluginName ()
 Returns a plugin name. More...
 
 getSupportedReportSet ($uri)
 Returns a list of reports this plugin supports. More...
 
 getPluginInfo ()
 Returns a bunch of meta-data about the plugin. More...
 

Detailed Description

This plugin adds calendar-subscription support to your CalDAV server.

Some clients support 'managed subscriptions' server-side. This is basically a list of subscription urls a user is using.

Author
Evert Pot (http://evertpot.com/) http://sabre.io/license/ Modified BSD License

Definition at line 20 of file Plugin.php.

Member Function Documentation

◆ getFeatures()

Sabre\CalDAV\Subscriptions\Plugin::getFeatures ( )

This method should return a list of server-features.

This is for example 'versioning' and is added to the DAV: header in an OPTIONS response.

Returns
array

Definition at line 53 of file Plugin.php.

53  {
54 
55  return ['calendarserver-subscribed'];
56 
57  }

◆ getPluginInfo()

Sabre\CalDAV\Subscriptions\Plugin::getPluginInfo ( )

Returns a bunch of meta-data about the plugin.

Providing this information is optional, and is mainly displayed by the Browser plugin.

The description key in the returned array may contain html and will not be sanitized.

Returns
array

Definition at line 111 of file Plugin.php.

References Sabre\CalDAV\Plugin\getPluginName().

111  {
112 
113  return [
114  'name' => $this->getPluginName(),
115  'description' => 'This plugin allows users to store iCalendar subscriptions in their calendar-home.',
116  'link' => null,
117  ];
118 
119  }
getPluginName()
Returns a plugin name.
Definition: Plugin.php:135
+ Here is the call graph for this function:

◆ getPluginName()

Sabre\CalDAV\Subscriptions\Plugin::getPluginName ( )

Returns a plugin name.

Using this name other plugins will be able to access other plugins using ::getPlugin

Returns
string

Definition at line 94 of file Plugin.php.

94  {
95 
96  return 'subscriptions';
97 
98  }

◆ initialize()

Sabre\CalDAV\Subscriptions\Plugin::initialize ( Server  $server)

This initializes the plugin.

This function is called by Sabre, after addPlugin is called.

This method should set up the required event subscriptions.

Parameters
Server$server
Returns
void

Definition at line 33 of file Plugin.php.

References Sabre\Event\EventEmitterInterface\on().

33  {
34 
35  $server->resourceTypeMapping['Sabre\\CalDAV\\Subscriptions\\ISubscription'] =
36  '{http://calendarserver.org/ns/}subscribed';
37 
38  $server->xml->elementMap['{http://calendarserver.org/ns/}source'] =
39  'Sabre\\DAV\\Xml\\Property\\Href';
40 
41  $server->on('propFind', [$this, 'propFind'], 150);
42 
43  }
+ Here is the call graph for this function:

◆ propFind()

Sabre\CalDAV\Subscriptions\Plugin::propFind ( PropFind  $propFind,
INode  $node 
)

Triggered after properties have been fetched.

Parameters
PropFind$propFind
INode$node
Returns
void

Definition at line 66 of file Plugin.php.

References Sabre\DAV\PropFind\getStatus(), and Sabre\DAV\PropFind\set().

66  {
67 
68  // There's a bunch of properties that must appear as a self-closing
69  // xml-element. This event handler ensures that this will be the case.
70  $props = [
71  '{http://calendarserver.org/ns/}subscribed-strip-alarms',
72  '{http://calendarserver.org/ns/}subscribed-strip-attachments',
73  '{http://calendarserver.org/ns/}subscribed-strip-todos',
74  ];
75 
76  foreach ($props as $prop) {
77 
78  if ($propFind->getStatus($prop) === 200) {
79  $propFind->set($prop, '', 200);
80  }
81 
82  }
83 
84  }
+ Here is the call graph for this function:

The documentation for this class was generated from the following file: