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) {
|
if($format == self::FORMAT_MAP) {
|
||||||
$catmap = array();
|
$catmap = array();
|
||||||
foreach($categories as $category) {
|
foreach($categories as $category) {
|
||||||
|
if($category !== self::CATEGORY_FAVORITE) {
|
||||||
$catmap[] = array(
|
$catmap[] = array(
|
||||||
'id' => $this->array_searchi($category, self::$categories),
|
'id' => $this->array_searchi($category, self::$categories),
|
||||||
'name' => $category
|
'name' => $category
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return $catmap;
|
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;
|
return $categories;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the a list if items belonging to $category.
|
* Get the a list if items belonging to $category.
|
||||||
|
|
Loading…
Reference in New Issue