MDL-30419: IMS package content missing when using Blackboard packages

This commit is contained in:
Tim Lock
2011-12-14 21:34:47 +01:00
committed by Eloy Lafuente (stronk7)
parent 2ef91b5b55
commit e460b8846d
+10 -2
View File
@@ -139,9 +139,17 @@ function imscp_parse_structure($imscp, $context) {
$xmlbase = '';
}
if (!$href = $res->attributes->getNamedItem('href')) {
continue;
// If href not found look for <file href="help.htm"/>
$fileresources = $res->getElementsByTagName('file');
foreach ($fileresources as $file) {
$href = $file->getAttribute('href');
}
if (empty($href)) {
continue;
}
} else {
$href = $href->nodeValue;
}
$href = $href->nodeValue;
if (strpos($href, 'http://') !== 0) {
$href = $xmlbase.$href;
}