Ejemplo n.º 1
0
            $category->increaseRank();
            if (claro_failure::get_last_failure() == 'category_no_successor') {
                $dialogBox->error(get_lang('This category can\'t be moved down'));
            } else {
                $dialogBox->success(get_lang('Category moved down'));
            }
        } else {
            $dialogBox->error(get_lang('Category not found'));
        }
        break;
        // Change the visibility of a category
    // Change the visibility of a category
    case 'exVisibility':
        $category = new claroCategory(null, null, null, null, null, null, null, null);
        if ($category->load($id)) {
            if ($category->swapVisibility()) {
                $dialogBox->success(get_lang('Category\'s visibility modified'));
            } else {
                switch (claro_failure::get_last_failure()) {
                    case 'category_not_found':
                        $dialogBox->error(get_lang('Error : Category not found'));
                        break;
                }
            }
        } else {
            $dialogBox->error(get_lang('Category not found'));
        }
        break;
}
// Get categories
$categories = claroCategory::getAllCategories();