class_edit.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?php
  2. // $Id: class_edit.php 10215 2006-11-27 13:57:17Z pcool $
  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. For a full list of contributors, see "credits.txt".
  11. The full license can be read in "license.txt".
  12. This program is free software; you can redistribute it and/or
  13. modify it under the terms of the GNU General Public License
  14. as published by the Free Software Foundation; either version 2
  15. of the License, or (at your option) any later version.
  16. See the GNU General Public License for more details.
  17. Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
  18. ==============================================================================
  19. */
  20. /**
  21. ==============================================================================
  22. * @package dokeos.admin
  23. ==============================================================================
  24. */
  25. // name of the language file that needs to be included
  26. $language_file = 'admin';
  27. // resetting the course id
  28. $cidReset = true;
  29. // including some necessary dokeos files
  30. include ('../inc/global.inc.php');
  31. require_once(api_get_path(LIBRARY_PATH).'classmanager.lib.php');
  32. require_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
  33. // setting the section (for the tabs)
  34. $this_section=SECTION_PLATFORM_ADMIN;
  35. // Access restrictions
  36. api_protect_admin_script();
  37. // setting breadcrumbs
  38. $interbreadcrumb[] = array ("url" => 'index.php', "name" => get_lang('PlatformAdmin'));
  39. $interbreadcrumb[] = array ("url" => "class_list.php", "name" => get_lang('AdminClasses'));
  40. // setting the name of the tool
  41. $tool_name = get_lang("AddClasses");
  42. $tool_name = get_lang('ModifyClassInfo');
  43. $class_id = intval($_GET['idclass']);
  44. $class = ClassManager :: get_class_info($class_id);
  45. $form = new FormValidator('edit_class','post','class_edit.php?idclass='.$class_id);
  46. $form->add_textfield('name',get_lang('ClassName'));
  47. $form->addElement('submit','submit',get_lang('Ok'));
  48. $form->setDefaults(array('name'=>$class['name']));
  49. if($form->validate())
  50. {
  51. $values = $form->exportValues();
  52. ClassManager :: set_name($values['name'], $class_id);
  53. header('Location: class_list.php');
  54. }
  55. Display :: display_header($tool_name);
  56. //api_display_tool_title($tool_name);
  57. $form->display();
  58. /*
  59. ==============================================================================
  60. FOOTER
  61. ==============================================================================
  62. */
  63. Display :: display_footer();
  64. ?>