ILIAS  release_8 Revision v8.23
ilSystemStyleLessCategory Class Reference

Capsules data of a less category in the variables to less file. More...

+ Inheritance diagram for ilSystemStyleLessCategory:
+ Collaboration diagram for ilSystemStyleLessCategory:

Public Member Functions

 __construct (string $name, string $comment='')
 
 getName ()
 
 setName (string $name)
 
 getComment ()
 
 setComment (string $comment)
 
 __toString ()
 This function will be needed to write the category back to the less file and restore it's initial structure in less. More...
 
- Public Member Functions inherited from ilSystemStyleLessItem
 __toString ()
 

Protected Attributes

string $name = ''
 Name of the category. More...
 
string $comment = ''
 Comment to describe what this category is about. More...
 

Detailed Description

Capsules data of a less category in the variables to less file.

A less category has the following structure:

//== NameOfCategory // //## Comment

Definition at line 28 of file class.ilSystemStyleLessCategory.php.

Constructor & Destructor Documentation

◆ __construct()

ilSystemStyleLessCategory::__construct ( string  $name,
string  $comment = '' 
)

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

References setComment(), and setName().

41  {
42  $this->setName($name);
43  $this->setComment($comment);
44  }
string $comment
Comment to describe what this category is about.
string $name
Name of the category.
+ Here is the call graph for this function:

Member Function Documentation

◆ __toString()

ilSystemStyleLessCategory::__toString ( )

This function will be needed to write the category back to the less file and restore it's initial structure in less.

Definition at line 72 of file class.ilSystemStyleLessCategory.php.

References getComment(), and getName().

72  : string
73  {
74  if ($this->getComment()) {
75  return '//== ' . $this->getName() . "\n//\n//## " . $this->getComment() . "\n";
76  } else {
77  return '//== ' . $this->getName() . "\n//\n//##\n";
78  }
79  }
+ Here is the call graph for this function:

◆ getComment()

ilSystemStyleLessCategory::getComment ( )

Definition at line 57 of file class.ilSystemStyleLessCategory.php.

References $comment.

Referenced by __toString().

57  : string
58  {
59  return $this->comment;
60  }
string $comment
Comment to describe what this category is about.
+ Here is the caller graph for this function:

◆ getName()

ilSystemStyleLessCategory::getName ( )

Definition at line 46 of file class.ilSystemStyleLessCategory.php.

References $name.

Referenced by __toString().

46  : string
47  {
48  return $this->name;
49  }
string $name
Name of the category.
+ Here is the caller graph for this function:

◆ setComment()

ilSystemStyleLessCategory::setComment ( string  $comment)

Definition at line 62 of file class.ilSystemStyleLessCategory.php.

References ILIAS\UI\examples\Symbol\Glyph\Comment\comment().

Referenced by __construct().

62  : void
63  {
64  $comment = str_replace(PHP_EOL, '', $comment);
65  $this->comment = str_replace("\n", '', $comment);
66  }
string $comment
Comment to describe what this category is about.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setName()

ilSystemStyleLessCategory::setName ( string  $name)

Definition at line 51 of file class.ilSystemStyleLessCategory.php.

Referenced by __construct().

51  : void
52  {
53  $name = str_replace(PHP_EOL, '', $name);
54  $this->name = str_replace("\n", '', $name);
55  }
string $name
Name of the category.
+ Here is the caller graph for this function:

Field Documentation

◆ $comment

string ilSystemStyleLessCategory::$comment = ''
protected

Comment to describe what this category is about.

Definition at line 38 of file class.ilSystemStyleLessCategory.php.

Referenced by getComment().

◆ $name

string ilSystemStyleLessCategory::$name = ''
protected

Name of the category.

Definition at line 33 of file class.ilSystemStyleLessCategory.php.

Referenced by getName().


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