ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilSystemStyleLessCategory.php
Go to the documentation of this file.
1<?php
2require_once("./Services/Style/System/classes/Less/class.ilSystemStyleLessItem.php");
3
17{
23 protected $name = "";
24
30 protected $comment = "";
31
37 public function __construct($name, $comment = "")
38 {
39 $this->setName($name);
40 $this->setComment($comment);
41 }
42
46 public function getName()
47 {
48 return $this->name;
49 }
50
54 public function setName($name)
55 {
56 $name = str_replace(PHP_EOL, '', $name);
57 $this->name = str_replace("\n", '', $name);
58 }
59
63 public function getComment()
64 {
65 return $this->comment;
66 }
67
71 public function setComment($comment)
72 {
73 $comment = str_replace(PHP_EOL, '', $comment);
74 $this->comment = str_replace("\n", '', $comment);
75 }
76
83 public function __toString()
84 {
85 if ($this->getComment()) {
86 return "//== " . $this->getName() . "\n//\n//## " . $this->getComment() . "\n";
87 } else {
88 return "//== " . $this->getName() . "\n//\n//##\n";
89 }
90 }
91}
An exception for terminatinating execution or to throw for unit testing.
Capsules data of a less category in the variables to less file.
__construct($name, $comment="")
ilSystemStyleLessCategory constructor.
__toString()
This function will be needed to write the category back to the less file and restore it's initial str...
Abstracts content of a less file.
comment()
Definition: comment.php:2