ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilSystemStyleLessVariable.php
Go to the documentation of this file.
1 <?php
2 require_once("./Services/Style/System/classes/Less/class.ilSystemStyleLessItem.php");
3 
4 /***
5  * Capsules data of a less variable in the variables to less file. A less variable has the following structure:
6  *
7  * //** Comment to describe the variable
8  * @variable: value;
9  *
10  *
11  * @author Timon Amstutz <timon.amstutz@ilub.unibe.ch>
12  * @version $Id$
13  *
14  */
16 {
17 
23  protected $name = "";
24 
30  protected $value = "";
31 
37  protected $comment = "";
38 
43  protected $category_name = "";
44 
50  protected $references = array();
51 
61  {
62  $this->setName($name);
63  $this->setValue($value);
65  $this->setComment($comment);
66  $this->setReferences($references);
67  }
68 
72  public function getName()
73  {
74  return $this->name;
75  }
76 
80  public function setName($name)
81  {
82  $this->name = $name;
83  }
84 
88  public function getValue()
89  {
90  return $this->value;
91  }
92 
96  public function setValue($value)
97  {
101  if($value == "\"../../Services/UICore/lib/bootstrap-3.2.0/fonts/\""){
102  $this->value = "\"../../../../Services/UICore/lib/bootstrap-3.2.0/fonts/\"";
103  }else{
104  $this->value = str_replace(PHP_EOL, '', $value);;
105 
106  }
107  }
108 
112  public function getComment()
113  {
114  return $this->comment;
115  }
116 
120  public function setComment($comment)
121  {
122  $this->comment = str_replace(PHP_EOL, '', $comment);
123  }
124 
128  public function getCategoryName()
129  {
130  return $this->category_name;
131  }
132 
137  {
138  $this->category_name = $category_name;
139  }
140 
144  public function getReferences()
145  {
146  return $this->references;
147  }
148 
152  public function setReferences($references)
153  {
154  $this->references = $references;
155  }
156 
157 
164  public function __toString()
165  {
166  $content = "";
167  if($this->getComment()){
168  $content .= "//** ".$this->getComment()."\n";
169  }
170  $content .= "@".$this->getName().":\t\t". $this->getValue().";\n";
171  return $content;
172  }
173 }
__construct($name, $value, $comment, $category_name, $references)
ilSystemStyleLessVariable constructor.
__toString()
This function will be needed to write the variable back to the less file and restore it&#39;s initial str...
comment()
Definition: comment.php:2
if($is_dev) echo "Review changes write something in WHATSNEW and and then commit with log PHP_EOL
Create styles array
The data for the language used.
Abstracts content of a less file.