]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix indent once and for all
authorThomas Citharel <tcit@tcit.fr>
Mon, 1 Aug 2016 08:51:11 +0000 (10:51 +0200)
committerLukas Reschke <lukas@statuscode.ch>
Mon, 26 Sep 2016 09:55:39 +0000 (11:55 +0200)
apps/dav/lib/CalDAV/CalDavBackend.php
apps/dav/lib/CalDAV/Publishing/PublishPlugin.php

index cdab20f541efee8dde790a8c6b40cddbc382a06b..e6a023bda645499d76a00d2a176cd684600c82c7 100644 (file)
@@ -1534,9 +1534,9 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
        }
 
        /**
-       * @param boolean $value
-       * @param \OCA\DAV\CalDAV\Calendar $calendar
-       */
+        * @param boolean $value
+        * @param \OCA\DAV\CalDAV\Calendar $calendar
+        */
        public function setPublishStatus($value, $calendar) {
                $query = $this->db->getQueryBuilder();
                if ($value) {
index e0bcfb7ef6aa56476602d4092f36a16a9678d034..99353253b058c06d295510d64a38987303796133 100644 (file)
@@ -19,25 +19,25 @@ class PublishPlugin extends ServerPlugin
        const NS_CALENDARSERVER = 'http://calendarserver.org/ns/';
 
        /**
-     * Reference to SabreDAV server object.
-     *
-     * @var \Sabre\DAV\Server
-     */
-    protected $server;
-
-    /**
-     * Config instance to get instance secret.
-     *
-     * @var IConfig
-     */
-    protected $config;
-
-     /**
-      * URL Generator for absolute URLs.
-      *
-      * @var IURLGenerator
-      */
-     protected $urlGenerator;
+        * Reference to SabreDAV server object.
+        *
+        * @var \Sabre\DAV\Server
+        */
+       protected $server;
+
+       /**
+        * Config instance to get instance secret.
+        *
+        * @var IConfig
+        */
+       protected $config;
+
+       /**
+        * URL Generator for absolute URLs.
+        *
+        * @var IURLGenerator
+        */
+       protected $urlGenerator;
 
        /**
         * PublishPlugin constructor.
@@ -45,76 +45,77 @@ class PublishPlugin extends ServerPlugin
         * @param IConfig $config
         * @param IURLGenerator $urlGenerator
         */
-     public function __construct(IConfig $config, IURLGenerator $urlGenerator)
-     {
-         $this->config = $config;
-         $this->urlGenerator = $urlGenerator;
-     }
+       public function __construct(IConfig $config, IURLGenerator $urlGenerator)
+       {
+               $this->config = $config;
+               $this->urlGenerator = $urlGenerator;
+       }
 
        /**
-     * 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.
-     *
-     * @return string[]
-     */
+        * 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.
+        *
+        * @return string[]
+        */
        public function getFeatures()
-    {
-        return ['oc-calendar-publishing']; // May have to be changed to be detected
-    }
-
-    /**
-     * Returns a plugin name.
-     *
-     * Using this name other plugins will be able to access other plugins
-     * using Sabre\DAV\Server::getPlugin
-     *
-     * @return string
-     */
-    public function getPluginName()
-    {
-        return 'oc-calendar-publishing';
-    }
-
-    /**
-     * 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 Server $server
-     */
-    public function initialize(Server $server)
-    {
-        $this->server = $server;
-
-        $this->server->on('method:POST', [$this, 'httpPost']);
-        $this->server->on('propFind',    [$this, 'propFind']);
-    }
+       {
+               // May have to be changed to be detected
+               return ['oc-calendar-publishing'];
+       }
+
+       /**
+        * Returns a plugin name.
+        *
+        * Using this name other plugins will be able to access other plugins
+        * using Sabre\DAV\Server::getPlugin
+        *
+        * @return string
+        */
+       public function getPluginName()
+       {
+               return 'oc-calendar-publishing';
+       }
+
+       /**
+        * 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 Server $server
+        */
+       public function initialize(Server $server)
+       {
+               $this->server = $server;
+
+               $this->server->on('method:POST', [$this, 'httpPost']);
+               $this->server->on('propFind',    [$this, 'propFind']);
+       }
 
        public function propFind(PropFind $propFind, INode $node)
-    {
-        if ($node instanceof Calendar) {
-            $token = md5($this->config->getSystemValue('secret', '').$node->getResourceId());
+       {
+               if ($node instanceof Calendar) {
+                       $token = md5($this->config->getSystemValue('secret', '').$node->getResourceId());
 
-            $publishUrl = $this->urlGenerator->getAbsoluteURL($this->server->getBaseUri().'public-calendars/').$token;
+                       $publishUrl = $this->urlGenerator->getAbsoluteURL($this->server->getBaseUri().'public-calendars/').$token;
 
-            $propFind->handle('{'.self::NS_CALENDARSERVER.'}publish-url', function () use ($node, $publishUrl) {
-                if ($node->getPublishStatus()) {
+                       $propFind->handle('{'.self::NS_CALENDARSERVER.'}publish-url', function () use ($node, $publishUrl) {
+                               if ($node->getPublishStatus()) {
                                        // We return the publish-url only if the calendar is published.
-                    return new Publisher($publishUrl, true);
-                }
-            });
+                                       return new Publisher($publishUrl, true);
+                               }
+                       });
 
-            $propFind->handle('{'.self::NS_CALENDARSERVER.'}pre-publish-url', function () use ($node, $publishUrl) {
+                       $propFind->handle('{'.self::NS_CALENDARSERVER.'}pre-publish-url', function () use ($node, $publishUrl) {
                                // The pre-publish-url is always returned
-                return new Publisher($publishUrl, false);
-            });
-        }
-    }
+                               return new Publisher($publishUrl, false);
+                       });
+               }
+       }
 
        /**
         * We intercept this to handle POST requests on calendars.