private function OpignoScorm::scormExtractManifestScos in Opigno SCORM 8
Same name and namespace in other branches
- 3.x src/OpignoScorm.php \Drupal\opigno_scorm\OpignoScorm::scormExtractManifestScos()
Extract scos from the manifest.
Parameters
array $manifest: Manifest.
Return value
array Scos.
1 call to OpignoScorm::scormExtractManifestScos()
- OpignoScorm::scormExtractManifestData in src/
OpignoScorm.php - Extract manifest data from the manifest file.
File
- src/
OpignoScorm.php, line 417
Class
- OpignoScorm
- Class OpignoScorm.
Namespace
Drupal\opigno_scormCode
private function scormExtractManifestScos(array $manifest) {
$items = [
'items' => [],
];
foreach ($manifest['children'] as $child) {
if ($child['name'] == 'ORGANIZATIONS') {
if (!empty($child['attrs']['DEFAULT'])) {
$items['default'] = $child['attrs']['DEFAULT'];
}
else {
$items['default'] = '';
}
if (!empty($child['children']) && is_array($child['children'])) {
$items['items'] = array_merge($this
->scormExtractManifestScosItems($child['children']), $items['items']);
}
}
}
return $items;
}