gradebook_add_link_select_course.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. // $Id: $
  3. /*
  4. ==============================================================================
  5. Dokeos - elearning and course management software
  6. Copyright (c) 2007 Dokeos S.A.
  7. Copyright (c) 2006 Ghent University (UGent)
  8. Copyright (c) various contributors
  9. For a full list of contributors, see "credits.txt".
  10. The full license can be read in "license.txt".
  11. This program is free software; you can redistribute it and/or
  12. modify it under the terms of the GNU General Public License
  13. as published by the Free Software Foundation; either version 2
  14. of the License, or (at your option) any later version.
  15. See the GNU General Public License for more details.
  16. Contact address: Dokeos, 44 rue des palais, B-1030 Brussels, Belgium
  17. Mail: info@dokeos.com
  18. ==============================================================================
  19. */
  20. $language_file = 'gradebook';
  21. $cidReset = true;
  22. include_once ('../inc/global.inc.php');
  23. include_once ('lib/be.inc.php');
  24. include_once ('lib/gradebook_functions.inc.php');
  25. include_once ('lib/fe/catform.class.php');
  26. api_block_anonymous_users();
  27. block_students();
  28. $catadd = new Category();
  29. $catadd->set_user_id($_user['user_id']);
  30. $catadd->set_parent_id($_GET['selectcat']);
  31. $catcourse = Category :: load ($_GET['selectcat']);
  32. //$catadd->set_course_code($catcourse[0]->get_course_code());
  33. $form = new CatForm(CatForm :: TYPE_SELECT_COURSE, $catadd, 'add_cat_form', null, api_get_self().'?selectcat=' . $_GET['selectcat']);
  34. if ($form->validate()) {
  35. $values = $form->exportValues();
  36. $cat = new Category();
  37. $cat->set_course_code($values['select_course']);
  38. $cat->set_name($values['name']);
  39. header('location: gradebook_add_link.php?selectcat=' .Security::remove_XSS($_GET['selectcat']).'&course_code='.Security::remove_XSS($values['select_course']));
  40. exit;
  41. }
  42. $interbreadcrumb[] = array (
  43. 'url' => 'gradebook.php?selectcat='.$_GET['selectcat'],
  44. 'name' => get_lang('Gradebook'
  45. ));
  46. Display :: display_header(get_lang('NewCategory'));
  47. $form->display();
  48. Display :: display_footer();
  49. ?>