Filter out special Favorites category.
This commit is contained in:
parent
fc6d1bf500
commit
ab167c3e2c
|
@ -140,15 +140,24 @@ class OC_VCategories {
|
|||
if($format == self::FORMAT_MAP) {
|
||||
$catmap = array();
|
||||
foreach($categories as $category) {
|
||||
if($category !== self::CATEGORY_FAVORITE) {
|
||||
$catmap[] = array(
|
||||
'id' => $this->array_searchi($category, self::$categories),
|
||||
'name' => $category
|
||||
);
|
||||
}
|
||||
}
|
||||
return $catmap;
|
||||
}
|
||||
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the a list if items belonging to $category.
|
||||
|
|
Loading…
Reference in New Issue