class_edit.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * @package chamilo.admin
  5. */
  6. /**
  7. * Code
  8. */
  9. // Resetting the course id.
  10. $cidReset = true;
  11. // Including some necessary dokeos files.
  12. require_once '../inc/global.inc.php';
  13. // Setting the section (for the tabs).
  14. $this_section = SECTION_PLATFORM_ADMIN;
  15. // Access restrictions.
  16. api_protect_admin_script();
  17. // Setting breadcrumbs.
  18. $interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
  19. $interbreadcrumb[] = array ('url' => 'class_list.php', 'name' => get_lang('AdminClasses'));
  20. // Setting the name of the tool.
  21. $tool_name = get_lang('AddClasses');
  22. $tool_name = get_lang('ModifyClassInfo');
  23. $class_id = intval($_GET['idclass']);
  24. $class = ClassManager :: get_class_info($class_id);
  25. $form = new FormValidator('edit_class', 'post', 'class_edit.php?idclass='.$class_id);
  26. $form->addText('name',get_lang('ClassName'));
  27. $form->addButtonUpdate(get_lang('Ok'));
  28. $form->setDefaults(array('name'=>$class['name']));
  29. if($form->validate())
  30. {
  31. $values = $form->exportValues();
  32. ClassManager :: set_name($values['name'], $class_id);
  33. header('Location: class_list.php');
  34. }
  35. Display :: display_header($tool_name);
  36. //api_display_tool_title($tool_name);
  37. $form->display();
  38. // Displaying the footer.
  39. Display :: display_footer();