Skip to content

Commit

Permalink
SCORM MDL-24735 fix some php warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
danmarsden committed Oct 18, 2010
1 parent 5ecfec6 commit 36149cf
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions mod/scorm/datamodels/scormlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function scorm_get_manifest($blocks,$scoes) {
$resources = array();
$resources = scorm_get_resources($block['children']);
$scoes = scorm_get_manifest($block['children'],$scoes);
if (count($scoes->elements) <= 0) {
if (empty($scoes->elements) || count($scoes->elements) <= 0) {
foreach ($resources as $item => $resource) {
if (!empty($resource['HREF'])) {
$sco = new stdClass();
Expand All @@ -66,7 +66,9 @@ function scorm_get_manifest($blocks,$scoes) {
if (!isset($scoes->defaultorg) && isset($block['attrs']['DEFAULT'])) {
$scoes->defaultorg = $block['attrs']['DEFAULT'];
}
$scoes = scorm_get_manifest($block['children'],$scoes);
if (!empty($block['children'])) {
$scoes = scorm_get_manifest($block['children'],$scoes);
}
break;
case 'ORGANIZATION':
$identifier = $block['attrs']['IDENTIFIER'];
Expand All @@ -83,7 +85,9 @@ function scorm_get_manifest($blocks,$scoes) {
array_push($parents, $parent);
$organization = $identifier;

$scoes = scorm_get_manifest($block['children'],$scoes);
if (!empty($block['children'])) {
$scoes = scorm_get_manifest($block['children'],$scoes);
}

array_pop($parents);
break;
Expand Down Expand Up @@ -123,7 +127,9 @@ function scorm_get_manifest($blocks,$scoes) {
$parent->organization = $organization;
array_push($parents, $parent);

$scoes = scorm_get_manifest($block['children'],$scoes);
if (!empty($block['children'])) {
$scoes = scorm_get_manifest($block['children'],$scoes);
}

array_pop($parents);
break;
Expand Down

0 comments on commit 36149cf

Please sign in to comment.