ILIAS  release_8 Revision v8.24
ilSystemStyleHTMLExport Class Reference
+ Collaboration diagram for ilSystemStyleHTMLExport:

Public Member Functions

 __construct (string $a_exp_dir)
 
 createDirectories ()
 
 addImage (string $a_file, string $a_exp_file_name='')
 Add (icon) image to the list of images to be exported. More...
 
 export ()
 

Protected Attributes

string $style_dir
 
string $style_img_dir
 
string $img_dir
 
string $img_browser_dir
 

Private Attributes

array $images = []
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilSystemStyleHTMLExport::__construct ( string  $a_exp_dir)

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

30 {
31 $this->style_dir = $a_exp_dir . '/templates/default';
32 $this->style_img_dir = $a_exp_dir . '/templates/default/images';
33 $this->img_dir = $a_exp_dir . '/images';
34 $this->img_browser_dir = $a_exp_dir . '/images/browser';
35
36 // add standard images
37 $this->addImage('enlarge.svg');
38 $this->addImage('browser/blank.png', '/browser/plus.png');
39 $this->addImage('browser/blank.png', '/browser/minus.png');
40 $this->addImage('browser/blank.png', '/browser/blank.png');
41 $this->addImage('spacer.png');
42 $this->addImage('icon_st.svg');
43 $this->addImage('icon_pg.svg');
44 $this->addImage('icon_lm.svg');
45 $this->addImage('nav_arr_L.png');
46 $this->addImage('nav_arr_R.png');
47 }
addImage(string $a_file, string $a_exp_file_name='')
Add (icon) image to the list of images to be exported.

References addImage().

+ Here is the call graph for this function:

Member Function Documentation

◆ addImage()

ilSystemStyleHTMLExport::addImage ( string  $a_file,
string  $a_exp_file_name = '' 
)

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

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

59 : void
60 {
61 $this->images[] = ['file' => $a_file,
62 'exp_file_name' => $a_exp_file_name
63 ];
64 }

Referenced by __construct().

+ Here is the caller graph for this function:

◆ createDirectories()

ilSystemStyleHTMLExport::createDirectories ( )

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

49 : void
50 {
51 ilFileUtils::makeDirParents($this->style_dir);
52 ilFileUtils::makeDirParents($this->img_dir);
53 ilFileUtils::makeDirParents($this->img_browser_dir);
54 }
static makeDirParents(string $a_dir)
Create a new directory and all parent directories.

References ilFileUtils\makeDirParents().

Referenced by export().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ export()

ilSystemStyleHTMLExport::export ( )

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

66 : void
67 {
68 $location_stylesheet = ilUtil::getStyleSheetLocation('filesystem');
69
70 // Fix skin path
71 $this->style_dir = dirname($this->style_dir, 2) . DIRECTORY_SEPARATOR . dirname($location_stylesheet);
72
73 $this->createDirectories();
74
75 // export system style sheet
76 $iterator = new RecursiveIteratorIterator(
77 new RecursiveDirectoryIterator(dirname($location_stylesheet), FilesystemIterator::SKIP_DOTS),
78 RecursiveIteratorIterator::SELF_FIRST
79 );
80 foreach ($iterator as $item) {
81 if ($item->isDir()) {
82 mkdir($this->style_dir . DIRECTORY_SEPARATOR . $iterator->getSubPathname());
83 } else {
84 copy($item->getPathname(), $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, '', 'filesystem'),
96 $this->img_dir . '/' . $to
97 );
98 }
99 }
static getStyleSheetLocation(string $mode="output", string $a_css_name="", string $a_css_location="")
get full style sheet file name (path inclusive) of current user
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)

References createDirectories(), ilUtil\getImagePath(), and ilUtil\getStyleSheetLocation().

+ Here is the call graph for this function:

Field Documentation

◆ $images

array ilSystemStyleHTMLExport::$images = []
private

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

◆ $img_browser_dir

string ilSystemStyleHTMLExport::$img_browser_dir
protected

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

◆ $img_dir

string ilSystemStyleHTMLExport::$img_dir
protected

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

◆ $style_dir

string ilSystemStyleHTMLExport::$style_dir
protected

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

◆ $style_img_dir

string ilSystemStyleHTMLExport::$style_img_dir
protected

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


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