if ($COMMUNITY_ADMIN) { ?> <td style="border-left: none">Views</td> <?php } ?> </tr> </thead> <tbody> <?php foreach ($results as $key => $result) { $accessible = true; $parts = pathinfo($result["file_title"]); $ext = isset($parts["extension"]) && $parts["extension"] ? $parts["extension"] : ""; $params = array("action" => "file_download", "action_field" => "csfile_id", "action_value" => $result["csfile_id"], "module" => "community:" . $COMMUNITY_ID . ":shares"); $statistics = Models_Statistic::getCountByParams($params); if ($result["release_date"] && $result["release_date"] > time() || $result["release_until"] && $result["release_until"] < time()) { $accessible = false; } echo "<tr" . (!$accessible ? " class=\"na\"" : "") . ">\n"; echo " <td style=\"vertical-align: top\">"; echo "\t\t<a href=\"" . COMMUNITY_URL . $COMMUNITY_URL . ":" . $PAGE_URL . "?section=view-file&id=" . $result["csfile_id"] . "&download=latest\"><img src=\"" . ENTRADA_URL . "/community/templates/default/images/btn_save.gif\" alt=\"Download File\" title=\"Download File\"width=\"15\" border=\"0\" /></a>"; echo "\t</td>"; echo "\t<td style=\"vertical-align: top\">\n"; echo "\t\t<img src=\"" . ENTRADA_URL . "/serve-icon.php?ext=" . $ext . "\" width=\"16\" height=\"16\" alt=\"" . strtoupper($ext) . " Document\" title=\"" . strtoupper($ext) . " Document\" style=\"vertical-align: middle; margin-right: 4px\" /> <a id=\"file-" . (int) $result["csfile_id"] . "-title\" href=\"" . COMMUNITY_URL . $COMMUNITY_URL . ":" . $PAGE_URL . "?section=view-file&id=" . $result["csfile_id"] . "\" style=\"font-weight: bold; vertical-align: middle\">" . limit_chars(html_encode($result["file_title"]), 50, true) . "</a>\n"; echo "\t\t<div class=\"content-small\" style=\"padding-left: 23px\">"; echo shares_file_module_access($result["csfile_id"], "edit-file") ? " <span style=\"vertical-align: middle\">(<a class=\"action\" href=\"" . COMMUNITY_URL . $COMMUNITY_URL . ":" . $PAGE_URL . "?section=edit-file&id=" . $result["csfile_id"] . "\">edit</a>)</span>" : ""; echo shares_file_module_access($result["csfile_id"], "delete-file") ? " <span style=\"vertical-align: middle\">(<a class=\"action\" href=\"javascript:fileDelete('" . $result["csfile_id"] . "')\">delete</a>)</span>" : ""; if ($community_shares_select != "") { echo shares_file_module_access($result["csfile_id"], "move-file") ? " <span style=\"vertical-align: middle\">(<a class=\"action\" href=\"javascript:fileMove('" . $result["csfile_id"] . "')\">move</a>)</span>" : ""; }
} if ($ENTRADA_ACL->amIAllowed(new CourseContentResource($course_details["course_id"], $course_details["organisation_id"]), "update")) { echo "<td><a href=\"{$url}\">" . html_encode($result["name"]) . "</a></td>"; echo "<td><a href=\"{$url}\">" . $result["grade_weighting"] . "%</a></td>"; } else { echo "<td>" . html_encode($result["name"]) . "</td>"; echo "<td>" . $result["grade_weighting"] . "%</td>"; } $query = "\tSELECT a.`course_id`, a.`assignment_id`, a.`assignment_title` \n\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM `assignments` a\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE a.`assessment_id` = " . $db->qstr($result["assessment_id"]) . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tAND a.`assignment_active` = 1"; $assignment = $db->GetRow($query); $action_field = "assessment_id"; $action = "view"; $query = "SELECT b.`id` AS `proxy_id`, CONCAT_WS(', ', b.`lastname`, b.`firstname`) AS `fullname`, b.`number`\n FROM `" . AUTH_DATABASE . "`.`user_data` AS b\n JOIN `" . AUTH_DATABASE . "`.`user_access` AS c\n ON c.`user_id` = b.`id`\n AND c.`app_id` IN (" . AUTH_APP_IDS_STRING . ")\n AND c.`account_active` = 'true'\n AND (c.`access_starts` = '0' OR c.`access_starts`<=" . $db->qstr(time()) . ")\n AND (c.`access_expires` = '0' OR c.`access_expires`>=" . $db->qstr(time()) . ")\n JOIN `group_members` AS c\n ON b.`id` = c.`proxy_id`\n WHERE c.`group` = 'student'\n AND c.`group_id` = " . $db->qstr($output_cohort["group_id"]) . "\n AND c.`member_active` = '1'\n ORDER BY b.`lastname` ASC, b.`firstname` ASC"; $students = $db->GetAll($query); $params = array("module" => "gradebook", "action" => "view", "action_field" => "assessment_id", "action_value" => $result["assessment_id"]); $assessment_views = Models_Statistic::getCountByParams($params); if ($assignment && $ENTRADA_ACL->amIAllowed(new AssignmentResource($course_details["course_id"], $course_details["organisation_id"], $assignment["assignment_id"]), "update")) { $url = ENTRADA_URL . "/admin/gradebook/assignments?section=grade&id=" . $COURSE_ID . "&assignment_id=" . $assignment["assignment_id"]; echo "<td id=\"assignment-" . $assignment["assignment_id"] . "\">"; echo " <a href=\"" . ENTRADA_URL . "/admin/gradebook/assignments?section=download-submissions&assignment_id=" . $assignment["assignment_id"] . "&id=" . $COURSE_ID . "\"><i class=\"icon-download-alt\"></i></a>"; if ($ENTRADA_ACL->amIAllowed(new CourseContentResource($course_details["course_id"], $course_details["organisation_id"]), "update")) { echo "<a href=\"" . ENTRADA_URL . "/admin/gradebook/assignments?section=delete&id=" . $COURSE_ID . "&delete=" . $assignment["assignment_id"] . "\"><i class=\"icon-minus-sign\"></i></a>"; } echo " <a href=\"" . $url . "\">" . html_encode($assignment["assignment_title"]) . "</a>"; echo "</td>"; } else { echo "<td>\n"; if ($ENTRADA_ACL->amIAllowed(new CourseContentResource($course_details["course_id"], $course_details["organisation_id"]), "update")) { echo "<a href=\"" . ENTRADA_URL . "/admin/gradebook/assignments?section=add&id=" . $COURSE_ID . "&assessment_id=" . $result["assessment_id"] . "\"><i class=\"icon-plus-sign\"></i> Add New Assignment</a>"; } else { echo " ";