diff options
author | Thomas Tanghus <thomas@tanghus.net> | 2012-10-20 13:42:57 +0200 |
---|---|---|
committer | Thomas Tanghus <thomas@tanghus.net> | 2012-10-20 13:42:57 +0200 |
commit | ab167c3e2c55895fddac50cd1c9d8d5d92b10845 (patch) | |
tree | 1e5c35c00ae9933e2f6992d63bd0f3919ee8e1bc /lib/vcategories.php | |
parent | fc6d1bf5006f6630f342eed92cad25167a5d4d8e (diff) | |
download | nextcloud-server-ab167c3e2c55895fddac50cd1c9d8d5d92b10845.tar.gz nextcloud-server-ab167c3e2c55895fddac50cd1c9d8d5d92b10845.zip |
Filter out special Favorites category.
Diffstat (limited to 'lib/vcategories.php')
-rw-r--r-- | lib/vcategories.php | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/lib/vcategories.php b/lib/vcategories.php index fb315ca960f..2ea70d167fd 100644 --- a/lib/vcategories.php +++ b/lib/vcategories.php @@ -140,14 +140,23 @@ class OC_VCategories { if($format == self::FORMAT_MAP) { $catmap = array(); foreach($categories as $category) { - $catmap[] = array( - 'id' => $this->array_searchi($category, self::$categories), - 'name' => $category - ); + if($category !== self::CATEGORY_FAVORITE) { + $catmap[] = array( + 'id' => $this->array_searchi($category, self::$categories), + 'name' => $category + ); + } } return $catmap; } - return $categories; + + // Don't add favorites to normal categories. + $favpos = array_search(self::CATEGORY_FAVORITE, $categories); + if($favpos !== false) { + return array_splice($categories, $favpos); + } else { + return $categories; + } } /** |