ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilScormExportUtil.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2011 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
12 {
16  static function exportContentCSS($a_slm_object, $a_target_dir)
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  {
30  if (is_file($fileref))
31  {
32  copy($fileref, $a_target_dir."/css/images/".basename($fileref));
33  }
34  $css = str_replace($fileref,"images/".basename($fileref),$css);
35  }
36  chdir($currdir);
37  fwrite(fopen($a_target_dir.'/css/style.css','w'), $css);
38  }
39 
40 }
41 ?>
$files
Definition: add-vimline.php:18
static exportContentCSS($a_slm_object, $a_target_dir)
Export lm content css to a directory.
Utility class for scorm export.
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
static getContentStylePath($a_style_id)
get content style path