19 declare(strict_types=1);
59 string $a_postvar =
"" 63 if (isset($DIC[
"http"])) {
64 $this->
http = $DIC->http();
67 if (isset($DIC[
"refinery"])) {
71 $this->
ctrl = $DIC->ctrl();
72 $this->
lng = $DIC->language();
76 if (isset($DIC[
"http"])) {
77 $this->request = $DIC->http()->request();
79 if (isset($DIC[
"tpl"])) {
80 $this->global_tpl = $DIC[
'tpl'];
89 $cmd = $this->
ctrl->getCmd();
93 protected function symbol(): \
ILIAS\Repository\Symbol\SymbolAdapterGUI
96 return $DIC->repository()->internal()->gui()->symbol();
99 protected function setType(
string $a_type): void
101 $this->type = $a_type;
111 $this->title = $a_title;
121 $this->postvar = $a_postvar;
132 $id = str_replace(
"]",
"__",
$id);
138 $this->
info = $a_info;
148 $this->alert = $a_alert;
158 $this->required = $a_required;
186 $this->parentform = $a_parentform;
197 $this->parent_gui = $a_val;
218 $this->hidden_title = $a_val;
239 return serialize($this->
getValue());
244 $data = unserialize($a_data);
247 $this->setValue(
$data);
259 $this->parent_table = $a_val;
275 if (!is_object($parent) && !isset($parent_table)) {
276 throw new Exception(
"Parent form/table not set for " . get_class($this) .
" to use serialize feature.");
292 if (!is_object($parent)) {
295 return "form_" . $parent->getId() .
"_" . $this->
getFieldId();
331 bool $a_sortable =
false,
332 bool $a_addremove =
true 336 "%s not supported for form property type %s",
342 $this->multi = $a_multi;
343 $this->multi_sortable = $a_sortable;
344 $this->multi_addremove = $a_addremove;
354 $this->multi_values = array_unique($a_values);
369 $tpl =
new ilTemplate(
"tpl.multi_icons.html",
true,
true,
"components/ILIAS/Form");
372 if ($this->multi_addremove) {
373 $tpl->setCurrentBlock(
"addremove");
374 $tpl->setVariable(
"ID",
$id);
375 $tpl->setVariable(
"TXT_ADD", $lng->
txt(
"add"));
376 $tpl->setVariable(
"TXT_REMOVE", $lng->
txt(
"remove"));
377 $tpl->setVariable(
"SRC_ADD", $this->
symbol()->glyph(
"add")->render());
378 $tpl->setVariable(
"SRC_REMOVE", $this->
symbol()->glyph(
"remove")->render());
379 $tpl->parseCurrentBlock();
382 if ($this->multi_sortable) {
383 $tpl->setCurrentBlock(
"sortable");
384 $tpl->setVariable(
"ID",
$id);
385 $tpl->setVariable(
"TXT_DOWN", $lng->
txt(
"down"));
386 $tpl->setVariable(
"TXT_UP", $lng->
txt(
"up"));
387 $tpl->setVariable(
"SRC_UP", $this->
symbol()->glyph(
"up")->render());
388 $tpl->setVariable(
"SRC_DOWN", $this->
symbol()->glyph(
"down")->render());
389 $tpl->parseCurrentBlock();
409 return str_replace(
"\x0B",
"", $a_text);
418 if ($str != $a_str) {
446 $t = $this->
refinery->kindlyTo()->int();
456 $t = $this->
refinery->custom()->transformation(
462 return [$k, (
int) $v];
476 protected function str($key): string
481 $t = $this->
refinery->kindlyTo()->string();
488 protected function raw($key)
490 $t = $this->
refinery->custom()->transformation(
function ($v) {
502 $t = $this->
refinery->custom()->transformation(
530 $t = $this->
refinery->custom()->transformation(
536 return [$k, (array) $v];
551 $no_transform = $this->
refinery->identity();
552 $w = $this->
http->wrapper();
553 if ($w->post()->has($key)) {
554 return is_array($w->post()->retrieve($key, $no_transform));
556 if ($w->query()->has($key)) {
557 return is_array($w->query()->retrieve($key, $no_transform));
569 $this->set_params[$key] = $val;
577 if (isset($this->set_params[$key])) {
578 return $this->set_params[$key];
580 $w = $this->
http->wrapper();
581 if ($w->post()->has($key)) {
582 return $w->post()->retrieve($key, $t);
584 if ($w->query()->has($key)) {
585 return $w->query()->retrieve($key, $t);
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static get(string $a_var)
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...
Interface Observer Contains several chained tasks and infos about them.
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
info()
description: > Example for rendering a info message box.
static http()
Fetches the global http state from ILIAS.
Interface for multi values support.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
static clear(string $a_var)
static set(string $a_var, $a_val)
Set a value.