course_create_content.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * This script allows a platform admin to add dummy content to a course.
  5. *
  6. * @author Bart Mollet <bart.mollet@hogent.be>
  7. * @package chamilo.admin
  8. */
  9. /**
  10. * INIT SECTION
  11. */
  12. // name of the language file that needs to be included
  13. $language_file = 'admin';
  14. //include ('../inc/global.inc.php');
  15. $this_section=SECTION_PLATFORM_ADMIN;
  16. api_protect_admin_script();
  17. $tool_name = get_lang('DummyCourseCreator');
  18. $interbreadcrumb[] = array ("url" => 'index.php', "name" => get_lang('PlatformAdmin'));
  19. Display::display_header($tool_name);
  20. //api_display_tool_title($tool_name);
  21. if(api_get_setting('server_type') != 'test')
  22. {
  23. echo get_lang('DummyCourseOnlyOnTestServer');
  24. }
  25. elseif( isset($_POST['action']))
  26. {
  27. require_once('../coursecopy/classes/DummyCourseCreator.class.php');
  28. $dcc = new DummyCourseCreator();
  29. $dcc->create_dummy_course($_POST['course_code']);
  30. echo get_lang('Done');
  31. }
  32. else
  33. {
  34. echo get_lang('DummyCourseDescription');
  35. echo '<form method="post"><input type="hidden" name="course_code" value="'.Security::remove_XSS($_GET['course_code']).'"/><input type="submit" name="action" value="'.get_lang('Ok').'"/></form>';
  36. }
  37. /*
  38. ==============================================================================
  39. FOOTER
  40. ==============================================================================
  41. */
  42. Display::display_footer();
  43. ?>