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 authenticate(AT_PRIV_FORUMS);
20 require (AT_INCLUDE_PATH.'../mods/_standard/forums/lib/forums.inc.php');
22 if (isset($_POST['submit_no'])) {
23 $msg->addFeedback('CANCELLED');
24 header('Location: '.AT_BASE_HREF.'mods/_standard/forums/index.php');
26 } else if (isset($_POST['submit_yes'])) {
27 $_POST['fid'] = intval($_POST['fid']);
29 // check if this forum is shared:
30 // (if this forum is shared, then we do not want to delete it.)
31 if (!is_shared_forum($_POST['fid']) && valid_forum_user($_POST['fid'])) {
32 delete_forum($_POST['fid']);
33 $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
35 $msg->addError('FORUM_NO_DEL_SHARE');
38 header('Location: '.AT_BASE_HREF.'mods/_standard/forums/index.php');
42 $_section[0][0] = _AT('discussions');
43 $_section[0][1] = 'discussions/';
44 $_section[1][0] = _AT('forums');
45 $_section[1][1] = 'forum/list.php';
46 $_section[2][0] = _AT('delete_forum');
48 require(AT_INCLUDE_PATH.'header.inc.php');
51 $_GET['fid'] = intval($_GET['fid']);
53 $row = get_forum($_GET['fid'], $_SESSION['course_id']);
55 if (!is_array($row)) {
56 $msg->addError('FORUM_NOT_ADDED');
58 <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
59 <input type="hidden" name="delete_forum" value="true">
60 <input type="hidden" name="fid" value="<?php echo $_GET['fid']; ?>">
63 $hidden_vars['delete_forum'] = TRUE;
64 $hidden_vars['fid'] = $_GET['fid'];
66 $confirm = array('DELETE_FORUM', AT_print($row['title'], 'forums.title'));
67 $msg->addConfirm($confirm, $hidden_vars);
72 require(AT_INCLUDE_PATH.'footer.inc.php');