]> source.dussan.org Git - nextcloud-server.git/commitdiff
Implement default categories in OC_VCategories
authorBart Visscher <bartv@thisnet.nl>
Thu, 12 Apr 2012 20:23:42 +0000 (22:23 +0200)
committerBart Visscher <bartv@thisnet.nl>
Thu, 12 Apr 2012 21:10:49 +0000 (23:10 +0200)
lib/vcategories.php

index 5a7bacd2025daf7fec17ed43d8cbd9aa460fb679..9d272eeabd44b9d7b1ee2399d80bff613fe30910 100644 (file)
@@ -50,13 +50,12 @@ class OC_VCategories {
        *   parameter should normally be omitted but to make an app able to
        *   update categories for all users it is made possible to provide it.
        * @param $defcategories An array of default categories to be used if none is stored.
-       * NOTE: Not implemented.
        */
-       public function __construct($app, $user=null, $defcategories=null) {
+       public function __construct($app, $user=null, $defcategories=array()) {
                $this->app = $app;
                $this->user = is_null($user) ? OC_User::getUser() : $user;
                $categories = trim(OC_Preferences::getValue($this->user, $app, self::PREF_CATEGORIES_LABEL, ''));
-               $this->categories = $categories != '' ? unserialize($categories) : array();
+               $this->categories = $categories != '' ? unserialize($categories) : $defcategories;
        }
 
        /**