1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- <?php
- if(!defined('MOODLE_INTERNAL')) {
- die('Direct access to this script is forbidden.');
- }
- require_once("../../config.php");
- require_once("lib.php");
- require_once($CFG->libdir . '/gradelib.php');
- $id = required_param('id', PARAM_INT);
- if(!$course = $DB->get_record('course', array('id' => $id))) {
- print_error('invalidcourseid');
- }
- require_course_login($course);
- $PAGE->set_pagelayout('incourse');
- add_to_log($course->id, "iassign", "view all", "index.php?id=$course->id", "");
- $striassigns = get_string("modulenameplural", "iassign");
- $striassign = get_string("modulename", "iassign");
- $PAGE->set_url('/mod/iassign/index.php', array('id' => $course->id));
- $PAGE->navbar->add($striassigns);
- $PAGE->set_title($striassign);
- $PAGE->set_heading($course->fullname);
- echo $OUTPUT->header();
- if(!$ias = get_all_instances_in_course("iassign", $course)) {
- notice(get_string('thereareno', 'moodle', $striassigns), "../../course/view.php?id=$course->id");
-
- die;
- }
- $timenow = time();
- $strname = get_string("name");
- $strweek = get_string("week");
- $strtopic = get_string("topic");
- $table = new html_table();
- if($course->format == "weeks") {
- $table->head = array($strweek, $strname);
- $table->align = array("center", "left");
- } else if($course->format == "topics") {
- $table->head = array($strtopic, $strname);
- $table->align = array("center", "left", "left", "left");
- } else {
- $table->head = array($strname);
- $table->align = array("left", "left", "left");
- }
- foreach ($ias as $iassign) {
- if(!$iassign->visible) {
-
- $link = "<a class=\"dimmed\" href=\"view.php?id=$iassign->coursemodule\">$iassign->name</a>";
- } else {
-
- $link = "<a href=\"view.php?id=$iassign->coursemodule\">$iassign->name</a>";
- }
- if($course->format == "weeks" or $course->format == "topics") {
- $table->data[] = array($iassign->section, $link);
- } else {
- $table->data[] = array($link);
- }
- }
- echo "<br />";
- echo html_writer::table($table);
- echo $OUTPUT->footer();
|