80 parent::__construct($a_title, $a_postvar);
92 if (isset($this->hooks[
$key])) {
93 return $this->hooks[
$key];
116 if (isset($this->hooks[
$key])) {
117 unset($this->hooks[$key]);
188 public function setMulti($a_multi, $a_sortable =
false, $a_addremove =
true)
190 $this->multi = $a_multi;
201 foreach ($this->inputs as
$key => $item) {
202 if (method_exists($item,
'setValue')) {
203 $item->setValue($a_value[
$key]);
208 $this->value = $a_value;
220 foreach ($this->inputs as
$key => $item) {
237 $this->line_values =
$data;
254 $out_array = array();
256 foreach ($this->inputs as $input_key => $input) {
257 if (isset($item[$input_key])) {
258 $out_array[$item_num][$input_key] = (is_string($item[$input_key])) ? \
ilUtil::stripSlashes($item[$input_key]) : $item[$input_key];
267 foreach ($this->inputs as $input_key =>
$inputs) {
273 $this->
setAlert($lng->txt(
"msg_input_is_required"));
289 if (isset($this->cust_attr[
$key]) && !$override) {
330 public function render($iterator_id = 0, $clean_render =
false)
333 $tpl = new \ilTemplate(
"tpl.multi_line_input.html",
true,
true,
'Customizing/global/plugins/Services/Repository/RepositoryObject/LiveVoting');
334 $class =
'multi_input_line';
337 $tpl->setCurrentBlock(
'cust_attr');
338 $tpl->setVariable(
'CUSTOM_ATTR_KEY',
$key);
339 $tpl->setVariable(
'CUSTOM_ATTR_VALUE',
$value);
340 $tpl->parseCurrentBlock();
347 if (!method_exists($input,
'render')) {
356 throw new \ilException(
"Method " . get_class($input)
357 .
"::render() does not exists! You cannot use this input-type in ilMultiLineInputGUI");
361 $is_disabled_hook = $this->
getHook(self::HOOK_IS_INPUT_DISABLED);
362 if ($is_disabled_hook !==
false && !$clean_render) {
363 $input->setDisabled($is_disabled_hook($this->
getValue()));
366 $input->setDisabled(
true);
368 if ($iterator_id == 0 && !isset($this->post_var_cache[
$key])) {
369 $this->post_var_cache[
$key] = $input->getPostVar();
372 $input->setPostVar($this->post_var_cache[$key]);
375 $input->setPostVar($post_var);
376 $before_render_hook = $this->
getHook(self::HOOK_BEFORE_INPUT_RENDER);
377 if ($before_render_hook !==
false && !$clean_render) {
378 $input = $before_render_hook($this->
getValue(), $key, $input);
382 $tpl->setCurrentBlock(
'hidden');
383 $tpl->setVariable(
'NAME', $post_var);
388 $tpl->setCurrentBlock(
'input_label');
389 $tpl->setVariable(
'LABEL', $input->getTitle());
390 $tpl->setVariable(
'CONTENT', $input->getHTML());
391 $tpl->parseCurrentBlock();
392 $first_label =
false;
394 $tpl->setCurrentBlock(
'input');
395 $tpl->setVariable(
'CONTENT', $input->getHTML());
400 $tpl->setCurrentBlock(
'input_label');
401 $tpl->setVariable(
'LABEL', $input->getTitle());
402 $tpl->setVariable(
'CONTENT', $input->render());
403 $first_label =
false;
405 $tpl->setCurrentBlock(
'input');
406 $tpl->setVariable(
'CONTENT', $input->render());
412 $tpl->setCurrentBlock(
'input_info_label');
413 $tpl->setVariable(
'INFO_LABEL', $input->getInfo());
414 $tpl->parseCurrentBlock();
416 $tpl->setCurrentBlock(
'input_info');
417 $tpl->setVariable(
'INFO', $input->getInfo());
418 $tpl->parseCurrentBlock();
421 $tpl->parseCurrentBlock();
426 $is_removeable_hook = $this->
getHook(self::HOOK_IS_LINE_REMOVABLE);
427 if ($is_removeable_hook !==
false && !$clean_render) {
428 $show_remove = $is_removeable_hook($this->
getValue());
431 $image_minus = ($show_remove) ?
xlvoGlyphGUI::get(
'minus') :
'<span class="glyphicon glyphicon-minus hide"></span>';
432 $tpl->setCurrentBlock(
'multi_icons');
433 $tpl->setVariable(
'IMAGE_PLUS', $image_plus);
434 $tpl->setVariable(
'IMAGE_MINUS', $image_minus);
435 $tpl->parseCurrentBlock();
437 $tpl->setCurrentBlock(
'multi_icons_move');
440 $tpl->parseCurrentBlock();
451 $tpl->addJavascript(
'./Modules/OrgUnit/templates/default/multi_line_input.js');
465 if ($this->
getMulti() && is_array($this->line_values) && count($this->line_values) > 0) {
466 foreach ($this->line_values as $run =>
$data) {
468 $object->setValue(
$data);
469 $output .= $object->render($run);
478 .
'").multi_line_input(' . json_encode($this->input_options) .
')</script>';
480 $a_tpl->setCurrentBlock(
"prop_generic");
481 $a_tpl->setVariable(
"PROP_GENERIC",
$output);
482 $a_tpl->parseCurrentBlock();
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
This class represents a text area property in a property form.