ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilSystemStyleLessCategory.php
Go to the documentation of this file.
1 <?php
2 require_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 }
__toString()
This function will be needed to write the category back to the less file and restore it&#39;s initial str...
Capsules data of a less category in the variables to less file.
comment()
Definition: comment.php:2
if($is_dev) echo "Review changes write something in WHATSNEW and and then commit with log PHP_EOL
Abstracts content of a less file.
__construct($name, $comment="")
ilSystemStyleLessCategory constructor.