mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-12945 fixing mod indexes broken by previous commit; merged from MOODLE_19_STABLE
This commit is contained in:
parent
78117f38bc
commit
52ae8c057a
8 changed files with 72 additions and 43 deletions
|
@ -51,11 +51,31 @@
|
|||
|
||||
$types = assignment_types();
|
||||
|
||||
foreach ($cms as $cm) {
|
||||
if (!coursemodule_visible_for_user($cm)) {
|
||||
$modinfo = get_fast_modinfo($course);
|
||||
foreach ($modinfo->instances['assignment'] as $cm) {
|
||||
if (!$cm->uservisible) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$cm->timedue = $cms[$cm->id]->timedue;
|
||||
$cm->assignmenttype = $cms[$cm->id]->assignmenttype;
|
||||
|
||||
//Show dimmed if the mod is hidden
|
||||
$class = $cm->visible ? '' : 'class="dimmed"';
|
||||
|
||||
$link = "<a $class href=\"view.php?id=$cm->id\">".format_string($cm->name)."</a>";
|
||||
|
||||
$printsection = "";
|
||||
if ($cm->section !== $currentsection) {
|
||||
if ($cm->section) {
|
||||
$printsection = $cm->section;
|
||||
}
|
||||
if ($currentsection !== "") {
|
||||
$table->data[] = 'hr';
|
||||
}
|
||||
$currentsection = $cm->section;
|
||||
}
|
||||
|
||||
if (!file_exists($CFG->dirroot.'/mod/assignment/type/'.$cm->assignmenttype.'/assignment.class.php')) {
|
||||
continue;
|
||||
}
|
||||
|
@ -73,22 +93,6 @@
|
|||
|
||||
$due = $cm->timedue ? userdate($cm->timedue) : '-';
|
||||
|
||||
//Show dimmed if the mod is hidden
|
||||
$class = $cm->visible ? '' : 'class="dimmed"';
|
||||
|
||||
$link = "<a $class href=\"view.php?id=$cm->id\">".format_string($cm->name)."</a>";
|
||||
|
||||
$printsection = "";
|
||||
if ($cm->section !== $currentsection) {
|
||||
if ($cm->section) {
|
||||
$printsection = $cm->section;
|
||||
}
|
||||
if ($currentsection !== "") {
|
||||
$table->data[] = 'hr';
|
||||
}
|
||||
$currentsection = $cm->section;
|
||||
}
|
||||
|
||||
if ($course->format == "weeks" or $course->format == "topics") {
|
||||
$table->data[] = array ($printsection, $link, $type, $due, $submitted, $grade);
|
||||
} else {
|
||||
|
|
|
@ -54,8 +54,10 @@
|
|||
}
|
||||
|
||||
$currentsection = '';
|
||||
foreach ($cms as $cm) {
|
||||
if (!coursemodule_visible_for_user($cm)) {
|
||||
|
||||
$modinfo = get_fast_modinfo($course);
|
||||
foreach ($modinfo->instances['chat'] as $cm) {
|
||||
if (!$cm->uservisible) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -51,21 +51,12 @@
|
|||
|
||||
$currentsection = "";
|
||||
|
||||
foreach ($cms as $cm) {
|
||||
if (!coursemodule_visible_for_user($cm)) {
|
||||
$modinfo = get_fast_modinfo($course);
|
||||
foreach ($modinfo->instances['choice'] as $cm) {
|
||||
if (!$cm->uservisible) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!empty($answers[$cm->instance])) {
|
||||
$answer = $answers[$cm->instance];
|
||||
} else {
|
||||
$answer = "";
|
||||
}
|
||||
if (!empty($answer->optionid)) {
|
||||
$aa = format_string(choice_get_option_text(null, $answer->optionid));
|
||||
} else {
|
||||
$aa = "";
|
||||
}
|
||||
$printsection = "";
|
||||
if ($cm->section !== $currentsection) {
|
||||
if ($cm->section) {
|
||||
|
@ -80,6 +71,17 @@
|
|||
$class = $cm->visible ? '' : 'class="dimmed"';
|
||||
$tt_href = "<a $class href=\"view.php?id=$cm->id\">".format_string($cm->name)."</a>";
|
||||
|
||||
if (!empty($answers[$cm->instance])) {
|
||||
$answer = $answers[$cm->instance];
|
||||
} else {
|
||||
$answer = "";
|
||||
}
|
||||
if (!empty($answer->optionid)) {
|
||||
$aa = format_string(choice_get_option_text(null, $answer->optionid));
|
||||
} else {
|
||||
$aa = "";
|
||||
}
|
||||
|
||||
if ($course->format == "weeks" || $course->format == "topics") {
|
||||
$table->data[] = array ($printsection, $tt_href, $aa);
|
||||
} else {
|
||||
|
|
|
@ -82,11 +82,16 @@
|
|||
|
||||
$currentsection = "";
|
||||
|
||||
foreach ($cms as $cm) {
|
||||
if (!coursemodule_visible_for_user($cm)) {
|
||||
$modinfo = get_fast_modinfo($course);
|
||||
foreach ($modinfo->instances['data'] as $cm) {
|
||||
if (!$cm->uservisible) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$cm->intro = $cms[$cm->id]->intro;
|
||||
$cm->approval = $cms[$cm->id]->approval;
|
||||
$cm->rssarticles = $cms[$cm->id]->rssarticles;
|
||||
|
||||
$printsection = "";
|
||||
|
||||
$class = $cm->visible ? '' : 'class="dimmed"';
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
require_once("../../config.php");
|
||||
require_once("lib.php");
|
||||
require_once("$CFG->libdir/rsslib.php");
|
||||
require_once("$CFG->dirroot/course/lib.php");
|
||||
|
||||
$id = required_param('id', PARAM_INT); // course
|
||||
|
||||
|
@ -67,13 +68,17 @@
|
|||
|
||||
$currentsection = "";
|
||||
|
||||
foreach ($cms as $cm) {
|
||||
if (!coursemodule_visible_for_user($cm)) {
|
||||
$modinfo = get_fast_modinfo($course);
|
||||
foreach ($modinfo->instances['glossary'] as $cm) {
|
||||
if (!$cm->uservisible) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$cm->rsstype = $cms[$cm->id]->rsstype;
|
||||
$cm->rssarticles = $cms[$cm->id]->rssarticles;
|
||||
|
||||
$class = $cm->visible ? '' : 'class="dimmed"';
|
||||
$link = "<a class=\"dimmed\" href=\"view.php?id=$cm->id\">".format_string($cm->name)."</a>";
|
||||
$link = "<a $class href=\"view.php?id=$cm->id\">".format_string($cm->name)."</a>";
|
||||
|
||||
$printsection = "";
|
||||
if ($cm->section !== $currentsection) {
|
||||
|
|
|
@ -48,11 +48,16 @@
|
|||
|
||||
$currentsection = "";
|
||||
$options->para = false;
|
||||
foreach ($cms as $cm) {
|
||||
if (!coursemodule_visible_for_user($cm)) {
|
||||
|
||||
$modinfo = get_fast_modinfo($course);
|
||||
foreach ($modinfo->instances['resource'] as $cm) {
|
||||
if (!$cm->uservisible) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$cm->summary = $cms[$cm->id]->summary;
|
||||
$cm->timemodified = $cms[$cm->id]->timemodified;
|
||||
|
||||
if ($course->format == "weeks" or $course->format == "topics") {
|
||||
$printsection = "";
|
||||
if ($cm->section !== $currentsection) {
|
||||
|
|
|
@ -45,8 +45,9 @@
|
|||
|
||||
$currentsection = '';
|
||||
|
||||
foreach ($cms as $cm) {
|
||||
if (!coursemodule_visible_for_user($cm)) {
|
||||
$modinfo = get_fast_modinfo($course);
|
||||
foreach ($modinfo->instances['survey'] as $cm) {
|
||||
if (!$cm->uservisible) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -58,11 +58,16 @@
|
|||
$table->align = array ('LEFT', 'LEFT', 'LEFT', 'LEFT');
|
||||
}
|
||||
|
||||
foreach ($cms as $cm) {
|
||||
if (!coursemodule_visible_for_user($cm)) {
|
||||
$modinfo = get_fast_modinfo($course);
|
||||
foreach ($modinfo->instances['wiki'] as $cm) {
|
||||
if (!$cm->uservisible) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$cm->summary = $cms[$cm->id]->summary;
|
||||
$cm->wtype = $cms[$cm->id]->wtype;
|
||||
$cm->timemodified = $cms[$cm->id]->timemodified;
|
||||
|
||||
$class = $cm->visible ? '' : 'class="dimmed"';
|
||||
$link = '<a '.$class.' href="view.php?id='.$cm->id.'">'.format_string($cm->name).'</a>';
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue