ILIAS  trunk Revision v11.0_alpha-1811-gd2d5443e411
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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

array $img_sub_dirs
 
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 30 of file class.ilSystemStyleHTMLExport.php.

References addImage().

31  {
32  $this->style_dir = $a_exp_dir . '/templates/default';
33  $this->style_img_dir = $a_exp_dir . '/templates/default/images';
34  $this->img_dir = $a_exp_dir . '/images';
35  $this->img_sub_dirs =
36  [
37  $a_exp_dir . '/images/browser',
38  $a_exp_dir . '/images/media',
39  $a_exp_dir . '/images/nav',
40  $a_exp_dir . '/images/standard'
41  ];
42 
43  // add standard images
44  $this->addImage('media/enlarge.svg');
45  $this->addImage('browser/blank.png', '/browser/plus.png');
46  $this->addImage('browser/blank.png', '/browser/minus.png');
47  $this->addImage('browser/blank.png', '/browser/blank.png');
48  $this->addImage('media/spacer.png');
49  $this->addImage('standard/icon_st.svg');
50  $this->addImage('standard/icon_pg.svg');
51  $this->addImage('standard/icon_lm.svg');
52  $this->addImage('nav/nav_arr_L.png');
53  $this->addImage('nav/nav_arr_R.png');
54  }
addImage(string $a_file, string $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 ( string  $a_file,
string  $a_exp_file_name = '' 
)

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

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

Referenced by __construct().

68  : void
69  {
70  $this->images[] = ['file' => $a_file,
71  'exp_file_name' => $a_exp_file_name
72  ];
73  }
+ Here is the caller graph for this function:

◆ createDirectories()

ilSystemStyleHTMLExport::createDirectories ( )

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

References ilFileUtils\makeDirParents().

Referenced by export().

56  : void
57  {
58  ilFileUtils::makeDirParents($this->style_dir);
59  ilFileUtils::makeDirParents($this->img_dir);
60  foreach ($this->img_sub_dirs as $sub_browser) {
61  ilFileUtils::makeDirParents($sub_browser);
62  }
63  }
static makeDirParents(string $a_dir)
Create a new directory and all parent directories.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ export()

ilSystemStyleHTMLExport::export ( )

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

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

75  : void
76  {
77  $location_stylesheet = ilUtil::getStyleSheetLocation('filesystem');
78 
79  // Fix skin path
80  $this->style_dir = dirname($this->style_dir, 2) . DIRECTORY_SEPARATOR . dirname($location_stylesheet);
81 
82  $this->createDirectories();
83 
84  // export system style sheet
85  $iterator = new RecursiveIteratorIterator(
86  new RecursiveDirectoryIterator(dirname($location_stylesheet), FilesystemIterator::SKIP_DOTS),
87  RecursiveIteratorIterator::SELF_FIRST
88  );
89  foreach ($iterator as $item) {
90  if ($item->isDir()) {
91  mkdir($this->style_dir . DIRECTORY_SEPARATOR . $iterator->getSubPathname());
92  } else {
93  copy($item->getPathname(), $this->style_dir . DIRECTORY_SEPARATOR . $iterator->getSubPathname());
94  }
95  }
96 
97  // export (icon) images
98  foreach ($this->images as $im) {
99  $from = $to = $im['file'];
100  if ($im['exp_file_name'] != '') {
101  $to = $im['exp_file_name'];
102  }
103  copy(
104  ilUtil::getImagePath($from, '', 'filesystem'),
105  $this->img_dir . '/' . $to
106  );
107  }
108  }
static getStyleSheetLocation(string $mode="output", string $a_css_name="")
get full style sheet file name (path inclusive) of current user
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
+ 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 28 of file class.ilSystemStyleHTMLExport.php.

◆ $img_dir

string ilSystemStyleHTMLExport::$img_dir
protected

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

◆ $img_sub_dirs

array ilSystemStyleHTMLExport::$img_sub_dirs
protected

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

◆ $style_dir

string ilSystemStyleHTMLExport::$style_dir
protected

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

◆ $style_img_dir

string ilSystemStyleHTMLExport::$style_img_dir
protected

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


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