delete_course.php 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <?php
  2. // $Id: delete_course.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) Olivier brouckaert
  10. Copyright (c) Roan Embrechts
  11. Copyright (c) Bart Mollet, Hogeschool Gent
  12. For a full list of contributors, see "credits.txt".
  13. The full license can be read in "license.txt".
  14. This program is free software; you can redistribute it and/or
  15. modify it under the terms of the GNU General Public License
  16. as published by the Free Software Foundation; either version 2
  17. of the License, or (at your option) any later version.
  18. See the GNU General Public License for more details.
  19. Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
  20. ==============================================================================
  21. */
  22. /**
  23. ==============================================================================
  24. * This script is about deleting a course.
  25. * It displays a message box ('are you sure you wish to delete this course')
  26. * and deletes the course if the user answers affirmatively
  27. *
  28. * @package dokeos.course_info
  29. ==============================================================================
  30. */
  31. $langFile = 'course_info';
  32. include ('../inc/global.inc.php');
  33. include (api_get_path(LIBRARY_PATH).'course.lib.php');
  34. $this_section = SECTION_COURSES;
  35. $currentCourseCode = $_course['official_code'];
  36. $currentCourseName = $_course['name'];
  37. if (!api_is_allowed_to_edit())
  38. {
  39. api_not_allowed();
  40. }
  41. $tool_name = get_lang('DelCourse');
  42. if (isset($_GET['delete']) && $_GET['delete'] == 'yes')
  43. {
  44. CourseManager :: delete_course($_course['sysCode']);
  45. // DELETE CONFIRMATION MESSAGE
  46. unset ($_course);
  47. unset ($_cid);
  48. $noPHP_SELF = true;
  49. $message = get_lang('Course')." &quot;".$currentCourseName."&quot; "."(".$currentCourseCode.") ".get_lang('HasDel');
  50. $message .= "<br /><br /><a href=\"../../index.php\">".get_lang('BackHome')." ".get_setting('siteName')."</a>";
  51. } // end if $delete
  52. else
  53. {
  54. $message = "&quot;".$currentCourseName."&quot; "."(".$currentCourseCode.") "."<p>".get_lang("ByDel")."</p>"."<p>"."<a href=\"infocours.php\">".get_lang("N")."</a>"."&nbsp;&nbsp;|&nbsp;&nbsp;"."<a href=\"".$_SERVER['PHP_SELF']."?delete=yes\">".get_lang("Y")."</a>"."</p>";
  55. $interbreadcrumb[] = array ("url" => "infocours.php", "name" => get_lang('ModifInfo'));
  56. }
  57. Display :: display_header($tool_name, "Settings");
  58. api_display_tool_title($tool_name);
  59. Display::display_normal_message($message);
  60. /*
  61. ==============================================================================
  62. FOOTER
  63. ==============================================================================
  64. */
  65. Display :: display_footer();
  66. ?>