course_create_content.php 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?php
  2. // $Id: course_create_content.php 9246 2006-09-25 13:24:53Z bmol $
  3. /*
  4. ==============================================================================
  5. Dokeos - elearning and course management software
  6. Copyright (c) 2004 Dokeos S.A.
  7. Copyright (c) 2003 Ghent University (UGent)
  8. Copyright (c) 2001 Universite catholique de Louvain (UCL)
  9. Copyright (c) Bart Mollet (bart.mollet@hogent.be)
  10. For a full list of contributors, see "credits.txt".
  11. The full license can be read in "license.txt".
  12. This program is free software; you can redistribute it and/or
  13. modify it under the terms of the GNU General Public License
  14. as published by the Free Software Foundation; either version 2
  15. of the License, or (at your option) any later version.
  16. See the GNU General Public License for more details.
  17. Contact address: Dokeos, 44 rue des palais, B-1030 Brussels, Belgium
  18. Mail: info@dokeos.com
  19. ==============================================================================
  20. */
  21. /**
  22. * ==============================================================================
  23. * This script allows a platform admin to add dummy content to a course.
  24. *
  25. * @author Bart Mollet <bart.mollet@hogent.be>
  26. * @package dokeos.admin
  27. * ==============================================================================
  28. */
  29. /*
  30. ==============================================================================
  31. INIT SECTION
  32. ==============================================================================
  33. */
  34. $langFile = 'admin';
  35. include ('../inc/global.inc.php');
  36. $this_section=SECTION_PLATFORM_ADMIN;
  37. api_protect_admin_script();
  38. $tool_name = get_lang('DummyCourseCreator');
  39. //$interbreadcrumb[] = array ("url" => "index.php", "name" => get_lang('PlatformAdmin'));
  40. Display::display_header($tool_name);
  41. //api_display_tool_title($tool_name);
  42. if( get_setting('server_type') != 'test')
  43. {
  44. echo get_lang('DummyCourseOnlyOnTestServer');
  45. }
  46. elseif( isset($_POST['action']))
  47. {
  48. require_once('../coursecopy/classes/DummyCourseCreator.class.php');
  49. $dcc = new DummyCourseCreator();
  50. $dcc->create_dummy_course($_POST['course_code']);
  51. echo get_lang('Done');
  52. }
  53. else
  54. {
  55. echo get_lang('DummyCourseDescription');
  56. echo '<form method="post"><input type="hidden" name="course_code" value="'.$_GET['course_code'].'"/><input type="submit" name="action" value="'.get_lang('Ok').'"/></form>';
  57. }
  58. /*
  59. ==============================================================================
  60. FOOTER
  61. ==============================================================================
  62. */
  63. Display::display_footer();
  64. ?>