- Модуль: learning
- Путь к файлу: ~/bitrix/modules/learning/classes/general/scorm.php
- Класс: CCourseSCORM
- Вызов: CCourseSCORM::CreateContent
protected function CreateContent($arItems = array(), $PARENT_ID = 0)
{
if ($this->LAST_ERROR <> '')
return false;
if (empty($arItems))
{
if ($items = $this->objXML->SelectNodes("/manifest/organizations/organization/"))
{
$arItems = $items->__toArray();
$arItems = $arItems["#"]["item"];
}
}
foreach ($arItems as $ar)
{
$title = $ar["#"]["title"][0]["#"];
$type = (!is_set($ar["#"], "item") && is_set($ar["@"], "identifierref")) ? "LES" : "CHA";
$launch = "";
if ($type == "LES")
{
foreach($this->arResources as $res)
{
if ($res["@"]["identifier"] == $ar["@"]["identifierref"])
{
$launch = "/".(COption::GetOptionString("main", "upload_dir", "upload"))."/learning/scorm/".$this->COURSE_ID."/";
$launch .= $res["@"]["href"];
if(is_set($ar["@"]["parameters"]))
{
$launch .= $ar["@"]["parameters"];
}
}
}
}
$ID = $this->_MakeItems($title, $type, $launch, $PARENT_ID);
if (is_set($ar["#"], "item"))
$this->CreateContent($ar["#"]["item"], $ID);
}
}