delete_course.php 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?php
  2. // $Id: delete_course.php 17195 2008-12-09 23:47:07Z iflorespaz $
  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. // name of the language file that needs to be included
  32. $language_file = array ('admin','course_info');
  33. include ('../inc/global.inc.php');
  34. include (api_get_path(LIBRARY_PATH).'course.lib.php');
  35. require_once '../gradebook/lib/be/gradebookitem.class.php';
  36. require_once '../gradebook/lib/be/category.class.php';
  37. $this_section = SECTION_COURSES;
  38. $currentCourseCode = $_course['official_code'];
  39. $currentCourseName = $_course['name'];
  40. if (!api_is_allowed_to_edit())
  41. {
  42. api_not_allowed(true);
  43. }
  44. $tool_name = get_lang('DelCourse');
  45. if (isset($_GET['delete']) && $_GET['delete'] == 'yes')
  46. {
  47. CourseManager :: delete_course($_course['sysCode']);
  48. $obj_cat=new Category();
  49. $obj_cat->update_category_delete($_course['sysCode']);
  50. // DELETE CONFIRMATION MESSAGE
  51. unset ($_course);
  52. unset ($_cid);
  53. $noPHP_SELF = true;
  54. $message = get_lang('Course')." &quot;".$currentCourseName."&quot; "."(".$currentCourseCode.") ".get_lang('HasDel');
  55. $message .= "<br /><br /><a href=\"../../index.php\">".get_lang('BackHome')." ".api_get_setting('siteName')."</a>";
  56. } // end if $delete
  57. else
  58. {
  59. $message = "&quot;".$currentCourseName."&quot; "."(".$currentCourseCode.") "."<p>".get_lang("ByDel")."</p>"."<p>"."<a href=\"maintenance.php\">".get_lang("N")."</a>"."&nbsp;&nbsp;|&nbsp;&nbsp;"."<a href=\"".api_get_self()."?delete=yes\">".get_lang("Y")."</a>"."</p>";
  60. $interbreadcrumb[] = array ("url" => "maintenance.php", "name" => get_lang('Maintenance'));
  61. }
  62. Display :: display_header($tool_name, "Settings");
  63. api_display_tool_title($tool_name);
  64. Display::display_warning_message($message,false);
  65. /*
  66. ==============================================================================
  67. FOOTER
  68. ==============================================================================
  69. */
  70. Display :: display_footer();
  71. ?>