3declare(strict_types=1);
34 protected static string $js_path =
"./Modules/StudyProgramme/templates/js/";
63 $setterMethod =
"set" . ucfirst(
$key);
64 if (method_exists($this, $setterMethod)) {
65 $setterMethod($value);
71 $this->
setName(self::$default_from_name);
79 public static function addJavaScript(
bool $add_form_loader =
false,
string $js_base_path =
null): void
86 $tpl->addJavaScript(
$js_path .
'ilAsyncPropertyFormGUI.js');
89 "$.ilAsyncPropertyForm.global_config.error_message_template = '" .
91 "'; $.ilAsyncPropertyForm.global_config.async_form_name = '" .
92 self::$default_from_name .
"';"
97 if ($add_form_loader) {
107 $result = parent::checkInput();
108 $this->has_errors = $result;
120 if (!$this->check_input_called) {
125 foreach ($this->
getItems() as $item) {
128 if (method_exists($item,
"getAlert") && $item->getAlert() !==
"") {
129 $errors[] = array(
'key' => $item->getFieldId(),
'message' => $item->getAlert());
151 $tpl =
new ilTemplate(
"tpl.property_form.html",
true,
true,
"Services/Form");
159 return trim(
$tpl->
get(
"alert"));
168 throw new ilException(
"You cannot clone into a already filled form!");
171 $reflect =
new ReflectionClass($this);
172 $properties = $reflect->getProperties(ReflectionProperty::IS_PUBLIC);
174 foreach ($properties as $property) {
175 $this->{$property->getName()} = $property->getValue($form_to_clone);
178 foreach ($form_to_clone->
getItems() as $item) {
197 if (!isset(self::$js_on_load_added[
$id])) {
198 $tpl->addOnLoadCode($content);
199 self::$js_on_load_added[
$id] = $content;
210 return parent::getHTML();
218 if ($this->request_wrapper->has(
"cmd")) {
231 $a_formaction .=
"&cmdMode=asynch";
234 $this->formaction = $a_formaction;
267 self::$default_from_name = $a_name;
269 parent::setName($a_name);
setVariable($variable, $value='')
Sets a variable value.
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...
special template class to simplify handling of ITX/PEAR
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
get(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
Returns a block with all replacements done.
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
Interface RequestWrapper.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc