function opigno_scorm_ui_player_scorm_flatten_tree in Opigno 7
Helper function to flatten the SCORM tree.
Parameters
array $tree:
Return value
array
1 call to opigno_scorm_ui_player_scorm_flatten_tree()
- opigno_scorm_ui_render_player in modules/
scorm/ ui/ opigno_scorm_ui.module - Render a SCORM player for the given SCORM object.
File
- modules/
scorm/ ui/ includes/ opigno_scorm_ui.player.inc, line 56 - Player logic.
Code
function opigno_scorm_ui_player_scorm_flatten_tree($tree) {
$items = array();
if (!empty($tree)) {
foreach ($tree as $sco) {
$items[] = $sco;
if (!empty($sco->children)) {
$items = array_merge($items, opigno_scorm_ui_player_scorm_flatten_tree($sco->children));
}
}
}
return $items;
}