2 require_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
15 protected static $js_path =
"./Modules/StudyProgramme/templates/js/";
39 parent::__construct();
42 $setterMethod =
"set" . ucfirst(
$key);
43 if (method_exists($this, $setterMethod)) {
44 $setterMethod($value);
49 $this->
setName(self::$default_from_name);
60 public static function addJavaScript($add_form_loader =
false, $js_base_path = null)
65 $js_path = (isset($js_base_path))? $js_base_path : self::$js_path;
67 $tpl->addJavaScript(
$js_path .
'ilAsyncPropertyFormGUI.js');
69 $global_config =
"$.ilAsyncPropertyForm.global_config.error_message_template = '" . self::getErrorMessageTemplate() .
"'; $.ilAsyncPropertyForm.global_config.async_form_name = '" . self::$default_from_name .
"';";
70 self::addOnLoadCode(
'global_config', $global_config);
72 if ($add_form_loader) {
73 self::addOnLoadCode(
'form_loader',
'$("body").ilAsyncPropertyForm();');
98 if (!$this->check_input_called) {
103 foreach ($this->
getItems() as $item) {
106 if (method_exists($item,
"getAlert") && $item->getAlert() !=
"") {
107 $errors[] = array(
'key' => $item->getFieldId(),
'message' => $item->getAlert());
134 $tpl =
new ilTemplate(
"tpl.property_form.html",
true,
true,
"Services/Form");
136 $tpl->setCurrentBlock(
"alert");
138 $tpl->setVariable(
"ALT_ALERT",
$lng->txt(
"alert"));
139 $tpl->setVariable(
"TXT_ALERT",
"[TXT_ALERT]");
140 $tpl->parseCurrentBlock();
141 $content = trim(
$tpl->get(
"alert"));
157 throw new ilException(
"You cannot clone into a already filled form!");
161 $properties = $reflect->getProperties(ReflectionProperty::IS_PUBLIC);
163 foreach ($properties as $property) {
164 $this->{$property->getName()} = $property->getValue($form_to_clone);
167 foreach ($form_to_clone->
getItems() as $item) {
190 if (!isset(self::$js_on_load_added[
$id])) {
191 $tpl->addOnLoadCode($content);
192 self::$js_on_load_added[
$id] = $content;
203 self::addJavaScript($this->
isAsync());
205 return parent::getHTML();
215 if (isset(
$_POST[
'cmd'])) {
231 $a_formaction .=
"&cmdMode=asynch";
234 $this->formaction = $a_formaction;
258 return self::$default_from_name;
284 self::$default_from_name = $a_name;
286 parent::setName($a_name);
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
special template class to simplify handling of ITX/PEAR