ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilSystemStyleScssSettings Class Reference
+ Collaboration diagram for ilSystemStyleScssSettings:

Public Member Functions

 __construct (string $scss_variables_settings_path)
 
 readFolder ()
 
 readAndreplaceContentOfFolder (array $replacements)
 
 write (string $new_path="")
 Write the complete files back to the file system (including comments and random content) More...
 
 getContent ()
 
 getCategories ()
 
 getCategoryByName (string $name)
 
 getVariables ()
 
 getVariableByName (string $name)
 
 getVariablesPerCategory (string $category_name='')
 
 getReferencesToVariable (string $variable_name)
 
 getReferencesToVariableAsString (string $variable_name)
 
 getRefAndCommentAsString (string $variable_name, string $refs_wording)
 
 getVariablesForDelosOverride ()
 
 getItems ()
 

Protected Attributes

array $files = []
 
array $variables = []
 
array $categories = []
 
string $scss_variables_settings_path = ''
 Complete path the the settings folder on the file system. More...
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilSystemStyleScssSettings::__construct ( string  $scss_variables_settings_path)

Definition at line 47 of file class.ilSystemStyleScssSettings.php.

References $scss_variables_settings_path, and readFolder().

48  {
49  $this->scss_variables_settings_path = $scss_variables_settings_path;
50  $this->readFolder();
51  }
string $scss_variables_settings_path
Complete path the the settings folder on the file system.
+ Here is the call graph for this function:

Member Function Documentation

◆ getCategories()

ilSystemStyleScssSettings::getCategories ( )
Returns
ilSystemStyleScssCategory[]

Definition at line 116 of file class.ilSystemStyleScssSettings.php.

References $categories.

Referenced by getCategoryByName().

116  : array
117  {
118  if (count($this->categories) == 0) {
119  foreach ($this->files as $file) {
120  $this->categories = array_merge($this->categories, $file->getCategories());
121  }
122  }
123  return $this->categories;
124  }
+ Here is the caller graph for this function:

◆ getCategoryByName()

ilSystemStyleScssSettings::getCategoryByName ( string  $name)

Definition at line 126 of file class.ilSystemStyleScssSettings.php.

References getCategories().

127  {
128  $categories = $this->getCategories();
129  return $categories[$name];
130  }
Capsules data of a Scss category in the variables to Scss file.
+ Here is the call graph for this function:

◆ getContent()

ilSystemStyleScssSettings::getContent ( )

Definition at line 103 of file class.ilSystemStyleScssSettings.php.

Referenced by ilSystemStyleStyleScssTest\testReadWriteDoubleRealFolderSCSS().

103  : string
104  {
105  $output = '';
106 
107  foreach ($this->files as $file) {
108  $output .= $file->getContent();
109  }
110  return $output;
111  }
+ Here is the caller graph for this function:

◆ getItems()

ilSystemStyleScssSettings::getItems ( )
Returns
ilSystemStyleScssItem[]

Definition at line 224 of file class.ilSystemStyleScssSettings.php.

224  : array
225  {
226  $item = [];
227  foreach ($this->files as $file) {
228  $item = array_merge($item, $file->getItems());
229  }
230  return $item;
231  }

◆ getRefAndCommentAsString()

ilSystemStyleScssSettings::getRefAndCommentAsString ( string  $variable_name,
string  $refs_wording 
)

Definition at line 190 of file class.ilSystemStyleScssSettings.php.

References getReferencesToVariable(), and getVariableByName().

190  : string
191  {
192  $references_string = '';
193  foreach ($this->getReferencesToVariable($variable_name) as $reference) {
194  $references_string .= "$reference; ";
195  }
196 
197  $variable = $this->getVariableByName($variable_name);
198 
199  if ($references_string != '') {
200  if ($variable->getComment()) {
201  $info = $variable->getComment() . '</br>' . $refs_wording . ' ' . $references_string;
202  } else {
203  $info = $refs_wording . ' ' . $references_string;
204  }
205  } else {
206  $info = $variable->getComment();
207  }
208 
209  return $info;
210  }
+ Here is the call graph for this function:

◆ getReferencesToVariable()

ilSystemStyleScssSettings::getReferencesToVariable ( string  $variable_name)

Definition at line 166 of file class.ilSystemStyleScssSettings.php.

References getVariables().

Referenced by getRefAndCommentAsString(), and getReferencesToVariableAsString().

166  : array
167  {
168  $references = [];
169 
170  foreach ($this->getVariables() as $variable) {
171  foreach ($variable->getReferences() as $reference) {
172  if ($variable_name == $reference) {
173  $references[] = $variable->getName();
174  }
175  }
176  }
177 
178  return $references;
179  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getReferencesToVariableAsString()

ilSystemStyleScssSettings::getReferencesToVariableAsString ( string  $variable_name)

Definition at line 181 of file class.ilSystemStyleScssSettings.php.

References getReferencesToVariable().

181  : string
182  {
183  $references_string = '';
184  foreach ($this->getReferencesToVariable($variable_name) as $reference) {
185  $references_string .= "$reference; ";
186  }
187  return $references_string;
188  }
+ Here is the call graph for this function:

◆ getVariableByName()

ilSystemStyleScssSettings::getVariableByName ( string  $name)

Definition at line 145 of file class.ilSystemStyleScssSettings.php.

References getVariables().

Referenced by getRefAndCommentAsString().

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

◆ getVariables()

ilSystemStyleScssSettings::getVariables ( )
Returns
ilSystemStyleScssVariable[]

Definition at line 135 of file class.ilSystemStyleScssSettings.php.

References $variables.

Referenced by getReferencesToVariable(), getVariableByName(), getVariablesForDelosOverride(), and getVariablesPerCategory().

135  : array
136  {
137  if (count($this->variables) == 0) {
138  foreach ($this->files as $file) {
139  $this->variables = array_merge($this->variables, $file->getVariables());
140  }
141  }
142  return $this->variables;
143  }
+ Here is the caller graph for this function:

◆ getVariablesForDelosOverride()

ilSystemStyleScssSettings::getVariablesForDelosOverride ( )

Definition at line 212 of file class.ilSystemStyleScssSettings.php.

References $out, and getVariables().

212  : string
213  {
214  $out = "";
215  foreach ($this->getVariables() as $variable) {
216  $out .= $variable->getForDelosOverride();
217  }
218  return $out;
219  }
$out
Definition: buildRTE.php:24
+ Here is the call graph for this function:

◆ getVariablesPerCategory()

ilSystemStyleScssSettings::getVariablesPerCategory ( string  $category_name = '')
Returns
ilSystemStyleScssVariable[]

Definition at line 154 of file class.ilSystemStyleScssSettings.php.

References $variables, and getVariables().

154  : array
155  {
156  $variables = [];
157  foreach ($this->getVariables() as $variable) {
158  if ($variable->getCategoryName() == $category_name) {
159  $variables[] = $variable;
160  }
161  }
162 
163  return $variables;
164  }
+ Here is the call graph for this function:

◆ readAndreplaceContentOfFolder()

ilSystemStyleScssSettings::readAndreplaceContentOfFolder ( array  $replacements)

Definition at line 71 of file class.ilSystemStyleScssSettings.php.

71  : void
72  {
73  if (is_dir($this->scss_variables_settings_path)) {
74  $files = scandir($this->scss_variables_settings_path, SCANDIR_SORT_ASCENDING);
75  foreach ($files as $file) {
76  $file_path = $this->scss_variables_settings_path . '/' . $file;
77  if ($file != "." && $file != ".." && !is_dir($file_path)) {
78  $content = file_get_contents($file_path);
79  foreach ($replacements as $search => $replace) {
80  $content = str_replace($search, $replace, $content);
81  }
82  file_put_contents($file_path, $content);
83  }
84  }
85  }
86  }

◆ readFolder()

ilSystemStyleScssSettings::readFolder ( )

Definition at line 53 of file class.ilSystemStyleScssSettings.php.

References ilSystemStyleException\FOLDER_OPENING_FAILED.

Referenced by __construct().

53  : void
54  {
55  if (is_dir($this->scss_variables_settings_path)) {
56  $files = scandir($this->scss_variables_settings_path, SCANDIR_SORT_ASCENDING);
57  foreach ($files as $file) {
58  $file_path = $this->scss_variables_settings_path . '/' . $file;
59  if ($file != "." && $file != ".." && !is_dir($file_path)) {
60  $this->files[] = new ilSystemStyleScssSettingsFile($this->scss_variables_settings_path, $file);
61  }
62  }
63  } else {
64  throw new ilSystemStyleException(
66  $this->scss_variables_settings_path
67  );
68  }
69  }
+ Here is the caller graph for this function:

◆ write()

ilSystemStyleScssSettings::write ( string  $new_path = "")

Write the complete files back to the file system (including comments and random content)

Definition at line 91 of file class.ilSystemStyleScssSettings.php.

References $path, and $scss_variables_settings_path.

Referenced by ilSystemStyleStyleScssTest\testReadWriteDoubleRealFolderSCSS().

91  : void
92  {
93  if ($new_path == "") {
95  } else {
96  $path = $new_path ;
97  }
98  foreach ($this->files as $file) {
99  $file->write($path);
100  }
101  }
string $scss_variables_settings_path
Complete path the the settings folder on the file system.
$path
Definition: ltiservices.php:32
+ Here is the caller graph for this function:

Field Documentation

◆ $categories

array ilSystemStyleScssSettings::$categories = []
protected

Definition at line 40 of file class.ilSystemStyleScssSettings.php.

Referenced by getCategories().

◆ $files

array ilSystemStyleScssSettings::$files = []
protected

Definition at line 30 of file class.ilSystemStyleScssSettings.php.

◆ $scss_variables_settings_path

string ilSystemStyleScssSettings::$scss_variables_settings_path = ''
protected

Complete path the the settings folder on the file system.

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

Referenced by __construct(), and write().

◆ $variables

array ilSystemStyleScssSettings::$variables = []
protected

Definition at line 35 of file class.ilSystemStyleScssSettings.php.

Referenced by getVariables(), and getVariablesPerCategory().


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