class_add.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. // $Id: class_add.php 9246 2006-09-25 13:24:53Z bmol $
  3. /*
  4. ==============================================================================
  5. Dokeos - elearning and course management software
  6. Copyright (c) 2004 Dokeos S.A.
  7. Copyright (c) 2003 Ghent University (UGent)
  8. Copyright (c) 2001 Universite catholique de Louvain (UCL)
  9. Copyright (c) Olivier Brouckaert
  10. Copyright (c) Bart Mollet, Hogeschool Gent
  11. For a full list of contributors, see "credits.txt".
  12. The full license can be read in "license.txt".
  13. This program is free software; you can redistribute it and/or
  14. modify it under the terms of the GNU General Public License
  15. as published by the Free Software Foundation; either version 2
  16. of the License, or (at your option) any later version.
  17. See the GNU General Public License for more details.
  18. Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
  19. ==============================================================================
  20. */
  21. /**
  22. ==============================================================================
  23. * @package dokeos.admin
  24. ==============================================================================
  25. */
  26. $langFile = 'admin';
  27. $cidReset = true;
  28. include ('../inc/global.inc.php');
  29. $this_section=SECTION_PLATFORM_ADMIN;
  30. require_once (api_get_path(LIBRARY_PATH).'classmanager.lib.php');
  31. require_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
  32. api_protect_admin_script();
  33. $form = new FormValidator('add_class');
  34. $form->add_textfield('name',get_lang('ClassName'));
  35. $form->addElement('submit','submit',get_lang('Ok'));
  36. if($form->validate())
  37. {
  38. $values = $form->exportValues();
  39. ClassManager :: create_class($values['name']);
  40. header('Location: class_list.php');
  41. }
  42. $tool_name = get_lang("AddClasses");
  43. //$interbreadcrumb[] = array ("url" => "index.php", "name" => get_lang('PlatformAdmin'));
  44. Display :: display_header($tool_name);
  45. //api_display_tool_title($tool_name);
  46. $form->display();
  47. /*
  48. ==============================================================================
  49. FOOTER
  50. ==============================================================================
  51. */
  52. Display :: display_footer();
  53. ?>