ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilScormExportUtil Class Reference

Utility class for scorm export. More...

+ Collaboration diagram for ilScormExportUtil:

Static Public Member Functions

static exportContentCSS ($a_slm_object, $a_target_dir)
 Export lm content css to a directory. More...
 

Detailed Description

Utility class for scorm export.

Author
Alex Kiling alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 11 of file class.ilScormExportUtil.php.

Member Function Documentation

◆ exportContentCSS()

static ilScormExportUtil::exportContentCSS (   $a_slm_object,
  $a_target_dir 
)
static

Export lm content css to a directory.

Definition at line 16 of file class.ilScormExportUtil.php.

References $files, ilObjStyleSheet\getContentStylePath(), and ilUtil\makeDir().

Referenced by ilObjSCORM2004LearningModule\exportScorm().

17  {
18  ilUtil::makeDir($a_target_dir . "/css");
19  ilUtil::makeDir($a_target_dir . "/css/images");
20 
21  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
22  $active_css = ilObjStyleSheet::getContentStylePath($a_slm_object->getStyleSheetId());
23  $active_css = explode('?', $active_css);
24  $css = fread(fopen($active_css[0], 'r'), filesize($active_css[0]));
25  preg_match_all("/url\(([^\)]*)\)/", $css, $files);
26  $currdir = getcwd();
27  chdir(dirname($active_css[0]));
28  foreach (array_unique($files[1]) as $fileref) {
29  if (is_file($fileref)) {
30  copy($fileref, $a_target_dir . "/css/images/" . basename($fileref));
31  }
32  $css = str_replace($fileref, "images/" . basename($fileref), $css);
33  }
34  chdir($currdir);
35  fwrite(fopen($a_target_dir . '/css/style.css', 'w'), $css);
36  }
$files
Definition: add-vimline.php:18
static getContentStylePath($a_style_id, $add_random=true)
get content style path
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: