ILIAS  trunk Revision v11.0_alpha-1731-gff9cd7e2bd3
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilObjectPropertyHeaderActionVisibility.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
24 
29 {
30  private const DEFAULT_HEADER_ACTION_VISIBILITY = true;
31 
32  private const INPUT_LABEL = 'obj_show_header_actions';
33 
34  public function __construct(
35  private bool $header_action_visibility = self::DEFAULT_HEADER_ACTION_VISIBILITY
36  ) {
37  }
38 
39  public function getVisibility(): bool
40  {
41  return $this->header_action_visibility;
42  }
43 
44  public function toForm(
45  \ilLanguage $language,
46  FieldFactory $field_factory,
48  ): Checkbox {
49  $trafo = $refinery->custom()->transformation(
50  function ($v): ilObjectProperty {
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  $top_actions_visibility_input = new ilCheckboxInputGUI(
64  $language->txt(self::INPUT_LABEL),
65  'show_top_actions'
66  );
67  $top_actions_visibility_input->setValue('1');
68  $top_actions_visibility_input->setChecked($this->getVisibility());
69 
70  return $top_actions_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 $header_action_visibility=self::DEFAULT_HEADER_ACTION_VISIBILITY)
toForm(\ilLanguage $language, FieldFactory $field_factory, Refinery $refinery)