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