foreach ($iterator_all as $key => $value) { $ruleCheck = true; if ($currentLesson->options['rules']) { $ruleCheck = $currentContent->checkRules($key, $seenContent); } if ($ruleCheck === true || $_professor_) { $unitData = new EfrontUnit($key); $value['data'] = preg_replace("#<script.*?>.*?</script>#", "<script removed>", $unitData['data']); $value['data'] = strip_tags($value['data'], '<img><applet><iframe><div><br><p><ul><li><ol><span><sub><sup><hr><h1><h2><h3><h4><h5><h6><table><tbody><tr><th><td><font><em><i><strong><u><b><blockquote><big><center><code>'); $units_to_print[$key] = array('name' => $value['name'], 'data' => $value['data']); $smarty->assign("T_PRINT_ALL", $units_to_print); } } } //if ($_professor_ && !$currentUnit && $currentContent -> getFirstNode()) { //If a unit is not specified, then consider the first content unit by default if ($_professor_ && !$currentUnit && $currentContent->getFirstVisitableNode()) { //If a unit is not specified, then consider the first content unit by default $currentUnit = new EfrontUnit($currentContent->getFirstNode()->offsetGet('id')); $smarty->assign("T_CURRENTUNITID", $currentUnit['id']); } if ($currentUnit) { //Let the template know that it is dealing with a SCORM unit if (strpos($currentUnit['ctg_type'], 'scorm') !== false) { $smarty->assign("T_SCORM", true); $smarty->assign("T_SCORM_VERSION", $scormVersion); } $userObj = new stdClass(); $userObj->name = array($currentUser->user['name'] . ' ' . $currentUser->user['surname']); $userObj->account = new stdClass(); $userObj->account->accountServiceHomePage = array($_SERVER['HTTP_HOST']); //These 2 for 0.9