course_create_content.php 1.1 KB

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