ILIAS  trunk Revision v11.0_alpha-1723-g8e69f309bab
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
Section.php
Go to the documentation of this file.
1 <?php
2 
20 declare(strict_types=1);
21 
22 declare(strict_types=1);
23 
25 
28 use ILIAS\UI\Component as C;
29 
33 class Section extends Group implements C\Input\Field\Section
34 {
35  protected int $nesting_level = 0;
36 
37  public function __construct(
38  DataFactory $data_factory,
40  Language $lng,
41  array $inputs,
42  string $label,
43  ?string $byline = null
44  ) {
45  parent::__construct($data_factory, $refinery, $lng, $inputs, $label, $byline);
47  }
48 
49  public function setNestingLevel(int $nesting_level): void
50  {
51  $this->nesting_level = $nesting_level;
53  }
54 
55  public function getNestingLevel(): int
56  {
57  return $this->nesting_level;
58  }
59 
60  protected function setInputs(array $inputs): void
61  {
62  parent::setInputs($inputs);
64  }
65 
66  private function updateChildrenNestingLevels(): void
67  {
68  foreach ($this->getInputs() as $input) {
69  if ($input instanceof Section) {
70  $nesting_level = $this->getNestingLevel() + 1;
71  $input->setNestingLevel($nesting_level);
72  }
73  }
74  }
75 }
Interface Observer Contains several chained tasks and infos about them.
setInputs(array $inputs)
This setter should be used instead of accessing $this->inputs directly.
Definition: Group.php:163
__construct(DataFactory $data_factory, \ILIAS\Refinery\Factory $refinery, Language $lng, array $inputs, string $label, ?string $byline=null)
Definition: Section.php:37
Factory for Date Formats.
Definition: Factory.php:26
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Checkbox.php:21
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
global $lng
Definition: privfeed.php:31