3 declare(strict_types=1);
58 string $a_postvar =
"" 62 if (isset($DIC[
"http"])) {
63 $this->
http = $DIC->http();
66 if (isset($DIC[
"refinery"])) {
70 $this->
ctrl = $DIC->ctrl();
71 $this->
lng = $DIC->language();
75 if (isset($DIC[
"http"])) {
76 $this->request = $DIC->http()->request();
78 if (isset($DIC[
"tpl"])) {
79 $this->global_tpl = $DIC[
'tpl'];
88 $cmd = $this->
ctrl->getCmd();
92 protected function setType(
string $a_type): void
94 $this->type = $a_type;
104 $this->title = $a_title;
114 $this->postvar = $a_postvar;
125 $id = str_replace(
"]",
"__",
$id);
131 $this->
info = $a_info;
141 $this->alert = $a_alert;
151 $this->required = $a_required;
179 $this->parentform = $a_parentform;
190 $this->parent_gui = $a_val;
211 $this->hidden_title = $a_val;
232 return serialize($this->
getValue());
237 $data = unserialize($a_data);
240 $this->setValue(
$data);
252 $this->parent_table = $a_val;
268 if (!is_object($parent) && !isset($parent_table)) {
269 throw new Exception(
"Parent form/table not set for " . get_class($this) .
" to use serialize feature.");
285 if (!is_object($parent)) {
288 return "form_" . $parent->getId() .
"_" . $this->
getFieldId();
324 bool $a_sortable =
false,
325 bool $a_addremove =
true 329 "%s not supported for form property type %s",
335 $this->multi = $a_multi;
336 $this->multi_sortable = $a_sortable;
337 $this->multi_addremove = $a_addremove;
347 $this->multi_values = array_unique($a_values);
362 $tpl =
new ilTemplate(
"tpl.multi_icons.html",
true,
true,
"Services/Form");
365 if ($this->multi_addremove) {
366 $tpl->setCurrentBlock(
"addremove");
368 $tpl->setVariable(
"TXT_ADD", $lng->
txt(
"add"));
369 $tpl->setVariable(
"TXT_REMOVE", $lng->
txt(
"remove"));
372 $tpl->parseCurrentBlock();
375 if ($this->multi_sortable) {
376 $tpl->setCurrentBlock(
"sortable");
378 $tpl->setVariable(
"TXT_DOWN", $lng->
txt(
"down"));
379 $tpl->setVariable(
"TXT_UP", $lng->
txt(
"up"));
382 $tpl->parseCurrentBlock();
402 return str_replace(
"\x0B",
"", $a_text);
411 if ($str != $a_str) {
439 $t = $this->
refinery->kindlyTo()->int();
449 $t = $this->
refinery->custom()->transformation(
455 return [$k, (
int) $v];
474 $t = $this->
refinery->kindlyTo()->string();
483 $t = $this->
refinery->custom()->transformation(
function ($v) {
495 $t = $this->
refinery->custom()->transformation(
523 $t = $this->
refinery->custom()->transformation(
529 return [$k, (array) $v];
544 $no_transform = $this->
refinery->identity();
545 $w = $this->
http->wrapper();
546 if ($w->post()->has($key)) {
547 return is_array($w->post()->retrieve($key, $no_transform));
549 if ($w->query()->has($key)) {
550 return is_array($w->query()->retrieve($key, $no_transform));
562 $this->set_params[
$key] = $val;
570 if (isset($this->set_params[$key])) {
571 return $this->set_params[
$key];
573 $w = $this->
http->wrapper();
574 if ($w->post()->has($key)) {
575 return $w->post()->retrieve($key, $t);
577 if ($w->query()->has($key)) {
578 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)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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...
static get(string $a_glyph, string $a_text="")
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static http()
Fetches the global http state from ILIAS.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
static clear(string $a_var)
static set(string $a_var, $a_val)
Set a value.