$dialogBox->error(get_lang('Category can\'t be linked to one of its own children')); } elseif (claro_failure::get_last_failure() == 'category_missing_field') { $dialogBox->error(get_lang('Some fields are missing')); } $dialogBox->form($category->displayForm()); } break; // Delete an existing category // Delete an existing category case 'exDelete': $category = new claroCategory(); if ($category->load($id)) { if (ClaroCategory::countSubCategories($category->id) > 0) { $dialogBox->error(get_lang('You cannot delete a category having sub categories')); } else { $category->delete(); $dialogBox->success(get_lang('Category deleted. Courses linked to this category have been linked to the root category.')); } } else { $dialogBox->error(get_lang('Category not found')); } break; // Shift or displace category (up) // Shift or displace category (up) case 'exMoveUp': $category = new claroCategory(); if ($category->load($id)) { $category->decreaseRank(); if (claro_failure::get_last_failure() == 'category_no_predecessor') { $dialogBox->error(get_lang('This category can\'t be moved up')); } else {