|
|
|
@ -64,6 +64,7 @@ class OC_VCategories { |
|
|
|
|
*/ |
|
|
|
|
public function categories() { |
|
|
|
|
OC_Log::write('core','OC_VCategories::categories: '.print_r($this->categories, true), OC_Log::DEBUG); |
|
|
|
|
usort($this->categories, 'strnatcasecmp'); // usort to also renumber the keys |
|
|
|
|
return $this->categories; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -96,7 +97,6 @@ class OC_VCategories { |
|
|
|
|
} |
|
|
|
|
if(count($newones) > 0) { |
|
|
|
|
$this->categories = array_merge($this->categories, $newones); |
|
|
|
|
natcasesort($this->categories); // Dunno if this is necessary |
|
|
|
|
if($sync === true) { |
|
|
|
|
$this->save(); |
|
|
|
|
} |
|
|
|
@ -146,6 +146,7 @@ class OC_VCategories { |
|
|
|
|
* @brief Save the list with categories |
|
|
|
|
*/ |
|
|
|
|
private function save() { |
|
|
|
|
usort($this->categories, 'strnatcasecmp'); // usort to also renumber the keys |
|
|
|
|
$escaped_categories = serialize($this->categories); |
|
|
|
|
OC_Log::write('core','OC_VCategories::save: '.print_r($this->categories, true), OC_Log::DEBUG); |
|
|
|
|
OC_Preferences::setValue($this->user, $this->app, self::PREF_CATEGORIES_LABEL, $escaped_categories); |
|
|
|
|