2 /************************************************************************/
4 /************************************************************************/
5 /* Copyright (c) 2010 */
6 /* Inclusive Design Institute */
8 /* This program is free software. You can redistribute it and/or */
9 /* modify it under the terms of the GNU General Public License */
10 /* as published by the Free Software Foundation. */
11 /************************************************************************/
13 define('TR_INCLUDE_PATH', '../../include/');
14 require(TR_INCLUDE_PATH.'vitals.inc.php');
16 global $_content_id, $_content_id, $contentManager;
18 Utility::authenticate(TR_PRIV_ISAUTHOR);
20 $cid = $_GET['cid'] = $_content_id;
22 if (isset($_POST['submit_yes'])) {
24 $cid = intval($_POST['_cid']);
26 $result = $contentManager->deleteContent($cid);
28 unset($_SESSION['s_cid']);
29 unset($_SESSION['from_cid']);
31 $msg->addFeedback('CONTENT_DELETED');
32 header('Location: '.TR_BASE_HREF.'home/course/index.php?_course_id='.$_course_id);
34 } else if (isset($_POST['submit_no'])) {
35 $msg->addFeedback('CANCELLED');
36 $cid = intval($_POST['_cid']);
37 $row = $contentManager->getContentPage($cid);
38 if ($row['content_type'] == CONTENT_TYPE_FOLDER) {
39 header('Location: '.TR_BASE_HREF.'home/editor/edit_content_folder.php?_cid='.$cid);
41 header('Location: '.TR_BASE_HREF.'home/course/content.php?_cid='.$cid);
46 $path = $contentManager->getContentPath($cid);
47 require(TR_INCLUDE_PATH.'header.inc.php');
49 if ($_GET['cid'] == 0) {
50 $msg->printErrors('ID_ZERO');
51 require(TR_INCLUDE_PATH.'footer.inc.php');
55 $children = $contentManager->getContent($_GET['cid']);
57 $hidden_vars['_cid'] = $_GET['cid'];
59 if (is_array($children) && (count($children)>0) ) {
60 $msg->addConfirm('SUB_CONTENT_DELETE', $hidden_vars);
61 // $msg->addConfirm('GLOSSARY_REMAINS', $hidden_vars);
63 // $msg->addConfirm('GLOSSARY_REMAINS', $hidden_vars);
66 $row = $contentManager->getContentPage($_GET['cid']);
67 $title = $row['title'];
69 $msg->addConfirm(array('DELETE', $title), $hidden_vars);
72 require(TR_INCLUDE_PATH.'footer.inc.php');