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 $msg->addFeedback('CONTENT_DELETED');
29 header('Location: '.TR_BASE_HREF.'home/course/index.php?_course_id='.$_course_id);
31 } else if (isset($_POST['submit_no'])) {
32 $msg->addFeedback('CANCELLED');
33 $cid = intval($_POST['_cid']);
34 $row = $contentManager->getContentPage($cid);
35 if ($row['content_type'] == CONTENT_TYPE_FOLDER) {
36 header('Location: '.TR_BASE_HREF.'home/editor/edit_content_folder.php?_cid='.$cid);
38 header('Location: '.TR_BASE_HREF.'home/course/content.php?_cid='.$cid);
43 $path = $contentManager->getContentPath($cid);
44 require(TR_INCLUDE_PATH.'header.inc.php');
46 if ($_GET['cid'] == 0) {
47 $msg->printErrors('ID_ZERO');
48 require(TR_INCLUDE_PATH.'footer.inc.php');
52 $children = $contentManager->getContent($_GET['cid']);
54 $hidden_vars['_cid'] = $_GET['cid'];
56 if (is_array($children) && (count($children)>0) ) {
57 $msg->addConfirm('SUB_CONTENT_DELETE', $hidden_vars);
58 // $msg->addConfirm('GLOSSARY_REMAINS', $hidden_vars);
60 // $msg->addConfirm('GLOSSARY_REMAINS', $hidden_vars);
63 $row = $contentManager->getContentPage($_GET['cid']);
64 $title = $row['title'];
66 $msg->addConfirm(array('DELETE', $title), $hidden_vars);
69 require(TR_INCLUDE_PATH.'footer.inc.php');