mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 00:16:46 +02:00
themes MDL-21984 Removed the need to specify the theme name in layouts within its config.php file
This commit is contained in:
parent
84db3ea2a3
commit
f1cbbbeb20
1 changed files with 19 additions and 2 deletions
|
@ -510,9 +510,26 @@ if (!empty($sendflashupgrader) && (($userplayerversion[0] < $requiredplayervers
|
|||
send_file_not_found();
|
||||
|
||||
} else if ($context->contextlevel == CONTEXT_BLOCK) {
|
||||
//not supported yet
|
||||
send_file_not_found();
|
||||
|
||||
if (!$context = get_context_instance_by_id($contextid)) {
|
||||
send_file_not_found();
|
||||
}
|
||||
$birecord = $DB->get_record('block_instances', array('id'=>$context->instanceid), '*',MUST_EXIST);
|
||||
$blockinstance = block_instance($birecord->blockname, $birecord);
|
||||
|
||||
if (strpos(get_class($blockinstance), $filearea) !== 0) {
|
||||
send_file_not_found();
|
||||
}
|
||||
|
||||
$itemid = array_shift($args);
|
||||
$filename = array_pop($args);
|
||||
$filepath = '/'.join('/', $args);
|
||||
|
||||
if (method_exists($blockinstance, 'send_file')) {
|
||||
$blockinstance->send_file($context, $filearea, $itemid, $filepath, $filename);
|
||||
}
|
||||
|
||||
send_file_not_found();
|
||||
|
||||
} else {
|
||||
send_file_not_found();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue