2 /****************************************************************************/
4 /****************************************************************************/
5 /* Copyright (c) 2002-2008 by Greg Gay, Joel Kronenberg & Heidi Hazelton */
6 /* Adaptive Technology Resource Centre / University of Toronto */
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 /****************************************************************************/
14 define('AT_INCLUDE_PATH', '../include/');
15 require (AT_INCLUDE_PATH.'vitals.inc.php');
17 authenticate(AT_PRIV_FORUMS);
19 if ($_POST['cancel']) {
20 $msg->addFeedback('CANCELLED');
21 header('Location: '.AT_BASE_HREF.'tools/forums/index.php');
25 if ($_POST['add_forum'] && (authenticate(AT_PRIV_FORUMS, AT_PRIV_RETURN))) {
26 if ($_POST['title'] == '') {
27 $msg->addError(array('EMPTY_FIELDS', _AT('title')));
29 $_POST['title'] = validate_length($_POST['title'], 60);
32 if (!$msg->containsErrors()) {
33 require(AT_INCLUDE_PATH.'lib/forums.inc.php');
36 $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
37 header('Location: '.AT_BASE_HREF.'tools/forums/index.php');
42 $onload = 'document.form.title.focus();';
44 require(AT_INCLUDE_PATH.'header.inc.php');
48 <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="form">
49 <input type="hidden" name="add_forum" value="true">
51 <div class="input-form">
53 <div class="required" title="<?php echo _AT('required_field'); ?>">*</div><label for="title"><?php echo _AT('title'); ?></label><br />
54 <input type="text" name="title" size="40" id="title" />
57 <label for="body"><?php echo _AT('description'); ?></label><br />
58 <textarea name="body" cols="45" rows="2" id="body" wrap="wrap"></textarea>
61 <label for="edit"><?php echo _AT('allow_editing'); ?></label><br />
62 <input type="text" name="edit" size="3" id="edit" value="<?php echo intval($row['mins_to_edit']); ?>" /> <?php echo _AT('in_minutes'); ?>
64 <div class="row buttons">
65 <input type="submit" name="submit" value="<?php echo _AT('save'); ?>" accesskey="s" />
66 <input type="submit" name="cancel" value="<?php echo _AT('cancel'); ?>" />
71 <?php require(AT_INCLUDE_PATH.'footer.inc.php'); ?>