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['cancel'])) {
23 $msg->addFeedback('CANCELLED');
24 header('Location: '.AT_BASE_HREF.'mods/_standard/forums/index.php');
26 } else if (isset($_POST['edit_forum'])) {
27 $_POST['fid'] = intval($_POST['fid']);
29 if ($_POST['title'] == '') {
30 $msg->addError(array('EMPTY_FIELDS', _AT('title')));
32 $_POST['title'] = validate_length($_POST['title'], 60);
35 if (!$msg->containsErrors()) {
36 if (!is_shared_forum($_POST['fid'])) {
38 $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
40 $msg->addError('FORUM_NO_EDIT_SHARE');
43 header('Location: '.AT_BASE_HREF.'mods/_standard/forums/index.php');
48 $onload = 'document.form.title.focus();';
49 require(AT_INCLUDE_PATH.'header.inc.php');
51 $fid = intval($_REQUEST['fid']);
53 if (!isset($_POST['submit'])) {
54 $row = get_forum($fid, $_SESSION['course_id']);
55 if (!is_array($row)) {
56 $msg->addError('FORUM_NOT_FOUND');
58 require(AT_INCLUDE_PATH.'footer.inc.php');
62 $row['description'] = $_POST['body'];
63 $row['mins_to_edit'] = $_POST['edit'];
67 $savant->assign('row', $row);
68 $savant->assign('fid', $fid);
69 $savant->display('instructor/forums/edit_forum.tmpl.php');
70 require(AT_INCLUDE_PATH.'footer.inc.php'); ?>