mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
On second thought, we can be a bit more diplomatic with this one.
The best of both worlds, but a hack is a hack. ;-)
This commit is contained in:
parent
24acdc993b
commit
42f9b64b80
@ -9,7 +9,16 @@ class block_activity_modules extends block_list {
|
||||
function get_content() {
|
||||
global $USER, $CFG;
|
||||
|
||||
get_all_mods($this->instance->pageid, $mods, $modnames, $modnamesplural, $modnamesused);
|
||||
// TODO: FIX: HACK: (any other tags I should add? :P)
|
||||
// Hacker's improvised caching scheme: avoid fetching the mod
|
||||
// data from db if the course format has already fetched them
|
||||
if(!isset($GLOBALS['modnamesplural']) || !isset($GLOBALS['modnamesused'])) {
|
||||
get_all_mods($this->instance->pageid, $mods, $modnames, $modnamesplural, $modnamesused);
|
||||
}
|
||||
else {
|
||||
$modnamesplural = $GLOBALS['modnamesplural'];
|
||||
$modnamesused = $GLOBALS['modnamesused'];
|
||||
}
|
||||
|
||||
if($this->content !== NULL) {
|
||||
return $this->content;
|
||||
|
Loading…
x
Reference in New Issue
Block a user