course_create_content.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  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. echo get_lang('DummyCourseOnlyOnTestServer');
  23. } elseif (isset($_POST['action'])) {
  24. require_once api_get_path(SYS_CODE_PATH).'coursecopy/classes/DummyCourseCreator.class.php';
  25. $dcc = new DummyCourseCreator();
  26. $dcc->create_dummy_course($_POST['course_code']);
  27. echo get_lang('Done');
  28. } else {
  29. echo get_lang('DummyCourseDescription');
  30. echo '<form method="post"><input type="hidden" name="course_code" value="'.Security::remove_XSS(
  31. $_GET['course_code']
  32. ).'"/><input type="submit" name="action" value="'.get_lang('Ok').'"/></form>';
  33. }
  34. Display::display_footer();