3 if (!defined('AT_INCLUDE_PATH')) { exit; }
6 * Free form PHP can appear here to retreive current information
7 * from the module, or a text description of the module where there is
8 * not current information
13 $link_limit = 2; // Number of links to be displayed on "detail view" box
15 $groups_list = implode(',',$_SESSION['groups']);
18 if (authenticate(AT_PRIV_ASSIGNMENTS, AT_PRIV_RETURN)) { // instructor
19 $file_storage_assignments = array();
20 $sql = "SELECT * FROM ".TABLE_PREFIX."assignments WHERE course_id=$_SESSION[course_id] ORDER BY date_due DESC";
22 if ($groups_list <> '') {
23 $sql = "(SELECT a.title, date_due
24 FROM ".TABLE_PREFIX."groups_types gt, ".TABLE_PREFIX."groups g, ".TABLE_PREFIX."assignments a
25 WHERE g.group_id in (".$groups_list.")
26 AND g.group_id in (SELECT group_id FROM ".TABLE_PREFIX."file_storage_groups)
27 AND g.type_id = gt.type_id
28 AND gt.course_id = $_SESSION[course_id]
29 AND gt.type_id = a.assign_to
30 AND (a.date_cutoff=0 OR UNIX_TIMESTAMP(a.date_cutoff) > ".time()."))
34 $sql .= "(SELECT title, date_due
35 FROM ".TABLE_PREFIX."assignments
37 AND course_id=$_SESSION[course_id]
38 AND (date_cutoff=0 OR UNIX_TIMESTAMP(date_cutoff) > ".time()."))
39 ORDER BY date_due DESC";
41 $sql .= " LIMIT $link_limit";
42 $result = mysql_query($sql, $db);
44 if (mysql_num_rows($result) > 0) {
45 while ($row = mysql_fetch_assoc($result)) {
47 * SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY are defined in include/lib/constance.lib.inc
48 * SUBLINK_TEXT_LEN determins the maxium length of the string to be displayed on "detail view" box.
50 $title = $row['title'] . ' ('._AT("due_date").': '.$row['date_due'].')';
51 $list[] = '<a href="'.AT_BASE_HREF.'mods/assignment_dropbox/index.php">'.
53 // $list[] = '<a href="mods/assignment_dropbox/index.php"'.
54 // (strlen($row['value']) > SUBLINK_TEXT_LEN ? ' title="'.$row['value'].'"' : '') .'>'.
55 // validate_length($row['value'], SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY) .'</a>';