ILIAS  trunk Revision v11.0_alpha-1731-gff9cd7e2bd3
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilObjectPropertyTitleAndIconVisiblity.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
24 
29 {
30  private const DEFAULT_TITLE_AND_ICON_VISIBILITY = true;
31  private const INPUT_LABEL = 'obj_show_title_and_icon';
32 
33  public function __construct(
34  private bool $title_and_icon_visibility = self::DEFAULT_TITLE_AND_ICON_VISIBILITY
35  ) {
36  }
37 
38  public function getVisibility(): bool
39  {
40  return $this->title_and_icon_visibility;
41  }
42 
43  public function toForm(
44  \ilLanguage $language,
45  FieldFactory $field_factory,
47  ): Checkbox {
48  $trafo = $refinery->custom()->transformation(
49  function ($v): ilObjectProperty {
51  }
52  );
53 
54  return $field_factory->checkbox($language->txt(self::INPUT_LABEL))
56  ->withValue($this->getVisibility());
57  }
58 
59 
60  public function toLegacyForm(
61  \ilLanguage $language
63  $title_and_icon_visibility_input = new ilCheckboxInputGUI(
64  $language->txt(self::INPUT_LABEL),
65  'show_header_icon_and_title'
66  );
67  $title_and_icon_visibility_input->setValue('1');
68  $title_and_icon_visibility_input->setChecked($this->getVisibility());
69 
70  return $title_and_icon_visibility_input;
71  }
72 }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
This describes checkbox inputs.
Definition: Checkbox.php:28
__construct(private bool $title_and_icon_visibility=self::DEFAULT_TITLE_AND_ICON_VISIBILITY)
toForm(\ilLanguage $language, FieldFactory $field_factory, Refinery $refinery)