2 /****************************************************************/
\r
4 /****************************************************************/
\r
5 /* Copyright (c) 2002-2008 by Greg Gay & Joel Kronenberg */
\r
6 /* Adaptive Technology Resource Centre / University of Toronto */
\r
7 /* http://atutor.ca */
\r
9 /* This program is free software. You can redistribute it and/or*/
\r
10 /* modify it under the terms of the GNU General Public License */
\r
11 /* as published by the Free Software Foundation. */
\r
12 /****************************************************************/
\r
16 define('AT_INCLUDE_PATH', '../../include/');
\r
17 require(AT_INCLUDE_PATH.'vitals.inc.php');
\r
18 authenticate(AT_PRIV_FORUMS);
\r
20 if (isset($_GET['edit'], $_GET['id'])) {
\r
21 header('Location: '.AT_BASE_HREF.'editor/edit_forum.php?fid='.intval($_GET['id']));
\r
23 } else if (isset($_GET['delete'], $_GET['id'])) {
\r
24 header('Location: '.AT_BASE_HREF.'editor/delete_forum.php?fid='.intval($_GET['id']));
\r
26 } else if (isset($_GET['edit']) || isset($_GET['delete'])) {
\r
27 $msg->addError('NO_ITEM_SELECTED');
\r
30 require(AT_INCLUDE_PATH.'lib/forums.inc.php');
\r
32 require(AT_INCLUDE_PATH.'header.inc.php');
\r
35 $all_forums = get_forums($_SESSION['course_id']);
\r
37 <form name="form" method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>">
\r
39 <table class="data" summary="" rules="cols">
\r
42 <th scope="col"> </th>
\r
43 <th scope="col"><?php echo _AT('title'); ?></th>
\r
44 <th scope="col"><?php echo _AT('description'); ?></th>
\r
45 <th scope="col"><?php echo _AT('allow_editing'); ?></th>
\r
50 <td colspan="4"><input type="submit" name="edit" value="<?php echo _AT('edit'); ?>" /> <input type="submit" name="delete" value="<?php echo _AT('delete'); ?>" /></td>
\r
54 <?php if ($all_forums['nonshared']): ?>
\r
55 <?php foreach($all_forums['nonshared'] as $row): ?>
\r
56 <tr onmousedown="document.form['f<?php echo $row['forum_id']; ?>'].checked = true; rowselect(this);" id="r_<?php echo $row['forum_id']; ?>">
\r
57 <td width="10"><input type="radio" name="id" value="<?php echo $row['forum_id']; ?>" id="f<?php echo $row['forum_id']; ?>" /></td>
\r
58 <td><label for="f<?php echo $row['forum_id']; ?>"><?php echo AT_print($row['title'], 'forums.title'); ?></label></td>
\r
59 <td><?php echo AT_print($row['description'], 'forums.description'); ?></td>
\r
61 <?php if (!$row['mins_to_edit']): ?>
\r
62 <?php echo _AT('no'); ?>
\r
64 <?php echo _AT('minutes', $row['mins_to_edit']); ?>
\r
68 <?php endforeach; ?>
\r
71 <td colspan="4"><?php echo _AT('none_found'); ?></td>
\r
78 <?php require(AT_INCLUDE_PATH.'footer.inc.php'); ?>