gradebook_add_link_select_course.php 1.4 KB

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