4 include_once(
"./Services/Form/classes/class.ilFormGUI.php");
8 include_once(
"./Services/Form/classes/class.ilFormPropertyGUI.php");
9 include_once(
"./Services/Form/classes/class.ilSubEnabledFormPropertyGUI.php");
10 include_once(
"./Services/Form/classes/class.ilCheckboxInputGUI.php");
11 include_once(
"./Services/Form/classes/class.ilCustomInputGUI.php");
12 include_once(
"./Services/Form/classes/class.ilDateTimeInputGUI.php");
13 include_once(
"./Services/Form/classes/class.ilFileInputGUI.php");
14 include_once(
"./Services/Form/classes/class.ilImageFileInputGUI.php");
15 include_once(
'./Services/Form/classes/class.ilFlashFileInputGUI.php');
16 include_once(
"./Services/Form/classes/class.ilLocationInputGUI.php");
17 include_once(
"./Services/Form/classes/class.ilRadioGroupInputGUI.php");
18 include_once(
"./Services/Form/classes/class.ilCheckboxGroupInputGUI.php");
19 include_once(
"./Services/Form/classes/class.ilFormSectionHeaderGUI.php");
20 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
21 include_once(
"./Services/Form/classes/class.ilTextAreaInputGUI.php");
22 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
23 include_once(
"./Services/Form/classes/class.ilDurationInputGUI.php");
24 include_once(
"./Services/Form/classes/class.ilFeedUrlInputGUI.php");
25 include_once(
"./Services/Form/classes/class.ilNonEditableValueGUI.php");
26 include_once(
"./Services/Form/classes/class.ilRegExpInputGUI.php");
27 include_once(
'./Services/Form/classes/class.ilColorPickerInputGUI.php');
28 include_once(
'./Services/Form/classes/class.ilPasswordInputGUI.php');
29 include_once(
'./Services/Form/classes/class.ilUserLoginInputGUI.php');
30 include_once(
'./Services/Form/classes/class.ilEMailInputGUI.php');
31 include_once(
'./Services/Form/classes/class.ilHiddenInputGUI.php');
32 include_once(
'./Services/Form/classes/class.ilNumberInputGUI.php');
33 include_once(
'./Services/Form/classes/class.ilCSSRectInputGUI.php');
34 include_once(
'./Services/Form/classes/class.ilRadioMatrixInputGUI.php');
35 include_once(
'./Services/Form/classes/class.ilTextWizardInputGUI.php');
36 include_once
'./Services/Form/classes/class.ilFileWizardInputGUI.php';
37 include_once
'./Services/Form/classes/class.ilFormulaInputGUI.php';
38 include_once
'./Services/Form/classes/class.ilBirthdayInputGUI.php';
69 $lng->loadLanguageModule(
"form");
80 $next_class = $ilCtrl->getNextClass($this);
81 $cmd = $ilCtrl->getCmd();
85 case 'ilformpropertydispatchgui':
86 include_once
'./Services/Form/classes/class.ilFormPropertyDispatchGUI.php';
89 $form_prop_dispatch->setItem($item);
90 return $ilCtrl->forwardCommand($form_prop_dispatch);
106 $this->tbl_width = $a_width;
127 $this->mode = $a_mode;
147 $this->title = $a_title;
167 $this->titleicon = $a_titleicon;
187 $this->description = $a_val;
207 $this->top_anchor = $a_val;
227 $a_item->setParentForm($this);
228 return $this->items[] = $a_item;
238 foreach ($this->items as $key => $item)
240 if ($item->getPostVar() == $a_post_var)
242 unset($this->items[$key]);
254 foreach ($this->items as $key => $item)
256 if ($item->getType() !=
"section_header")
259 $ret = $item->getItemByPostVar($a_post_var);
277 $this->items = $a_items;
297 $this->disable_standard_message = $a_val;
317 foreach($this->items as $item)
319 $item->setValueByArray($a_values);
329 foreach($this->items as $item)
331 $item->setValueByArray(
$_POST);
345 if ($this->check_input_called)
347 die (
"Error: ilPropertyFormGUI->checkInput() called twice.");
351 foreach($this->items as $item)
353 $item_ok = $item->checkInput();
360 $this->check_input_called =
true;
372 if (!$this->check_input_called)
374 die (
"Error: ilPropertyFormGUI->getInput() called without calling checkInput() first.");
377 return $_POST[$a_post_var];
390 $a_alert =
"", $a_required =
false)
392 $this->properties[] = array (
"type" =>
"custom",
406 $this->buttons[] = array(
"cmd" => $a_cmd,
"text" => $a_text);
414 $this->buttons = array();
424 include_once(
"./Services/YUI/classes/class.ilYuiUtil.php");
429 $tpl->addJavaScript(
"Services/JavaScript/js/Basic.js");
430 $tpl->addJavaScript(
"Services/Form/js/ServiceForm.js");
432 $this->tpl =
new ilTemplate(
"tpl.property_form.html",
true,
true,
"Services/Form");
437 $this->tpl->setCurrentBlock(
"title_icon");
438 $this->tpl->setVariable(
"IMG_ICON", $this->
getTitleIcon());
439 $this->tpl->parseCurrentBlock();
445 $this->tpl->setCurrentBlock(
"header");
446 $this->tpl->setVariable(
"TXT_TITLE", $this->
getTitle());
447 $this->tpl->setVariable(
"LABEL", $this->
getTopAnchor());
448 $this->tpl->setVariable(
"TXT_DESCRIPTION", $this->
getDescription());
449 $this->tpl->parseCurrentBlock();
451 $this->tpl->touchBlock(
"item");
454 $this->required_text =
false;
455 foreach($this->items as $item)
457 if ($item->getType() !=
"hidden")
464 if ($this->required_text && $this->
getMode() ==
"std")
466 $this->tpl->setCurrentBlock(
"required_text");
467 $this->tpl->setVariable(
"TXT_REQUIRED", $lng->txt(
"required_field"));
468 $this->tpl->parseCurrentBlock();
472 foreach($this->buttons as $button)
474 $this->tpl->setCurrentBlock(
"cmd");
475 $this->tpl->setVariable(
"CMD", $button[
"cmd"]);
476 $this->tpl->setVariable(
"CMD_TXT", $button[
"text"]);
477 $this->tpl->parseCurrentBlock();
481 $hidden_fields =
false;
482 foreach($this->items as $item)
484 if ($item->getType() ==
"hidden")
486 $item->insert($this->tpl);
487 $hidden_fields =
true;
491 if ($this->required_text || count($this->buttons) > 0 || $hidden_fields)
493 $this->tpl->setCurrentBlock(
"commands");
494 $this->tpl->parseCurrentBlock();
497 if ($this->
getMode() ==
"subform")
499 $this->tpl->touchBlock(
"sub_table");
503 $this->tpl->touchBlock(
"std_table");
504 $this->tpl->setVariable(
'STD_TABLE_WIDTH',$this->
getTableWidth());
507 return $this->tpl->get();
514 $item->insert($this->tpl);
516 if ($item->getType() ==
"file" || $item->getType() ==
"image_file")
521 if ($item->getType() !=
"section_header")
524 if ($item->getInfo() !=
"")
526 $this->tpl->setCurrentBlock(
"description");
531 $this->tpl->setVariable(
"PROPERTY_DESCRIPTION",
533 $this->tpl->parseCurrentBlock();
536 if ($this->
getMode() ==
"subform")
539 if ($item->getType() !=
"non_editable_value")
541 if ($item->getRequired())
543 $this->tpl->touchBlock(
"sub_required");
544 $this->required_text =
true;
549 if ($item->getHiddenTitle() !=
"")
551 $this->tpl->setCurrentBlock(
"sub_hid_title");
552 $this->tpl->setVariable(
"SPHID_TITLE",
553 $item->getHiddenTitle());
554 $this->tpl->parseCurrentBlock();
557 $this->tpl->setCurrentBlock(
"sub_prop_start");
558 $this->tpl->setVariable(
"PROPERTY_TITLE", $item->getTitle());
559 if ($item->getType() !=
"non_editable_value")
561 $this->tpl->setVariable(
"LAB_ID", $item->getFieldId());
563 $this->tpl->parseCurrentBlock();
568 if ($item->getType() !=
"non_editable_value")
570 if ($item->getRequired())
572 $this->tpl->touchBlock(
"required");
573 $this->required_text =
true;
578 if ($item->getHiddenTitle() !=
"")
580 $this->tpl->setCurrentBlock(
"std_hid_title");
581 $this->tpl->setVariable(
"PHID_TITLE",
582 $item->getHiddenTitle());
583 $this->tpl->parseCurrentBlock();
586 $this->tpl->setCurrentBlock(
"std_prop_start");
587 $this->tpl->setVariable(
"PROPERTY_TITLE", $item->getTitle());
588 if ($item->getType() !=
"non_editable_value")
590 $this->tpl->setVariable(
"LAB_ID", $item->getFieldId());
592 $this->tpl->parseCurrentBlock();
596 if ($item->getType() !=
"non_editable_value" && $item->getAlert() !=
"")
598 $this->tpl->setCurrentBlock(
"alert");
599 $this->tpl->setVariable(
"IMG_ALERT",
601 $this->tpl->setVariable(
"ALT_ALERT",
603 $this->tpl->setVariable(
"TXT_ALERT",
605 $this->tpl->parseCurrentBlock();
610 if ($item->getType() !=
"non_editable_value" or 1)
612 $sf = $item->getSubForm();
613 if ($item->hideSubForm() && is_object($sf))
615 $this->tpl->setCurrentBlock(
"sub_form_hide");
616 $this->tpl->setVariable(
"DSFID", $item->getFieldId());
617 $this->tpl->parseCurrentBlock();
625 $sf_content = $sf->getContent();
626 if ($sf->getMultipart())
630 $this->tpl->setCurrentBlock(
"sub_form");
631 $this->tpl->setVariable(
"PROP_SUB_FORM", $sf_content);
632 $this->tpl->setVariable(
"SFID", $item->getFieldId());
633 $this->tpl->parseCurrentBlock();
636 $this->tpl->setCurrentBlock(
"prop");
638 $this->tpl->parseCurrentBlock();
641 $this->tpl->touchBlock(
"item");