ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
Section.php
Go to the documentation of this file.
1 <?php
2 
20 declare(strict_types=1);
21 
23 
26 use ILIAS\UI\Component as C;
27 
31 class Section extends Group implements C\Input\Field\Section
32 {
33  protected int $nesting_level = 0;
34 
35  public function __construct(
36  DataFactory $data_factory,
38  Language $lng,
39  array $inputs,
40  string $label,
41  ?string $byline = null
42  ) {
43  parent::__construct($data_factory, $refinery, $lng, $inputs, $label, $byline);
45  }
46 
47  public function setNestingLevel(int $nesting_level): void
48  {
49  $this->nesting_level = $nesting_level;
51  }
52 
53  public function getNestingLevel(): int
54  {
55  return $this->nesting_level;
56  }
57 
58  protected function setInputs(array $inputs): void
59  {
60  parent::setInputs($inputs);
62  }
63 
64  private function updateChildrenNestingLevels(): void
65  {
66  foreach ($this->getInputs() as $input) {
67  if ($input instanceof Section) {
68  $nesting_level = $this->getNestingLevel() + 1;
69  $input->setNestingLevel($nesting_level);
70  }
71  }
72  }
73 }
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:161
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(DataFactory $data_factory, \ILIAS\Refinery\Factory $refinery, Language $lng, array $inputs, string $label, ?string $byline=null)
Definition: Section.php:35
Factory for Date Formats.
Definition: Factory.php:26
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:32