mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
Fix for Bug #5541
This commit is contained in:
parent
88427c077b
commit
2631c1744e
@ -14,8 +14,10 @@ class block_activity_modules extends block_list {
|
|||||||
// data from db if the course format has already fetched them
|
// data from db if the course format has already fetched them
|
||||||
if(!isset($GLOBALS['modnamesplural']) || !isset($GLOBALS['modnamesused'])) {
|
if(!isset($GLOBALS['modnamesplural']) || !isset($GLOBALS['modnamesused'])) {
|
||||||
require_once($CFG->dirroot.'/course/lib.php');
|
require_once($CFG->dirroot.'/course/lib.php');
|
||||||
|
if (!empty($this->instance)) {
|
||||||
get_all_mods($this->instance->pageid, $mods, $modnames, $modnamesplural, $modnamesused);
|
get_all_mods($this->instance->pageid, $mods, $modnames, $modnamesplural, $modnamesused);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
$modnamesplural = $GLOBALS['modnamesplural'];
|
$modnamesplural = $GLOBALS['modnamesplural'];
|
||||||
$modnamesused = $GLOBALS['modnamesused'];
|
$modnamesused = $GLOBALS['modnamesused'];
|
||||||
@ -30,7 +32,7 @@ class block_activity_modules extends block_list {
|
|||||||
$this->content->icons = array();
|
$this->content->icons = array();
|
||||||
$this->content->footer = '';
|
$this->content->footer = '';
|
||||||
|
|
||||||
if ($modnamesused) {
|
if (isset($modnamesused) && $modnamesused) {
|
||||||
foreach ($modnamesused as $modname => $modfullname) {
|
foreach ($modnamesused as $modname => $modfullname) {
|
||||||
if ($modname != 'label') {
|
if ($modname != 'label') {
|
||||||
$this->content->items[] = '<a href="'.$CFG->wwwroot.'/mod/'.$modname.'/index.php?id='.$this->instance->pageid.'">'.$modnamesplural[$modname].'</a>';
|
$this->content->items[] = '<a href="'.$CFG->wwwroot.'/mod/'.$modname.'/index.php?id='.$this->instance->pageid.'">'.$modnamesplural[$modname].'</a>';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user