2 /****************************************************************/
4 /****************************************************************/
5 /* Copyright (c) 2002-2010 */
6 /* Inclusive Design Institute */
9 /* This program is free software. You can redistribute it and/or*/
10 /* modify it under the terms of the GNU General Public License */
11 /* as published by the Free Software Foundation. */
12 /****************************************************************/
15 define('AT_INCLUDE_PATH', '../../../include/');
16 require(AT_INCLUDE_PATH.'vitals.inc.php');
18 if (isset($_POST['submit_yes'])) {
20 $_POST['cid'] = intval($_POST['cid']);
22 $result = $contentManager->deleteContent($_POST['cid']);
24 unset($_SESSION['s_cid']);
25 unset($_SESSION['from_cid']);
27 $msg->addFeedback('CONTENT_DELETED');
28 header('Location: '.AT_BASE_HREF.'mods/_core/content/index.php');
30 } else if (isset($_POST['submit_no'])) {
31 $msg->addFeedback('CANCELLED');
32 header('Location: '.AT_BASE_HREF.'mods/_core/content/index.php');
36 $_GET['cid'] = intval($_REQUEST['cid']);
39 require(AT_INCLUDE_PATH.'header.inc.php');
41 if ($_GET['cid'] == 0) {
42 $msg->printErrors('ID_ZERO');
43 require(AT_INCLUDE_PATH.'footer.inc.php');
47 $children = $contentManager->getContent($_GET['cid']);
49 $hidden_vars['cid'] = $_GET['cid'];
51 if (is_array($children) && (count($children)>0) ) {
52 $msg->addConfirm('SUB_CONTENT_DELETE', $hidden_vars);
53 $msg->addConfirm('GLOSSARY_REMAINS', $hidden_vars);
55 $msg->addConfirm('GLOSSARY_REMAINS', $hidden_vars);
58 $sql = "SELECT * from ".TABLE_PREFIX."content WHERE content_id = '$hidden_vars[cid]'";
59 $result = mysql_query($sql, $db);
60 while ($row = mysql_fetch_assoc($result)){
61 $title = $row['title'];
64 $msg->addConfirm(array('DELETE', $title), $hidden_vars);
67 require(AT_INCLUDE_PATH.'footer.inc.php');