ILIAS  trunk Revision v11.0_alpha-1866-gfa368f7776e
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
LSTOCBuilder Class Reference

Class LSTOCBuilder. More...

+ Inheritance diagram for LSTOCBuilder:
+ Collaboration diagram for LSTOCBuilder:

Public Member Functions

 __construct ($parent, string $command, string $label='', ?int $parameter=null, $state=null)
 LSControlBuilder|LSTOCBuilder $parent. More...
 
 toJSON ()
 
 end ()
 Finish building the TOC.
Returns
ControlBuilder|TOCBuilder depending on the nesting level.
More...
 
 node (string $label, ?int $parameter=null, ?int $lp=null)
 Build a sub tree in the TOC.If a parameter is provided, the node in the TOC can be accessed itself.The $parameter can be used to pass additional information to View::updateGet if required, e.g. about a chapter in the content.
Parameters
mixed$stateone of the LP_ constants from TOCBuilder
More...
 
 item (string $label, int $parameter, $state=null, bool $current=false)
 Build an entry in the TOC.The parameter will be appended to the command when updating the state.The $parameter can be used to pass additional information to View::updateGet if required, e.g. about a chapter in the content.
Parameters
mixed$stateone of the LP_ constants from TOCBuilder
bool$currentis this the currently active item?
More...
 

Protected Attributes

array $structure
 
 $parent
 
string $command
 

Additional Inherited Members

- Data Fields inherited from ILIAS\KioskMode\TOCBuilder
const LP_NOT_STARTED = 0
 
const LP_IN_PROGRESS = 1
 
const LP_COMPLETED = 2
 
const LP_FAILED = 3
 

Detailed Description

Class LSTOCBuilder.

Definition at line 26 of file LSTOCBuilder.php.

Constructor & Destructor Documentation

◆ __construct()

LSTOCBuilder::__construct (   $parent,
string  $command,
string  $label = '',
?int  $parameter = null,
  $state = null 
)

LSControlBuilder|LSTOCBuilder $parent.

Definition at line 43 of file LSTOCBuilder.php.

References $command, and $parent.

44  {
45  $this->structure = [
46  'label' => $label,
47  'command' => $command,
48  'parameter' => $parameter,
49  'state' => $state,
50  'childs' => []
51  ];
52  $this->parent = $parent;
53  $this->command = $command;
54  }
string $command

Member Function Documentation

◆ end()

LSTOCBuilder::end ( )

Finish building the TOC.

Returns
ControlBuilder|TOCBuilder depending on the nesting level.

Implements ILIAS\KioskMode\TOCBuilder.

Definition at line 64 of file LSTOCBuilder.php.

References $parent, and $structure.

65  {
66  if ($this->parent instanceof LSTOCBuilder) {
67  $this->parent->structure['childs'][] = $this->structure;
68  }
69  return $this->parent;
70  }
Class LSTOCBuilder.
array $structure

◆ item()

LSTOCBuilder::item ( string  $label,
int  $parameter,
  $state = null,
bool  $current = false 
)

Build an entry in the TOC.The parameter will be appended to the command when updating the state.The $parameter can be used to pass additional information to View::updateGet if required, e.g. about a chapter in the content.

Parameters
mixed$stateone of the LP_ constants from TOCBuilder
bool$currentis this the currently active item?

Implements ILIAS\KioskMode\TOCBuilder.

Definition at line 85 of file LSTOCBuilder.php.

References $command.

Referenced by ilLMTOCExplorerGUI\renderLSTocNode().

85  : TOCBuilder
86  {
87  $item = [
88  'label' => $label,
89  'command' => $this->command,
90  'parameter' => $parameter,
91  'state' => $state,
92  'current' => $current
93  ];
94  $this->structure['childs'][] = $item;
95  return $this;
96  }
Build a nested table of contents for the view.
Definition: TOCBuilder.php:28
string $command
+ Here is the caller graph for this function:

◆ node()

LSTOCBuilder::node ( string  $label,
?int  $parameter = null,
?int  $lp = null 
)

Build a sub tree in the TOC.If a parameter is provided, the node in the TOC can be accessed itself.The $parameter can be used to pass additional information to View::updateGet if required, e.g. about a chapter in the content.

Parameters
mixed$stateone of the LP_ constants from TOCBuilder

Implements ILIAS\KioskMode\TOCBuilder.

Definition at line 75 of file LSTOCBuilder.php.

Referenced by ilLMTOCExplorerGUI\renderLSTocNode().

75  : TOCBuilder
76  {
77  //build node
78  $toc = new LSTOCBuilder($this, $this->command, $label, $parameter, $lp);
79  return $toc;
80  }
Build a nested table of contents for the view.
Definition: TOCBuilder.php:28
Class LSTOCBuilder.
+ Here is the caller graph for this function:

◆ toJSON()

LSTOCBuilder::toJSON ( )

Definition at line 56 of file LSTOCBuilder.php.

Referenced by ilKioskPageRenderer\buildToCSlate().

56  : string
57  {
58  return json_encode($this->structure);
59  }
+ Here is the caller graph for this function:

Field Documentation

◆ $command

string LSTOCBuilder::$command
protected

Definition at line 38 of file LSTOCBuilder.php.

Referenced by __construct(), and item().

◆ $parent

LSTOCBuilder::$parent
protected

Definition at line 36 of file LSTOCBuilder.php.

Referenced by __construct(), and end().

◆ $structure

array LSTOCBuilder::$structure
protected

Definition at line 31 of file LSTOCBuilder.php.

Referenced by end().


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