ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 ($name, $comment="")
 ilSystemStyleLessCategory constructor. More...
 
 getName ()
 
 setName ($name)
 
 getComment ()
 
 setComment ($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

 $name = ""
 
 $comment = ""
 

Detailed Description

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

A less category has the following structure:

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

Author
Timon Amstutz timon.nosp@m..ams.nosp@m.tutz@.nosp@m.ilub.nosp@m..unib.nosp@m.e.ch
Version
$Id$

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

Constructor & Destructor Documentation

◆ __construct()

ilSystemStyleLessCategory::__construct (   $name,
  $comment = "" 
)

ilSystemStyleLessCategory constructor.

Parameters
string$name
string$comment

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

References $comment, $name, setComment(), and setName().

+ 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.

Returns
string

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

References getComment(), and getName().

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  }
+ Here is the call graph for this function:

◆ getComment()

ilSystemStyleLessCategory::getComment ( )
Returns
string

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

References $comment.

Referenced by __toString().

+ Here is the caller graph for this function:

◆ getName()

ilSystemStyleLessCategory::getName ( )
Returns
string

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

References $name.

Referenced by __toString().

+ Here is the caller graph for this function:

◆ setComment()

ilSystemStyleLessCategory::setComment (   $comment)
Parameters
string$comment

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

References $comment, comment(), and PHP_EOL.

Referenced by __construct().

72  {
73  $comment = str_replace(PHP_EOL, '', $comment);
74  $this->comment = str_replace("\n", '', $comment);
75  }
comment()
Definition: comment.php:2
if($is_dev) echo "Review changes write something in WHATSNEW and and then commit with log PHP_EOL
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setName()

ilSystemStyleLessCategory::setName (   $name)
Parameters
string$name

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

References $name, and PHP_EOL.

Referenced by __construct().

55  {
56  $name = str_replace(PHP_EOL, '', $name);
57  $this->name = str_replace("\n", '', $name);
58  }
if($is_dev) echo "Review changes write something in WHATSNEW and and then commit with log PHP_EOL
+ Here is the caller graph for this function:

Field Documentation

◆ $comment

ilSystemStyleLessCategory::$comment = ""
protected

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

Referenced by __construct(), getComment(), and setComment().

◆ $name

ilSystemStyleLessCategory::$name = ""
protected

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

Referenced by __construct(), getName(), and setName().


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