19 declare(strict_types=1);
32 public function __construct(
string $a_title =
"",
string $a_postvar =
"")
36 $this->ui_factory = $DIC->ui()->factory();
37 $this->renderer = $DIC->ui()->renderer();
52 $this->input->setValue($value);
58 $this->line_values = $a_values[$this->
getPostVar()] ?? [];
71 public function render(
int $iterator_id): string
73 $tpl =
new ilTemplate(
"tpl.prop_generic_multi_line.html",
true,
true,
'components/ILIAS/DataCollection');
78 $tpl->setCurrentBlock(
'input');
79 $tpl->setVariable(
'CONTENT', $input->render());
80 $tpl->parseCurrentBlock();
82 $tpl->setVariable(
'IMAGE_PLUS', $this->renderer->render($this->ui_factory->symbol()->glyph()->add()));
83 $tpl->setVariable(
'IMAGE_MINUS', $this->renderer->render($this->ui_factory->symbol()->glyph()->remove()));
84 $tpl->setVariable(
'IMAGE_UP', $this->renderer->render($this->ui_factory->symbol()->glyph()->up()));
85 $tpl->setVariable(
'IMAGE_DOWN', $this->renderer->render($this->ui_factory->symbol()->glyph()->down()));
92 $output = $this->
render(0);
94 if (is_array($this->line_values) && count($this->line_values) > 0) {
96 foreach ($this->line_values as $i =>
$data) {
98 $object->setValue(
$data);
99 $output .= $object->render($i);
103 $output .= $this->
render(1);
106 $output =
'<div id="' . $this->
getFieldId() .
'" class="multi_line_input">' . $output .
'</div>';
107 $this->global_tpl->addJavaScript(
'assets/js/generic_multi_line_input.js');
109 $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)