gradebook_add_link_select_course.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * Script
  5. * @package chamilo.gradebook
  6. */
  7. //$cidReset = true;
  8. require_once '../inc/global.inc.php';
  9. $current_course_tool = TOOL_GRADEBOOK;
  10. api_protect_course_script(true);
  11. api_block_anonymous_users();
  12. GradebookUtils::block_students();
  13. $catadd = new Category();
  14. $catadd->set_user_id(api_get_user_id());
  15. $catadd->set_parent_id($_GET['selectcat']);
  16. $catcourse = Category :: load ($_GET['selectcat']);
  17. $form = new CatForm(
  18. CatForm :: TYPE_SELECT_COURSE,
  19. $catadd,
  20. 'add_cat_form',
  21. null,
  22. api_get_self() . '?selectcat=' . Security::remove_XSS($_GET['selectcat']).'&'.api_get_cidreq()
  23. );
  24. if ($form->validate()) {
  25. $values = $form->exportValues();
  26. $cat = new Category();
  27. $cat->set_course_code($values['select_course']);
  28. $cat->set_name($values['name']);
  29. header('location: gradebook_add_link.php?selectcat=' .Security::remove_XSS($_GET['selectcat']).'&course_code='.Security::remove_XSS($values['select_course']).'&'.api_get_cidreq());
  30. exit;
  31. }
  32. $interbreadcrumb[] = array (
  33. 'url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?selectcat='.Security::remove_XSS($_GET['selectcat']).'&'.api_get_cidreq(),
  34. 'name' => get_lang('Gradebook')
  35. );
  36. Display :: display_header(get_lang('NewCategory'));
  37. $form->display();
  38. Display :: display_footer();