19 declare(strict_types=1);
33 public function __construct(
string $a_title =
"",
string $a_postvar =
"")
37 $this->
user = $DIC->user();
38 $this->ui_factory = $DIC->ui()->factory();
39 $this->
renderer = $DIC->ui()->renderer();
55 $this->input->setValue($value);
61 $this->line_values = $a_values[$this->
getPostVar()] ?? [];
74 public function render(
int $iterator_id): string
76 $tpl =
new ilTemplate(
"tpl.prop_generic_multi_line.html",
true,
true,
'components/ILIAS/DataCollection');
81 $tpl->setCurrentBlock(
'input');
82 $tpl->setVariable(
'CONTENT', $input->render());
83 $tpl->parseCurrentBlock();
85 $tpl->setVariable(
'IMAGE_PLUS', $this->
renderer->render($this->ui_factory->symbol()->glyph()->add()));
86 $tpl->setVariable(
'IMAGE_MINUS', $this->
renderer->render($this->ui_factory->symbol()->glyph()->remove()));
87 $tpl->setVariable(
'IMAGE_UP', $this->
renderer->render($this->ui_factory->symbol()->glyph()->up()));
88 $tpl->setVariable(
'IMAGE_DOWN', $this->
renderer->render($this->ui_factory->symbol()->glyph()->down()));
95 $output = $this->
render(0);
97 if (is_array($this->line_values) && count($this->line_values) > 0) {
99 foreach ($this->line_values as $i =>
$data) {
101 $object->setValue(
$data);
102 $output .= $object->render($i);
106 $output .= $this->
render(1);
109 $output =
'<div id="' . $this->
getFieldId() .
'" class="multi_line_input">' . $output .
'</div>';
110 $this->global_tpl->addJavaScript(
'assets/js/generic_multi_line_input.js');
112 $this->global_tpl->addOnLoadCode(
"il.DataCollection.genericMultiLineInit('$id');");
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
setVariable($variable, $value='')
Sets a variable value.
This is how the factory for UI elements looks.
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
__construct(Container $dic, ilPlugin $plugin)