This commit is contained in:
Sara Arjona 2020-04-15 17:57:05 +02:00
commit 106974b31a
4 changed files with 11 additions and 10 deletions

View File

@ -52,8 +52,8 @@ class block_activity_modules extends block_list {
$archetypes = array();
foreach($modinfo->cms as $cm) {
// Exclude activities which are not visible or have no link (=label)
if (!$cm->uservisible or !$cm->has_view()) {
// Exclude activities that aren't visible or have no view link (e.g. label). Account for folder being displayed inline.
if (!$cm->uservisible || (!$cm->has_view() && strcmp($cm->modname, 'folder') !== 0)) {
continue;
}
if (array_key_exists($cm->modname, $modfullnames)) {

View File

@ -74,11 +74,8 @@ foreach ($modinfo->cms as $cm) {
if (!in_array($cm->modname, $availableresources)) {
continue;
}
if (!$cm->uservisible) {
continue;
}
if (!$cm->has_view()) {
// Exclude label and similar
// Exclude activities that aren't visible or have no view link (e.g. label). Account for folder being displayed inline.
if (!$cm->uservisible || (!$cm->has_view() && strcmp($cm->modname, 'folder') !== 0)) {
continue;
}
$cms[$cm->id] = $cm;
@ -140,9 +137,11 @@ foreach ($cms as $cm) {
}
$class = $cm->visible ? '' : 'class="dimmed"'; // hidden modules are dimmed
$url = $cm->url ?: new moodle_url("/mod/{$cm->modname}/view.php", ['id' => $cm->id]);
$table->data[] = array (
$printsection,
"<a $class $extra href=\"".$cm->url."\">".$icon.$cm->get_formatted_name()."</a>",
"<a $class $extra href=\"" . $url ."\">" . $icon . $cm->get_formatted_name() . "</a>",
$intro);
}

View File

@ -203,7 +203,8 @@ class report_log_renderable implements renderable {
$section = 0;
$thissection = array();
foreach ($modinfo->cms as $cm) {
if (!$cm->uservisible || !$cm->has_view()) {
// Exclude activities that aren't visible or have no view link (e.g. label). Account for folders displayed inline.
if (!$cm->uservisible || (!$cm->has_view() && strcmp($cm->modname, 'folder') !== 0)) {
continue;
}
if ($cm->sectionnum > 0 and $section <> $cm->sectionnum) {

View File

@ -376,7 +376,8 @@ function report_log_print_mnet_selector_form($hostid, $course, $selecteduser=0,
$section = 0;
$thissection = array();
foreach ($modinfo->cms as $cm) {
if (!$cm->uservisible || !$cm->has_view()) {
// Exclude activities that aren't visible or have no view link (e.g. label). Account for folder being displayed inline.
if (!$cm->uservisible || (!$cm->has_view() && strcmp($cm->modname, 'folder') !== 0)) {
continue;
}
if ($cm->sectionnum > 0 and $section <> $cm->sectionnum) {