course_create_content.php 1.2 KB

12345678910111213141516171819202122232425262728293031
  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. // name of the language file that needs to be included
  10. $language_file = 'admin';
  11. include ('../inc/global.inc.php');
  12. $this_section=SECTION_PLATFORM_ADMIN;
  13. api_protect_admin_script();
  14. $tool_name = get_lang('DummyCourseCreator');
  15. $interbreadcrumb[] = array ("url" => 'index.php', "name" => get_lang('PlatformAdmin'));
  16. Display::display_header($tool_name);
  17. //api_display_tool_title($tool_name);
  18. if (api_get_setting('server_type') != 'test') {
  19. echo get_lang('DummyCourseOnlyOnTestServer');
  20. } elseif( isset($_POST['action'])) {
  21. require_once('../coursecopy/classes/DummyCourseCreator.class.php');
  22. $dcc = new DummyCourseCreator();
  23. $dcc->create_dummy_course($_POST['course_code']);
  24. echo get_lang('Done');
  25. } else {
  26. echo get_lang('DummyCourseDescription');
  27. 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>';
  28. }
  29. Display::display_footer();