Create resource entries for the learning module "PKG" and all SCOS and Assets.
246 include_once(
"./Modules/Scorm2004/classes/class.ilSCORM2004Tree.php");
252 foreach (
$tree->getSubTree(
$tree->getNodeData(
$tree->root_id),
true, array(
'sco',
'ass')) as $obj) {
254 $attrs[
"identifier"] =
"il_" . IL_INST_ID .
"_" . $obj[
'type'] .
"_" . $obj[
'obj_id'] .
"_ref";
255 $attrs[
"type"] =
"webcontent";
256 if ($obj[
'type'] ==
"sco") {
257 $attrs[($this->version ==
"2004"?
"adlcp:scormType":
"adlcp:scormtype")] =
"sco";
259 $attrs[($this->version ==
"2004"?
"adlcp:scormType":
"adlcp:scormtype")] =
"asset";
261 $attrs[
"href"] =
"./" . $obj[
'obj_id'] .
"/index.html";
262 $this->writer->xmlStartTag(
"resource", $attrs,
"");
263 $this->writer->xmlElement(
"dependency", array(
"identifierref" =>
"il_" . IL_INST_ID .
"_" . $obj[
'type'] .
"_" . $obj[
'obj_id'] .
'ITSELF'),
"");
264 $this->writer->xmlElement(
"dependency", array(
"identifierref" =>
"il_" . IL_INST_ID .
"_" . $obj[
'type'] .
"_" . $obj[
'obj_id'] .
'OBJECTS'),
"");
265 $this->writer->xmlElement(
"dependency", array(
"identifierref" =>
"il_" . IL_INST_ID .
"_" . $obj[
'type'] .
"_" . $obj[
'obj_id'] .
'RESOURCES'),
"");
266 $this->writer->xmlElement(
"dependency", array(
"identifierref" =>
"il_" . IL_INST_ID .
"_" . $obj[
'type'] .
"_" . $obj[
'obj_id'] .
'FLAVOUR'),
"");
267 $this->writer->xmlEndTag(
"resource");
270 $attrs[
"identifier"] =
"il_" . IL_INST_ID .
"_" . $obj[
'type'] .
"_" . $obj[
'obj_id'] .
'ITSELF';
271 $attrs[
"type"] =
"webcontent";
272 $attrs[($this->version ==
"2004"?
"adlcp:scormType":
"adlcp:scormtype")] =
"asset";
273 $this->writer->xmlStartTag(
"resource", $attrs,
"");
274 $this->writer->xmlElement(
"file", array(
"href" =>
"./" . $obj[
'obj_id'] .
"/index.xml"),
"");
275 $this->writer->xmlElement(
"file", array(
"href" =>
"./" . $obj[
'obj_id'] .
"/ilias_co_3_7.dtd"),
"");
276 $this->writer->xmlElement(
"file", array(
"href" =>
"./" . $obj[
'obj_id'] .
"/index.html"),
"");
277 $this->writer->xmlEndTag(
"resource");
280 $attrs[
"identifier"] =
"il_" . IL_INST_ID .
"_" . $obj[
'type'] .
"_" . $obj[
'obj_id'] .
'RESOURCES';
281 $attrs[
"type"] =
"webcontent";
282 $attrs[($this->version ==
"2004"?
"adlcp:scormType":
"adlcp:scormtype")] =
"asset";
283 $this->writer->xmlStartTag(
"resource", $attrs,
"");
284 $this->writer->xmlEndTag(
"resource");
287 $attrs[
"identifier"] =
"il_" . IL_INST_ID .
"_" . $obj[
'type'] .
"_" . $obj[
'obj_id'] .
'FLAVOUR';
288 $attrs[
"type"] =
"webcontent";
289 $attrs[($this->version ==
"2004"?
"adlcp:scormType":
"adlcp:scormtype")] =
"asset";
290 $this->writer->xmlStartTag(
"resource", $attrs,
"");
291 $this->writer->xmlElement(
"file", array(
"href" =>
"./" . $obj[
'obj_id'] .
"/index.xml"),
"");
292 $this->writer->xmlElement(
"file", array(
"href" =>
"./" . $obj[
'obj_id'] .
"/sco.xsl"),
"");
293 $this->writer->xmlElement(
"file", array(
"href" =>
"./" . $obj[
'obj_id'] .
"/css/system.css"),
"");
294 $this->writer->xmlElement(
"file", array(
"href" =>
"./" . $obj[
'obj_id'] .
"/css/style.css"),
"");
295 $this->writer->xmlElement(
"file", array(
"href" =>
"./" . $obj[
'obj_id'] .
"/js/scorm.js"),
"");
296 $this->writer->xmlEndTag(
"resource");
299 $attrs[
"identifier"] =
"il_" . IL_INST_ID .
"_" . $obj[
'type'] .
"_" . $obj[
'obj_id'] .
'OBJECTS';
300 $attrs[
"type"] =
"webcontent";
301 $attrs[($this->version ==
"2004"?
"adlcp:scormType":
"adlcp:scormtype")] =
"asset";
302 $this->writer->xmlStartTag(
"resource", $attrs,
"");
304 include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
307 $active_css = explode(
'?', $active_css);
308 $css = fread(
fopen($active_css[0],
'r'), filesize($active_css[0]));
309 preg_match_all(
"/url\(([^\)]*)\)/", $css, $css_files);
310 $css_files = array_unique($css_files[1]);
312 chdir(dirname($active_css[0]));
313 foreach ($css_files as $fileref) {
314 if (file_exists($fileref)) {
315 $this->writer->xmlElement(
"file", array(
"href" =>
"./" . $obj[
'obj_id'] .
"/images/" . basename($fileref)),
"");
320 include_once(
"./Modules/Scorm2004/classes/class.ilSCORM2004Tree.php");
326 foreach ($pagetree->getSubTree($pagetree->getNodeData($obj[
'obj_id']),
false,
'page') as $page) {
328 $page_obj->buildDom();
329 $mob_ids = $page_obj->collectMediaObjects(
false);
330 foreach ($mob_ids as $mob_id) {
333 $media_obj = $media_obj->getMediaItem(
"Standard");
334 if ($media_obj != null && $media_obj->getLocationType() ==
"LocalFile") {
335 $this->writer->xmlElement(
"file", array(
"href" =>
"./" . $obj[
'obj_id'] .
"/objects/il_" . IL_INST_ID .
"_mob_" . $mob_id .
"/" . rawurlencode($media_obj->getLocation())),
"");
340 include_once(
"./Services/COPage/classes/class.ilPCFileList.php");
342 foreach ($file_ids as $file_id) {
344 include_once(
"./Modules/File/classes/class.ilObjFile.php");
345 $file_obj =
new ilObjFile($file_id,
false);
346 $this->writer->xmlElement(
"file", array(
"href" =>
"./" . $obj[
'obj_id'] .
"/objects/il_" . IL_INST_ID .
"_file_" . $file_id .
"/" . rawurlencode($file_obj->getFileName())),
"");
352 $this->writer->xmlEndTag(
"resource");
354 if ($this->version ==
"2004") {
356 $attrs[
"identifier"] =
"PKG";
357 $attrs[
"type"] =
"webcontent";
358 $attrs[($this->version ==
"2004"?
"adlcp:scormType":
"adlcp:scormtype")] =
"asset";
359 $this->writer->xmlStartTag(
"resource", $attrs,
"");
361 $xsd_files = array(
'adlcp_v1p3.xsd',
'adlseq_v1p3.xsd',
'imsss_v1p0.xsd',
'adlnav_v1p3.xsd',
'adlnav_v1p3.xsd',
362 'imscp_v1p1.xsd',
'imsmanifest.xml',
'imsss_v1p0auxresource.xsd',
'imsss_v1p0control.xsd',
'imsss_v1p0delivery.xsd',
363 'imsss_v1p0limit.xsd',
'imsss_v1p0objective.xsd',
'imsss_v1p0random.xsd',
'imsss_v1p0rollup.xsd',
'imsss_v1p0seqrule.xsd',
364 'imsss_v1p0util.xsd',
'xml.xsd',
'index.html');
365 foreach ($xsd_files as $xsd_file) {
367 $attrs[
"href"] = $xsd_file;
368 $this->writer->xmlElement(
"file", $attrs,
"");
370 $this->writer->xmlEndTag(
"resource");
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data
static collectFileItems($a_page, $a_domdoc)
Get all file items that are used within the page.
static getContentStylePath($a_style_id, $add_random=true)
get content style path
static _lookupType($a_id, $a_reference=false)
lookup object type