ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
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
*/
15
class
ilSystemStyleLessVariable
extends
ilSystemStyleLessItem
16
{
17
23
protected
$name
=
""
;
24
30
protected
$value
=
""
;
31
37
protected
$comment
=
""
;
38
43
protected
$category_name
=
""
;
44
50
protected
$references
= array();
51
60
public
function
__construct
(
$name
,
$value
,
$comment
,
$category_name
,
$references
)
61
{
62
$this->
setName
(
$name
);
63
$this->
setValue
(
$value
);
64
$this->
setCategoryName
(
$category_name
);
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
{
98
if
($this->
getName
() ==
"icon-font-path"
) {
99
if
(
$value
[0] !=
"\""
) {
100
$value
=
"\""
.
$value
;
101
;
102
}
103
if
(substr(
$value
, -1, 1) !=
"\""
) {
104
$value
.=
"\""
;
105
}
106
107
if
(
$value
==
"\"../../libs/bower/bower_components/bootstrap/fonts/\""
) {
108
$value
=
"\"../../../../libs/bower/bower_components/bootstrap/fonts/\""
;
109
}
110
}
111
112
$value
= str_replace(
PHP_EOL
,
''
,
$value
);
113
$this->value = str_replace(
"\n"
,
''
,
$value
);
114
}
115
119
public
function
getComment
()
120
{
121
return
$this->comment
;
122
}
123
127
public
function
setComment
(
$comment
)
128
{
129
$comment
= str_replace(
PHP_EOL
,
''
,
$comment
);
130
$this->
comment
= str_replace(
"\n"
,
''
,
$comment
);
131
}
132
136
public
function
getCategoryName
()
137
{
138
return
$this->category_name
;
139
}
140
144
public
function
setCategoryName
(
$category_name
)
145
{
146
$this->category_name =
$category_name
;
147
}
148
152
public
function
getReferences
()
153
{
154
return
$this->references
;
155
}
156
160
public
function
setReferences
(
$references
)
161
{
162
$this->references =
$references
;
163
}
164
165
172
public
function
__toString
()
173
{
174
$content =
""
;
175
if
($this->
getComment
()) {
176
$content .=
"//** "
. $this->
getComment
() .
"\n"
;
177
}
178
$content .=
"@"
. $this->
getName
() .
":\t\t"
. $this->
getValue
() .
";\n"
;
179
return
$content;
180
}
181
}
ilSystemStyleLessVariable\setReferences
setReferences($references)
Definition:
class.ilSystemStyleLessVariable.php:160
ilSystemStyleLessVariable\$value
$value
Definition:
class.ilSystemStyleLessVariable.php:30
ilSystemStyleLessVariable\setComment
setComment($comment)
Definition:
class.ilSystemStyleLessVariable.php:127
ilSystemStyleLessVariable\__construct
__construct($name, $value, $comment, $category_name, $references)
ilSystemStyleLessVariable constructor.
Definition:
class.ilSystemStyleLessVariable.php:60
PHP_EOL
PHP_EOL
Definition:
complexTest.php:5
ilSystemStyleLessVariable\$category_name
$category_name
Definition:
class.ilSystemStyleLessVariable.php:43
ilSystemStyleLessVariable\getValue
getValue()
Definition:
class.ilSystemStyleLessVariable.php:88
ilSystemStyleLessVariable\getCategoryName
getCategoryName()
Definition:
class.ilSystemStyleLessVariable.php:136
ilSystemStyleLessVariable\$comment
$comment
Definition:
class.ilSystemStyleLessVariable.php:37
ilSystemStyleLessVariable\__toString
__toString()
This function will be needed to write the variable back to the less file and restore it's initial str...
Definition:
class.ilSystemStyleLessVariable.php:172
comment
comment()
Definition:
comment.php:2
ilSystemStyleLessVariable
Definition:
class.ilSystemStyleLessVariable.php:15
ilSystemStyleLessVariable\getComment
getComment()
Definition:
class.ilSystemStyleLessVariable.php:119
ilSystemStyleLessVariable\setCategoryName
setCategoryName($category_name)
Definition:
class.ilSystemStyleLessVariable.php:144
ilSystemStyleLessVariable\setName
setName($name)
Definition:
class.ilSystemStyleLessVariable.php:80
ilSystemStyleLessVariable\$name
$name
Definition:
class.ilSystemStyleLessVariable.php:23
ilSystemStyleLessVariable\getReferences
getReferences()
Definition:
class.ilSystemStyleLessVariable.php:152
ilSystemStyleLessVariable\$references
$references
Definition:
class.ilSystemStyleLessVariable.php:50
ilSystemStyleLessItem
Abstracts content of a less file.
Definition:
class.ilSystemStyleLessItem.php:9
ilSystemStyleLessVariable\setValue
setValue($value)
Definition:
class.ilSystemStyleLessVariable.php:96
ilSystemStyleLessVariable\getName
getName()
Definition:
class.ilSystemStyleLessVariable.php:72
php
Services
Style
System
classes
Less
class.ilSystemStyleLessVariable.php
Generated on Thu Feb 27 2025 19:02:05 for ILIAS by
1.8.13 (using
Doxyfile
)