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

HTML export class for system styles. More...

+ Collaboration diagram for ilSystemStyleHTMLExport:

Public Member Functions

 __construct ($a_exp_dir)
 Initialisation. More...
 
 createDirectories ()
 Create directories. More...
 
 addImage ($a_file, $a_exp_file_name="")
 Add (icon) image to the list of images to be exported. More...
 
 export ()
 Export. More...
 

Private Attributes

 $exp_dir = ""
 
 $images = []
 

Detailed Description

HTML export class for system styles.

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

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

Constructor & Destructor Documentation

◆ __construct()

ilSystemStyleHTMLExport::__construct (   $a_exp_dir)

Initialisation.

Parameters
string$a_exp_direxport directory

Definition at line 21 of file class.ilSystemStyleHTMLExport.php.

References addImage().

22  {
23  $this->exp_dir = $a_exp_dir;
24  $this->style_dir = $a_exp_dir . "/style";
25  $this->style_img_dir = $a_exp_dir . "/style/images";
26  $this->img_dir = $a_exp_dir . "/images";
27  $this->img_browser_dir = $a_exp_dir . "/images/browser";
28 
29  // add standard images
30  $this->addImage("enlarge.svg");
31  $this->addImage("browser/blank.png", "/browser/plus.png");
32  $this->addImage("browser/blank.png", "/browser/minus.png");
33  $this->addImage("browser/blank.png", "/browser/blank.png");
34  $this->addImage("spacer.png");
35  $this->addImage("icon_st.svg");
36  $this->addImage("icon_pg.svg");
37  $this->addImage("icon_lm.svg");
38  $this->addImage("nav_arr_L.png");
39  $this->addImage("nav_arr_R.png");
40  }
addImage($a_file, $a_exp_file_name="")
Add (icon) image to the list of images to be exported.
+ Here is the call graph for this function:

Member Function Documentation

◆ addImage()

ilSystemStyleHTMLExport::addImage (   $a_file,
  $a_exp_file_name = "" 
)

Add (icon) image to the list of images to be exported.

Parameters
$a_file
string$a_exp_file_name

Definition at line 58 of file class.ilSystemStyleHTMLExport.php.

References images.

Referenced by __construct().

59  {
60  $this->images[] = ["file" => $a_file,
61  "exp_file_name" => $a_exp_file_name];
62  }
Done rendering charts as images
+ Here is the caller graph for this function:

◆ createDirectories()

ilSystemStyleHTMLExport::createDirectories ( )

Create directories.

Definition at line 45 of file class.ilSystemStyleHTMLExport.php.

References ilUtil\makeDir().

Referenced by export().

46  {
47  ilUtil::makeDir($this->style_dir);
48  ilUtil::makeDir($this->img_dir);
49  ilUtil::makeDir($this->img_browser_dir);
50  }
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:

◆ export()

ilSystemStyleHTMLExport::export ( )

Export.

Definition at line 67 of file class.ilSystemStyleHTMLExport.php.

References $from, $ilUser, createDirectories(), ilUtil\getImagePath(), ilUtil\getStyleSheetLocation(), and images.

68  {
69  global $ilUser;
70 
71  $this->createDirectories();
72 
73  // export system style sheet
74  $location_stylesheet = ilUtil::getStyleSheetLocation("filesystem");
75  foreach (
76  $iterator = new \RecursiveIteratorIterator(
77  new \RecursiveDirectoryIterator(dirname($location_stylesheet), \RecursiveDirectoryIterator::SKIP_DOTS),
78  \RecursiveIteratorIterator::SELF_FIRST
79  ) as $item
80  ) {
81  if ($item->isDir()) {
82  mkdir($this->style_dir . DIRECTORY_SEPARATOR . $iterator->getSubPathName());
83  } else {
84  copy($item, $this->style_dir . DIRECTORY_SEPARATOR . $iterator->getSubPathName());
85  }
86  }
87 
88  // export (icon) images
89  foreach ($this->images as $im) {
90  $from = $to = $im["file"];
91  if ($im["exp_file_name"] != "") {
92  $to = $im["exp_file_name"];
93  }
94  copy(
95  ilUtil::getImagePath($from, false, "filesystem"),
96  $this->img_dir . "/" . $to
97  );
98  }
99  }
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
$from
Done rendering charts as images
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
$ilUser
Definition: imgupload.php:18
+ Here is the call graph for this function:

Field Documentation

◆ $exp_dir

ilSystemStyleHTMLExport::$exp_dir = ""
private

Definition at line 13 of file class.ilSystemStyleHTMLExport.php.

◆ $images

ilSystemStyleHTMLExport::$images = []
private

Definition at line 14 of file class.ilSystemStyleHTMLExport.php.


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