ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
trait.ilObjFileCopyrightInput.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
23
28{
29 public function getCopyrightSelectionInput(string $lang_var_title): Radio
30 {
31 static $copyright_input;
32 // we chache the input field to avoid multiple creation in lists
33 if ($copyright_input !== null) {
34 return $copyright_input;
35 }
36
37 $copyright_input = $this->getUIFactory()->input()->field()->radio($this->getLanguage()->txt($lang_var_title));
38 foreach ($this->lom_services->copyrightHelper()->getNonOutdatedCopyrightPresets() as $copyright_option) {
39 $copyright_input = $copyright_input->withOption(
40 $copyright_option->identifier(),
41 $copyright_option->title(),
42 $copyright_option->description()
43 );
44 if ($copyright_option->isDefault()) {
45 $copyright_input = $copyright_input->withValue($copyright_option->identifier());
46 }
47 }
48
49 return $copyright_input;
50 }
51
52 abstract protected function getUIFactory(): Factory;
53
54 abstract protected function getLanguage(): \ilLanguage;
55}
Builds a Color from either hex- or rgb values.
Definition: Factory.php:31
This implements the radio input.
Definition: Radio.php:35
withOption(string $value, string $label, ?string $byline=null)
Definition: Radio.php:74
language handling
This is how the factory for UI elements looks.
Definition: Factory.php:38
trait ilObjFileCopyrightInput
getLanguage()