Ejemplo n.º 1
0
    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();
// Command list
$cmdList = array();
$cmdList[] = array('img' => 'category_new', 'name' => get_lang('Create a category'), 'url' => $_SERVER['PHP_SELF'] . '?cmd=rqAdd');
// Display
$template = new CoreTemplate('admin_category.tpl.php');
$template->assign('title', claro_html_tool_title($nameTools, null, $cmdList));
$template->assign('dialogBox', $dialogBox);
$template->assign('categories', $categories);
// Append output
Claroline::getDisplay()->body->appendContent($template->render());
// Generate output
echo Claroline::getDisplay()->render();