|
|
@ -116,28 +116,30 @@ class scormResource { |
|
|
|
default: |
|
|
|
default: |
|
|
|
//if($first_item->type == XML_ELEMENT_NODE) this is already check prior to the call to this function |
|
|
|
//if($first_item->type == XML_ELEMENT_NODE) this is already check prior to the call to this function |
|
|
|
$children = $element->childNodes; |
|
|
|
$children = $element->childNodes; |
|
|
|
foreach($children as $child) |
|
|
|
if(is_array($children)){ |
|
|
|
{ |
|
|
|
foreach($children as $child) |
|
|
|
switch($child->nodeType) |
|
|
|
{ |
|
|
|
{ |
|
|
|
switch($child->nodeType) |
|
|
|
case XML_ELEMENT_NODE: |
|
|
|
{ |
|
|
|
switch($child->tagName){ |
|
|
|
case XML_ELEMENT_NODE: |
|
|
|
case 'file': |
|
|
|
switch($child->tagName){ |
|
|
|
//echo "Child is a file tag<br />\n"; |
|
|
|
case 'file': |
|
|
|
$this->files[] = $child->getAttribute('href'); |
|
|
|
//echo "Child is a file tag<br />\n"; |
|
|
|
break; |
|
|
|
$this->files[] = $child->getAttribute('href'); |
|
|
|
case 'metadata': |
|
|
|
break; |
|
|
|
//echo "Child is a metadata tag<br />\n"; |
|
|
|
case 'metadata': |
|
|
|
$this->metadata = new scormMetadata('manifest',$child); |
|
|
|
//echo "Child is a metadata tag<br />\n"; |
|
|
|
break; |
|
|
|
$this->metadata = new scormMetadata('manifest',$child); |
|
|
|
case 'dependency': |
|
|
|
break; |
|
|
|
//need to get identifierref attribute inside dependency node |
|
|
|
case 'dependency': |
|
|
|
//dependencies[] array represents all <dependency identifierref='x'> tags united |
|
|
|
//need to get identifierref attribute inside dependency node |
|
|
|
$this->dependencies[] = $child->getAttribute('identifierref'); |
|
|
|
//dependencies[] array represents all <dependency identifierref='x'> tags united |
|
|
|
break; |
|
|
|
$this->dependencies[] = $child->getAttribute('identifierref'); |
|
|
|
} |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
//$keep_href = ''; |
|
|
|
//$keep_href = ''; |
|
|
|
if($element->hasAttributes()){ //in some cases we get here with an empty attributes array |
|
|
|
if($element->hasAttributes()){ //in some cases we get here with an empty attributes array |
|
|
|