gradebook_add_link_select_course.php 1.3 KB

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