19 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 symbol(): \
ILIAS\Repository\Symbol\SymbolAdapterGUI
95 return $DIC->repository()->internal()->gui()->symbol();
98 protected function setType(
string $a_type): void
100 $this->type = $a_type;
110 $this->title = $a_title;
120 $this->postvar = $a_postvar;
131 $id = str_replace(
"]",
"__",
$id);
137 $this->
info = $a_info;
147 $this->alert = $a_alert;
157 $this->required = $a_required;
185 $this->parentform = $a_parentform;
196 $this->parent_gui = $a_val;
217 $this->hidden_title = $a_val;
238 return serialize($this->
getValue());
243 $data = unserialize($a_data);
246 $this->setValue(
$data);
258 $this->parent_table = $a_val;
274 if (!is_object($parent) && !isset($parent_table)) {
275 throw new Exception(
"Parent form/table not set for " . get_class($this) .
" to use serialize feature.");
291 if (!is_object($parent)) {
294 return "form_" . $parent->getId() .
"_" . $this->
getFieldId();
330 bool $a_sortable =
false,
331 bool $a_addremove =
true 335 "%s not supported for form property type %s",
341 $this->multi = $a_multi;
342 $this->multi_sortable = $a_sortable;
343 $this->multi_addremove = $a_addremove;
353 $this->multi_values = array_unique($a_values);
368 $tpl =
new ilTemplate(
"tpl.multi_icons.html",
true,
true,
"components/ILIAS/Form");
371 if ($this->multi_addremove) {
372 $tpl->setCurrentBlock(
"addremove");
373 $tpl->setVariable(
"ID",
$id);
374 $tpl->setVariable(
"TXT_ADD", $lng->
txt(
"add"));
375 $tpl->setVariable(
"TXT_REMOVE", $lng->
txt(
"remove"));
376 $tpl->setVariable(
"SRC_ADD", $this->
symbol()->glyph(
"add")->render());
377 $tpl->setVariable(
"SRC_REMOVE", $this->
symbol()->glyph(
"remove")->render());
378 $tpl->parseCurrentBlock();
381 if ($this->multi_sortable) {
382 $tpl->setCurrentBlock(
"sortable");
383 $tpl->setVariable(
"ID",
$id);
384 $tpl->setVariable(
"TXT_DOWN", $lng->
txt(
"down"));
385 $tpl->setVariable(
"TXT_UP", $lng->
txt(
"up"));
386 $tpl->setVariable(
"SRC_UP", $this->
symbol()->glyph(
"up")->render());
387 $tpl->setVariable(
"SRC_DOWN", $this->
symbol()->glyph(
"down")->render());
388 $tpl->parseCurrentBlock();
408 return str_replace(
"\x0B",
"", $a_text);
417 if ($str != $a_str) {
445 $t = $this->
refinery->kindlyTo()->int();
455 $t = $this->
refinery->custom()->transformation(
461 return [$k, (
int) $v];
475 protected function str($key): string
480 $t = $this->
refinery->kindlyTo()->string();
487 protected function raw($key)
489 $t = $this->
refinery->custom()->transformation(
function ($v) {
501 $t = $this->
refinery->custom()->transformation(
529 $t = $this->
refinery->custom()->transformation(
535 return [$k, (array) $v];
550 $no_transform = $this->
refinery->identity();
551 $w = $this->
http->wrapper();
552 if ($w->post()->has($key)) {
553 return is_array($w->post()->retrieve($key, $no_transform));
555 if ($w->query()->has($key)) {
556 return is_array($w->query()->retrieve($key, $no_transform));
568 $this->set_params[$key] = $val;
576 if (isset($this->set_params[$key])) {
577 return $this->set_params[$key];
579 $w = $this->
http->wrapper();
580 if ($w->post()->has($key)) {
581 return $w->post()->retrieve($key, $t);
583 if ($w->query()->has($key)) {
584 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.