/** * Initializes the plugin and subscribes to events * * @param DAV\Server $server * @return void */ function initialize(DAV\Server $server) { $this->server = $server; $this->server->on('method:GET', [$this, 'httpGetEarly'], 90); $this->server->on('method:GET', [$this, 'httpGet'], 200); $this->server->on('onHTMLActionsPanel', [$this, 'htmlActionsPanel'], 200); if ($this->enablePost) $this->server->on('method:POST', [$this, 'httpPOST']); }
/** * Initializes the plugin and registers event handlers * * @param DAV\Server $server * @return void */ function initialize(DAV\Server $server) { $this->server = $server; $this->server->on('method:GET', [$this, 'httpGet'], 90); $server->on('browserButtonActions', function ($path, $node, &$actions) { if ($node instanceof IAddressBook) { $actions .= '<a href="' . htmlspecialchars($path, ENT_QUOTES, 'UTF-8') . '?export"><span class="oi" data-glyph="book"></span></a>'; } }); }
/** * This initializes the plugin. * * This function is called by Sabre\DAV\Server, after * addPlugin is called. * * This method should set up the required event subscriptions. * * @param DAV\Server $server * @return void */ function initialize(DAV\Server $server) { $this->server = $server; $server->resourceTypeMapping['Sabre\\CalDAV\\ISharedCalendar'] = '{' . Plugin::NS_CALENDARSERVER . '}shared'; array_push($this->server->protectedProperties, '{' . Plugin::NS_CALENDARSERVER . '}invite', '{' . Plugin::NS_CALENDARSERVER . '}allowed-sharing-modes', '{' . Plugin::NS_CALENDARSERVER . '}shared-url'); $this->server->on('propFind', [$this, 'propFindEarly']); $this->server->on('propFind', [$this, 'propFindLate'], 150); $this->server->on('propPatch', [$this, 'propPatch'], 40); $this->server->on('method:POST', [$this, 'httpPost']); }
/** * This initializes the plugin. * * This function is called by Sabre\DAV\Server, after * addPlugin is called. * * This method should set up the required event subscriptions. * * @param DAV\Server $server * @return void */ function initialize(DAV\Server $server) { $this->server = $server; if (is_null($this->server->getPlugin('sharing'))) { throw new \LogicException('The generic "sharing" plugin must be loaded before the caldav sharing plugin. Call $server->addPlugin(new \\Sabre\\DAV\\Sharing\\Plugin()); before this one.'); } array_push($this->server->protectedProperties, '{' . Plugin::NS_CALENDARSERVER . '}invite', '{' . Plugin::NS_CALENDARSERVER . '}allowed-sharing-modes', '{' . Plugin::NS_CALENDARSERVER . '}shared-url'); $this->server->xml->elementMap['{' . Plugin::NS_CALENDARSERVER . '}share'] = 'Sabre\\CalDAV\\Xml\\Request\\Share'; $this->server->xml->elementMap['{' . Plugin::NS_CALENDARSERVER . '}invite-reply'] = 'Sabre\\CalDAV\\Xml\\Request\\InviteReply'; $this->server->on('propFind', [$this, 'propFindEarly']); $this->server->on('propFind', [$this, 'propFindLate'], 150); $this->server->on('propPatch', [$this, 'propPatch'], 40); $this->server->on('method:POST', [$this, 'httpPost']); }
/** * Initializes the plugin and subscribes to events * * @param DAV\Server $server * @return void */ function initialize(DAV\Server $server) { $this->server = $server; $this->server->on('method:GET', [$this, 'httpGet'], 90); }
/** * Initializes the plugin. This function is automatically called by the server * * @param DAV\Server $server * @return void */ function initialize(DAV\Server $server) { $this->server = $server; $this->server->on('beforeMethod', [$this, 'beforeMethod'], 10); }