ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
InfoTabVisibility.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
26use ILIAS\Refinery\Factory as Refinery;
27
32{
33 private const DEFAULT_INFO_TAB_VISIBILITY = true;
34 private const INPUT_LABEL = 'obj_tool_setting_info_tab';
35
36 public function __construct(
37 private bool $info_tab_visibility = self::DEFAULT_INFO_TAB_VISIBILITY
38 ) {
39 }
40
41 public function getVisibility(): bool
42 {
43 return $this->info_tab_visibility;
44 }
45
46 public function toForm(
47 \ilLanguage $language,
48 FieldFactory $field_factory,
50 ): Checkbox {
51 $trafo = $refinery->custom()->transformation(
52 function ($v): Property {
53 return new self($v);
54 }
55 );
56
57 return $field_factory->checkbox($language->txt(self::INPUT_LABEL))
59 ->withValue($this->getVisibility());
60 }
61}
Builds data types.
Definition: Factory.php:36
__construct(private bool $info_tab_visibility=self::DEFAULT_INFO_TAB_VISIBILITY)
toForm(\ilLanguage $language, FieldFactory $field_factory, Refinery $refinery)
language handling
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This describes checkbox inputs.
Definition: Checkbox.php:29
This is what a factory for input fields looks like.
Definition: Factory.php:31
withAdditionalTransformation(Transformation $trafo)
@inheritDoc