ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilPropertyFormGUI Class Reference

This class represents a property form user interface. More...

+ Inheritance diagram for ilPropertyFormGUI:
+ Collaboration diagram for ilPropertyFormGUI:

Public Member Functions

 __construct ()
 Constructor. More...
 
 executeCommand ()
 Execute command. More...
 
 setTableWidth ($a_width)
 Set table width. More...
 
 getTableWidth ()
 get table width More...
 
 setMode ($a_mode)
 Set Mode ('std', 'subform'). More...
 
 getMode ()
 Get Mode ('std', 'subform'). More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. More...
 
 setTitleIcon ($a_titleicon)
 Set TitleIcon. More...
 
 getTitleIcon ()
 Get TitleIcon. More...
 
 setDescription ($a_val)
 Set description. More...
 
 getDescription ()
 Get description. More...
 
 setTopAnchor ($a_val)
 Set top anchor. More...
 
 getTopAnchor ()
 Get top anchor. More...
 
 setShowTopButtons ($a_val)
 Get show top buttons. More...
 
 getShowTopButtons ()
 Set show top buttons. More...
 
 addItem ($a_item)
 Add Item (Property, SectionHeader). More...
 
 removeItemByPostVar ($a_post_var)
 Remove Item. More...
 
 getItemByPostVar ($a_post_var)
 Get Item by POST variable. More...
 
 setItems ($a_items)
 Set Items. More...
 
 getItems ()
 Get Items. More...
 
 getInputItemsRecursive ()
 returns a flat array of all input items including the possibly existing subitems recursively More...
 
 setDisableStandardMessage ($a_val)
 Set disable standard message. More...
 
 getDisableStandardMessage ()
 Get disable standard message. More...
 
 getHideLabels ()
 Get a value indicating whether the labels should be hidden or not. More...
 
 setHideLabels ($a_value=true)
 Set a value indicating whether the labels should be hidden or not. More...
 
 setValuesByArray ($a_values, $a_restrict_to_value_keys=false)
 Set form values from an array. More...
 
 setValuesByPost ()
 Set form values from POST values. More...
 
 checkInput ()
 Check Post Input. More...
 
 getInput ($a_post_var, $ensureValidation=true)
 Returns the value of a HTTP-POST variable, identified by the passed id. More...
 
 addCustomProperty ($a_title, $a_html, $a_info="", $a_alert="", $a_required=false)
 Add a custom property. More...
 
 addCommandButton ($a_cmd, $a_text, $a_id="")
 Add Command button. More...
 
 getCommandButtons ()
 Return all Command buttons. More...
 
 clearCommandButtons ()
 Remove all command buttons. More...
 
 getContent ()
 Get Content. More...
 
 insertItem ($item, $a_sub_item=false)
 
 getHTML ()
 Get HTML. More...
 
 getFileUpload ($a_field, $a_index=null, $a_sub_index=null)
 Get file upload data. More...
 
 hasFileUpload ($a_field, $a_index=null, $a_sub_index=null)
 Was any file uploaded? More...
 
 moveFileUpload ($a_target_directory, $a_field, $a_target_name=null, $a_index=null, $a_sub_index=null)
 Move upload to target directory. More...
 
- Public Member Functions inherited from ilFormGUI
 setFormAction ($a_formaction)
 Set FormAction. More...
 
 getFormAction ()
 Get FormAction. More...
 
 setTarget ($a_target)
 Set Target. More...
 
 getTarget ()
 Get Target. More...
 
 setMultipart ($a_multipart)
 Set Enctype Multipart/Formdata true/false. More...
 
 getMultipart ()
 Get Enctype Multipart/Formdata true/false. More...
 
 setId ($a_id)
 Set Id. More...
 
 getId ()
 Get Id. More...
 
 setName ($a_name)
 Set Name. More...
 
 getName ()
 Get Name. More...
 
 setKeepOpen ($a_keepopen)
 Set Keep Form Tag Open. More...
 
 getKeepOpen ()
 Get Keep Form Tag Open. More...
 
 setOpenTag ($a_open)
 Enable/Disable Open Form Tag. More...
 
 getOpenTag ()
 Get Open Form Tag Enabled. More...
 
 setCloseTag ($a_val)
 Set close tag. More...
 
 getCloseTag ()
 Get close tag. More...
 
 setPreventDoubleSubmission ($a_val)
 Set prevent double submission. More...
 
 getPreventDoubleSubmission ()
 Get prevent double submission. More...
 
 getHTML ()
 Get HTML. More...
 
 getContent ()
 Get Content. More...
 

Protected Member Functions

 hideRequired ($a_type)
 
 rebuildUploadedFiles ()
 try to rebuild files
More...
 

Protected Attributes

 $mode = "std"
 
 $check_input_called = false
 
 $disable_standard_message = false
 
 $top_anchor = "il_form_top"
 
 $titleicon = false
 
 $description = ""
 
 $tbl_width = false
 
 $show_top_buttons = true
 
 $hide_labels = false
 
- Protected Attributes inherited from ilFormGUI
 $formaction
 
 $multipart = false
 
 $keepopen = false
 
 $opentag = true
 
 $id
 
 $name
 
 $prevent_double_submission = false
 

Private Attributes

 $buttons = array()
 
 $items = array()
 

Detailed Description

This class represents a property form user interface.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$ @ilCtrl_Calls ilPropertyFormGUI: ilFormPropertyDispatchGUI

Definition at line 47 of file class.ilPropertyFormGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilPropertyFormGUI::__construct ( )

Constructor.

Parameters

Reimplemented in ilAssOrderingQuestionAuthoringFormGUI, and ilAssQuestionAuthoringFormGUI.

Definition at line 66 of file class.ilPropertyFormGUI.php.

67 {
68 global $lng;
69
70 $lng->loadLanguageModule("form");
71
72 // avoid double submission
73 $this->setPreventDoubleSubmission(true);
74
75 // do it as early as possible
76 $this->rebuildUploadedFiles();
77 }
setPreventDoubleSubmission($a_val)
Set prevent double submission.
rebuildUploadedFiles()
try to rebuild files
global $lng
Definition: privfeed.php:17

References $lng, rebuildUploadedFiles(), and ilFormGUI\setPreventDoubleSubmission().

+ Here is the call graph for this function:

Member Function Documentation

◆ addCommandButton()

◆ addCustomProperty()

ilPropertyFormGUI::addCustomProperty (   $a_title,
  $a_html,
  $a_info = "",
  $a_alert = "",
  $a_required = false 
)

Add a custom property.

Parameters
stringTitle
stringHTML.
stringInfo text.
stringAlert text.
booleanRequired field. (Default false)

Definition at line 522 of file class.ilPropertyFormGUI.php.

524 {
525 $this->properties[] = array ("type" => "custom",
526 "title" => $a_title,
527 "html" => $a_html,
528 "info" => $a_info);
529 }

◆ addItem()

ilPropertyFormGUI::addItem (   $a_item)

Add Item (Property, SectionHeader).

Parameters
object$a_propertyItem object

Definition at line 248 of file class.ilPropertyFormGUI.php.

249 {
250 $a_item->setParentForm($this);
251 return $this->items[] = $a_item;
252 }

Referenced by FormMailCodesGUI\__construct(), ilObjTestSettingsGeneralGUI\addAvailabilityProperties(), ilObjRemoteCourseGUI\addCustomEditForm(), ilObjRemoteGlossaryGUI\addCustomEditForm(), ilObjRemoteGroupGUI\addCustomEditForm(), ilObjRemoteLearningModuleGUI\addCustomEditForm(), ilObjRemoteTestGUI\addCustomEditForm(), ilObjRemoteWikiGUI\addCustomEditForm(), ilAdvancedMDFieldDefinitionFloat\addCustomFieldToDefinitionForm(), ilAdvancedMDFieldDefinitionInteger\addCustomFieldToDefinitionForm(), ilAdvancedMDFieldDefinitionSelect\addCustomFieldToDefinitionForm(), ilAdvancedMDFieldDefinitionText\addCustomFieldToDefinitionForm(), ilConsultationHourCron\addCustomSettingsToForm(), ilLoggerCronCleanErrorFiles\addCustomSettingsToForm(), ilMailCronNotification\addCustomSettingsToForm(), ilMailCronOrphanedMails\addCustomSettingsToForm(), ilCronDeleteInactivatedUserAccounts\addCustomSettingsToForm(), ilCronDeleteInactiveUserAccounts\addCustomSettingsToForm(), ilDAVCronDiskQuota\addCustomSettingsToForm(), ilSCCronTrash\addCustomSettingsToForm(), SurveyMatrixQuestionGUI\addFieldsToEditForm(), SurveyMetricQuestionGUI\addFieldsToEditForm(), SurveyMultipleChoiceQuestionGUI\addFieldsToEditForm(), SurveySingleChoiceQuestionGUI\addFieldsToEditForm(), SurveyTextQuestionGUI\addFieldsToEditForm(), arEditGUI\addFormField(), ilCharSelectorGUI\addFormProperties(), ilObjTestSettingsGeneralGUI\addGeneralProperties(), ilPersonalProfileGUI\addLocationToForm(), ilMembershipRegistrationSettingsGUI\addMembershipFormElements(), ilObjTestSettingsScoringResultsGUI\addMiscSettingsFormSection(), ilObjTestSettingsGeneralGUI\addQuestionBehaviourProperties(), ilObjTestSettingsScoringResultsGUI\addResultDetailsSettingsFormSection(), ilObjTestSettingsScoringResultsGUI\addResultSummarySettingsFormSection(), ilObjTestSettingsScoringResultsGUI\addScoringSettingsFormSection(), ilECSObjectSettings\addSettingsToForm(), ilSkillTreeNodeGUI\addStatusInput(), ilObjTestSettingsGeneralGUI\addTestAccessProperties(), ilObjTestSettingsGeneralGUI\addTestFinishProperties(), ilObjTestSettingsGeneralGUI\addTestIntroProperties(), ilObjTestSettingsGeneralGUI\addTestRunProperties(), ilObjTestSettingsGeneralGUI\addTestSequenceProperties(), ilAdvancedMDFieldDefinition\addToFieldDefinitionForm(), ilTaxMDGUI\addToMDForm(), ilOrgUnitTypeFormGUI\addTranslationInputs(), ilStudyProgrammeTypeFormGUI\addTranslationInputs(), ilTestRandomQuestionSetGeneralConfigFormGUI\build(), ilAssQuestionSkillAssignmentPropertyFormGUI\build(), ilTestRandomQuestionSetPoolDefinitionFormGUI\build(), ilAsyncPropertyFormGUI\cloneForm(), ilAssQuestionFeedback\completeGenericFormProperties(), ilAssConfigurableMultiOptionQuestionFeedback\completeSpecificFormProperties(), ilAssMultiOptionQuestionFeedback\completeSpecificFormProperties(), getContent(), ilObjForumAdministrationGUI\getSettingsForm(), ilExAssignmentEditorGUI\handleDisabledPeerFields(), ilCourseLPBadgeGUI\initConfigForm(), ilUserProfileBadgeGUI\initConfigForm(), ilObjPortfolioGUI\initCopyPageFormOptions(), ilObjPortfolioTemplateGUI\initCopyPageFormOptions(), ilExcCriteriaText\initCustomForm(), ilObjPortfolioTemplateGUI\initDidacticTemplate(), ilObjectGUI\initDidacticTemplate(), ilObjBibliographicGUI\initEditCustomForm(), ilObjBlogGUI\initEditCustomForm(), ilObjBookingPoolGUI\initEditCustomForm(), ilObjDataCollectionGUI\initEditCustomForm(), ilObjExerciseGUI\initEditCustomForm(), ilObjItemGroupGUI\initEditCustomForm(), ilObjMediaPoolGUI\initEditCustomForm(), ilObjPollGUI\initEditCustomForm(), ilObjPortfolioBaseGUI\initEditCustomForm(), ilObjPortfolioTemplateGUI\initEditCustomForm(), ilObjBibliographicAdminLibrariesFormGUI\initForm(), ilPersonalChatSettingsFormGUI\initForm(), ilDclTableViewEditFormGUI\initForm(), ilOrgUnitTypeCustomIconsFormGUI\initForm(), ilOrgUnitTypeFormGUI\initForm(), ilStudyProgrammeTypeCustomIconsFormGUI\initForm(), ilStudyProgrammeTypeFormGUI\initForm(), arConfigFormGUI\initForm(), ilMemcacheServerFormGUI\initForm(), ilObjectServiceSettingsGUI\initServiceSettingsForm(), ilContainerGUI\initSortingForm(), insertItem(), ilAdministrationSettingsFormHandler\parseFieldDefinition(), assMatchingQuestionGUI\populateAnswerSpecificFormPart(), assMultipleChoiceGUI\populateAnswerSpecificFormPart(), assNumericGUI\populateAnswerSpecificFormPart(), assSingleChoiceGUI\populateAnswerSpecificFormPart(), assTextQuestionGUI\populateAnswerSpecificFormPart(), assTextSubsetGUI\populateAnswerSpecificFormPart(), assClozeTestGUI\populateAnswerSpecificFormPart(), assErrorTextGUI\populateAnswerSpecificFormPart(), assKprimChoiceGUI\populateAnswerSpecificFormPart(), assOrderingQuestionGUI\populateAnswerSpecificFormPart(), ilAssQuestionSkillAssignmentPropertyFormGUI\populateFullProperties(), ilAssQuestionSkillAssignmentPropertyFormGUI\populateLimitedProperties(), assImagemapQuestionGUI\populateQuestionSpecificFormPart(), assJavaAppletGUI\populateQuestionSpecificFormPart(), assMatchingQuestionGUI\populateQuestionSpecificFormPart(), assMultipleChoiceGUI\populateQuestionSpecificFormPart(), assNumericGUI\populateQuestionSpecificFormPart(), assOrderingHorizontalGUI\populateQuestionSpecificFormPart(), assOrderingQuestionGUI\populateQuestionSpecificFormPart(), assSingleChoiceGUI\populateQuestionSpecificFormPart(), assTextQuestionGUI\populateQuestionSpecificFormPart(), assTextSubsetGUI\populateQuestionSpecificFormPart(), assClozeTestGUI\populateQuestionSpecificFormPart(), assErrorTextGUI\populateQuestionSpecificFormPart(), assFileUploadGUI\populateQuestionSpecificFormPart(), assFlashQuestionGUI\populateQuestionSpecificFormPart(), assKprimChoiceGUI\populateQuestionSpecificFormPart(), assLongMenuGUI\populateQuestionSpecificFormPart(), assQuestionGUI\populateTaxonomyFormSection(), ilAdvancedMDFieldDefinitionSelect\prepareCustomDefinitionFormConfirmation(), and ilAdvancedMDFieldDefinition\prepareDefinitionFormConfirmation().

+ Here is the caller graph for this function:

◆ checkInput()

ilPropertyFormGUI::checkInput ( )

Check Post Input.

This method also strips slashes and html from input and sets the alert texts for the items, if the input was not ok.

Returns
boolean ok true/false

Reimplemented in ilAsyncPropertyFormGUI.

Definition at line 416 of file class.ilPropertyFormGUI.php.

417 {
418 global $lng;
419
420 if ($this->check_input_called)
421 {
422 die ("Error: ilPropertyFormGUI->checkInput() called twice.");
423 }
424
425 $ok = true;
426 foreach($this->items as $item)
427 {
428 $item_ok = $item->checkInput();
429 if(!$item_ok)
430 {
431 $ok = false;
432 }
433 }
434
435 // check if POST is missint completely (if post_max_size exceeded)
436 if (count($this->items) > 0 && !is_array($_POST))
437 {
438 $ok = false;
439 }
440
441 $this->check_input_called = true;
442
443
444
445 // try to keep uploads for another try
446 if(!$ok && $_POST["ilfilehash"] && sizeof($_FILES))
447 {
448 $hash = $_POST["ilfilehash"];
449
450 foreach($_FILES as $field => $data)
451 {
452 // we support up to 2 nesting levels (see test/assesment)
453 if(is_array($data["tmp_name"]))
454 {
455 foreach($data["tmp_name"] as $idx => $upload)
456 {
457 if(is_array($upload))
458 {
459 foreach($upload as $idx2 => $file)
460 {
461 if($file && is_uploaded_file($file))
462 {
463 $file_name = $data["name"][$idx][$idx2];
464 $file_type = $data["type"][$idx][$idx2];
465 $this->keepFileUpload($hash, $field, $file, $file_name, $file_type, $idx, $idx2);
466 }
467 }
468 }
469 else if($upload && is_uploaded_file($upload))
470 {
471 $file_name = $data["name"][$idx];
472 $file_type = $data["type"][$idx];
473 $this->keepFileUpload($hash, $field, $upload, $file_name, $file_type, $idx);
474 }
475 }
476 }
477 else
478 {
479 $this->keepFileUpload($hash, $field, $data["tmp_name"], $data["name"], $data["type"]);
480 }
481 }
482 }
483
484
485 if (!$ok && !$this->getDisableStandardMessage())
486 {
487 ilUtil::sendFailure($lng->txt("form_input_not_valid"));
488 }
489 return $ok;
490 }
$_POST["username"]
getDisableStandardMessage()
Get disable standard message.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file

References $_POST, $data, $file, $lng, $ok, getDisableStandardMessage(), and ilUtil\sendFailure().

Referenced by ilObjOrgUnitSettingsFormGUI\fillObject(), ilOrgUnitTypeAdvancedMetaDataFormGUI\fillObject(), ilOrgUnitTypeFormGUI\fillObject(), ilStudyProgrammeTypeAdvancedMetaDataFormGUI\fillObject(), ilStudyProgrammeTypeFormGUI\fillObject(), arConfigFormGUI\fillObject(), ilMemcacheServerFormGUI\fillObject(), ilExAssignmentEditorGUI\processForm(), ilExAssignmentEditorGUI\processPeerReviewForm(), ilPersonalChatSettingsFormGUI\saveChatOptions(), ilObjBibliographicAdminLibrariesFormGUI\saveObject(), and arEditGUI\setArFieldsAfterSubmit().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ clearCommandButtons()

ilPropertyFormGUI::clearCommandButtons ( )

Remove all command buttons.

Definition at line 555 of file class.ilPropertyFormGUI.php.

556 {
557 $this->buttons = array();
558 }

Referenced by ilAssOrderingQuestionAuthoringFormGUI\renewOrderingCommandButtons().

+ Here is the caller graph for this function:

◆ executeCommand()

ilPropertyFormGUI::executeCommand ( )

Execute command.

Reimplemented in ilPersonalChatSettingsFormGUI.

Definition at line 82 of file class.ilPropertyFormGUI.php.

83 {
84 global $ilCtrl;
85
86 $next_class = $ilCtrl->getNextClass($this);
87 $cmd = $ilCtrl->getCmd();
88
89 switch($next_class)
90 {
91 case 'ilformpropertydispatchgui':
92 $ilCtrl->saveParameter($this, 'postvar');
93 include_once './Services/Form/classes/class.ilFormPropertyDispatchGUI.php';
94 $form_prop_dispatch = new ilFormPropertyDispatchGUI();
95 $item = $this->getItemByPostVar($_REQUEST["postvar"]);
96 $form_prop_dispatch->setItem($item);
97 return $ilCtrl->forwardCommand($form_prop_dispatch);
98 break;
99
100 }
101 return false;
102 }
getItemByPostVar($a_post_var)
Get Item by POST variable.
global $ilCtrl
Definition: ilias.php:18
$cmd
Definition: sahs_server.php:35

References $cmd, $ilCtrl, and getItemByPostVar().

+ Here is the call graph for this function:

◆ getCommandButtons()

ilPropertyFormGUI::getCommandButtons ( )

Return all Command buttons.

Returns
array

Definition at line 548 of file class.ilPropertyFormGUI.php.

548 {
549 return $this->buttons;
550 }

References $buttons.

Referenced by ilAsyncPropertyFormGUI\cloneForm().

+ Here is the caller graph for this function:

◆ getContent()

ilPropertyFormGUI::getContent ( )

Get Content.

Reimplemented from ilFormGUI.

Definition at line 563 of file class.ilPropertyFormGUI.php.

564 {
565 global $lng, $tpl, $ilUser, $ilSetting;
566
567 include_once("./Services/YUI/classes/class.ilYuiUtil.php");
571
572 $tpl->addJavaScript("./Services/JavaScript/js/Basic.js");
573 $tpl->addJavaScript("Services/Form/js/Form.js");
574
575 $this->tpl = new ilTemplate("tpl.property_form.html", true, true, "Services/Form");
576
577 // check if form has not title and first item is a section header
578 // -> use section header for title and remove section header
579 // -> command buttons are presented on top
580 $fi = $this->items[0];
581 if ($this->getMode() == "std" &&
582 $this->getTitle() == "" &&
583 is_object($fi) && $fi->getType() == "section_header"
584 )
585 {
586 $this->setTitle($fi->getTitle());
587 unset($this->items[0]);
588 }
589
590
591 // title icon
592 if ($this->getTitleIcon() != "" && @is_file($this->getTitleIcon()))
593 {
594 $this->tpl->setCurrentBlock("title_icon");
595 $this->tpl->setVariable("IMG_ICON", $this->getTitleIcon());
596 $this->tpl->parseCurrentBlock();
597 }
598
599 // title
600 if ($this->getTitle() != "")
601 {
602 // commands on top
603 if (count($this->buttons) > 0 && $this->getShowTopButtons() && count($this->items) > 2)
604 {
605 // command buttons
606 foreach($this->buttons as $button)
607 {
608 $this->tpl->setCurrentBlock("cmd2");
609 $this->tpl->setVariable("CMD", $button["cmd"]);
610 $this->tpl->setVariable("CMD_TXT", $button["text"]);
611 if ($button["id"] != "")
612 {
613 $this->tpl->setVariable("CMD2_ID", " id='".$button["id"]."_top'");
614 }
615 $this->tpl->parseCurrentBlock();
616 }
617 $this->tpl->setCurrentBlock("commands2");
618 $this->tpl->parseCurrentBlock();
619 }
620
621 if (is_object($ilSetting))
622 {
623 if ($ilSetting->get('char_selector_availability') > 0)
624 {
625 require_once 'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
627 {
628 $char_selector = ilCharSelectorGUI::_getCurrentGUI();
629 if ($char_selector->getConfig()->getAvailability() == ilCharSelectorConfig::ENABLED)
630 {
631 $char_selector->addToPage();
632 $this->tpl->TouchBlock('char_selector');
633 }
634 }
635 }
636 }
637
638 $this->tpl->setCurrentBlock("header");
639 $this->tpl->setVariable("TXT_TITLE", $this->getTitle());
640 $this->tpl->setVariable("LABEL", $this->getTopAnchor());
641 $this->tpl->setVariable("TXT_DESCRIPTION", $this->getDescription());
642 $this->tpl->parseCurrentBlock();
643 }
644 $this->tpl->touchBlock("item");
645
646 // properties
647 $this->required_text = false;
648 foreach($this->items as $item)
649 {
650 if ($item->getType() != "hidden")
651 {
652 $this->insertItem($item);
653 }
654 }
655
656 // required
657 if ($this->required_text && $this->getMode() == "std")
658 {
659 $this->tpl->setCurrentBlock("required_text");
660 $this->tpl->setVariable("TXT_REQUIRED", $lng->txt("required_field"));
661 $this->tpl->parseCurrentBlock();
662 }
663
664 // command buttons
665 foreach($this->buttons as $button)
666 {
667 $this->tpl->setCurrentBlock("cmd");
668 $this->tpl->setVariable("CMD", $button["cmd"]);
669 $this->tpl->setVariable("CMD_TXT", $button["text"]);
670
671 if ($button["id"] != "")
672 {
673 $this->tpl->setVariable("CMD_ID", " id='".$button["id"]."'");
674 }
675
676 $this->tpl->parseCurrentBlock();
677 }
678
679 // #18808
680 if ($this->getMode() != "subform")
681 {
682 // try to keep uploads even if checking input fails
683 if($this->getMultipart())
684 {
685 $hash = $_POST["ilfilehash"];
686 if(!$hash)
687 {
688 $hash = md5(uniqid(mt_rand(), true));
689 }
690 $fhash = new ilHiddenInputGUI("ilfilehash");
691 $fhash->setValue($hash);
692 $this->addItem($fhash);
693 }
694 }
695
696 // hidden properties
697 $hidden_fields = false;
698 foreach($this->items as $item)
699 {
700 if ($item->getType() == "hidden")
701 {
702 $item->insert($this->tpl);
703 $hidden_fields = true;
704 }
705 }
706
707 if ($this->required_text || count($this->buttons) > 0 || $hidden_fields)
708 {
709 $this->tpl->setCurrentBlock("commands");
710 $this->tpl->parseCurrentBlock();
711 }
712
713
714 if ($this->getMode() == "subform")
715 {
716 $this->tpl->touchBlock("sub_table");
717 }
718 else
719 {
720 $this->tpl->touchBlock("std_table");
721 $this->tpl->setVariable('STD_TABLE_WIDTH',$this->getTableWidth());
722 }
723
724 return $this->tpl->get();
725 }
global $tpl
Definition: ilias.php:8
static _isAllowed()
Check if the CharSelector is allowed for the current GUI.
static _getCurrentGUI(ilObjTest $a_test_obj=null)
Get the GUI that is used for the currently available selector (other GUI instances may exist for conf...
getMultipart()
Get Enctype Multipart/Formdata true/false.
This class represents a hidden form property in a property form.
addItem($a_item)
Add Item (Property, SectionHeader).
getTableWidth()
get table width
getDescription()
Get description.
getTopAnchor()
Get top anchor.
insertItem($item, $a_sub_item=false)
getMode()
Get Mode ('std', 'subform').
getShowTopButtons()
Set show top buttons.
setTitle($a_title)
Set Title.
special template class to simplify handling of ITX/PEAR
static initDom()
Init YUI Dom.
static initEvent()
Init YUI Event.
static initAnimation()
Init YUI Animation.
global $ilSetting
Definition: privfeed.php:17
$ilUser
Definition: imgupload.php:18

References $_POST, $ilSetting, $ilUser, $lng, $tpl, ilCharSelectorGUI\_getCurrentGUI(), ilCharSelectorGUI\_isAllowed(), addItem(), ilCharSelectorConfig\ENABLED, getDescription(), getMode(), ilFormGUI\getMultipart(), getShowTopButtons(), getTableWidth(), getTitle(), getTitleIcon(), getTopAnchor(), ilYuiUtil\initAnimation(), ilYuiUtil\initDom(), ilYuiUtil\initEvent(), insertItem(), and setTitle().

+ Here is the call graph for this function:

◆ getDescription()

ilPropertyFormGUI::getDescription ( )

Get description.

Returns
string description

Definition at line 202 of file class.ilPropertyFormGUI.php.

References $description.

Referenced by getContent().

+ Here is the caller graph for this function:

◆ getDisableStandardMessage()

ilPropertyFormGUI::getDisableStandardMessage ( )

Get disable standard message.

Returns
boolean disable standard message

Definition at line 356 of file class.ilPropertyFormGUI.php.

References $disable_standard_message.

Referenced by checkInput().

+ Here is the caller graph for this function:

◆ getFileUpload()

ilPropertyFormGUI::getFileUpload (   $a_field,
  $a_index = null,
  $a_sub_index = null 
)

Get file upload data.

Parameters
string$a_fieldform field
mixed$a_indexform field index (if array)
mixed$a_sub_indexform field subindex (if array)
Returns
array (tmp_name, name, type, error, size, is_upload)

Definition at line 976 of file class.ilPropertyFormGUI.php.

977 {
978 $res = array();
979 if($a_index)
980 {
981 if($_FILES[$a_field]["tmp_name"][$a_index][$a_sub_index])
982 {
983 $res = array(
984 "tmp_name" => $_FILES[$a_field]["tmp_name"][$a_index][$a_sub_index],
985 "name" => $_FILES[$a_field]["name"][$a_index][$a_sub_index],
986 "type" => $_FILES[$a_field]["type"][$a_index][$a_sub_index],
987 "error" => $_FILES[$a_field]["error"][$a_index][$a_sub_index],
988 "size" => $_FILES[$a_field]["size"][$a_index][$a_sub_index],
989 "is_upload" => true
990 );
991 }
992 }
993 else if($a_sub_index)
994 {
995 if($_FILES[$a_field]["tmp_name"][$a_index])
996 {
997 $res = array(
998 "tmp_name" => $_FILES[$a_field]["tmp_name"][$a_index],
999 "name" => $_FILES[$a_field]["name"][$a_index],
1000 "type" => $_FILES[$a_field]["type"][$a_index],
1001 "error" => $_FILES[$a_field]["error"][$a_index],
1002 "size" => $_FILES[$a_field]["size"][$a_index],
1003 "is_upload" => true
1004 );
1005 }
1006 }
1007 else
1008 {
1009 if($_FILES[$a_field]["tmp_name"])
1010 {
1011 $res = array(
1012 "tmp_name" => $_FILES[$a_field]["tmp_name"],
1013 "name" => $_FILES[$a_field]["name"],
1014 "type" => $_FILES[$a_field]["type"],
1015 "error" => $_FILES[$a_field]["error"],
1016 "size" => $_FILES[$a_field]["size"],
1017 "is_upload" => true
1018 );
1019 }
1020 }
1021 return $res;
1022 }

References $res.

Referenced by hasFileUpload(), and moveFileUpload().

+ Here is the caller graph for this function:

◆ getHideLabels()

ilPropertyFormGUI::getHideLabels ( )

Get a value indicating whether the labels should be hidden or not.

Returns
boolean true, to hide the labels; otherwise, false.

Definition at line 366 of file class.ilPropertyFormGUI.php.

References $hide_labels.

Referenced by insertItem().

+ Here is the caller graph for this function:

◆ getHTML()

ilPropertyFormGUI::getHTML ( )

Get HTML.

Reimplemented from ilFormGUI.

Reimplemented in ilAsyncPropertyFormGUI.

Definition at line 900 of file class.ilPropertyFormGUI.php.

901 {
902 $html = parent::getHTML();
903
904 // #13531 - get content that has to reside outside of the parent form tag, e.g. panels/layers
905 foreach($this->items as $item)
906 {
907 // #13536 - ilFormSectionHeaderGUI does NOT extend ilFormPropertyGUI ?!
908 if(method_exists($item, "getContentOutsideFormTag"))
909 {
910 $outside = $item->getContentOutsideFormTag();
911 if($outside)
912 {
913 $html .= $outside;
914 }
915 }
916 }
917
918 return $html;
919 }
$html
Definition: example_001.php:87

References $html.

Referenced by ilChatroomAdminViewGUI\createSettingTemplate(), ilIndividualAssessmentMemberGUI\renderForm(), ilIndividualAssessmentSettingsGUI\renderForm(), arGUI\save(), and ilPersonalChatSettingsFormGUI\showChatOptions().

+ Here is the caller graph for this function:

◆ getInput()

ilPropertyFormGUI::getInput (   $a_post_var,
  $ensureValidation = true 
)

Returns the value of a HTTP-POST variable, identified by the passed id.

Parameters
stringThe key used for value determination
booleanA flag whether the form input has to be validated before calling this method
Returns
string The value of a HTTP-POST variable, identified by the passed id @access public

Definition at line 502 of file class.ilPropertyFormGUI.php.

503 {
504 // this check ensures, that checkInput has been called (incl. stripSlashes())
505 if (!$this->check_input_called && $ensureValidation)
506 {
507 die ("Error: ilPropertyFormGUI->getInput() called without calling checkInput() first.");
508 }
509
510 return $_POST[$a_post_var];
511 }

References $_POST.

Referenced by ilAdvancedMDFieldDefinitionSelect\buildConfirmedObjects(), ilDclTextFieldModel\checkFieldCreationInput(), ilDclBaseFieldModel\checkValidityFromForm(), ilDclTextFieldModel\checkValidityFromForm(), ilDclTableViewEditFormGUI\createTableView(), ilObjOrgUnitSettingsFormGUI\fillObject(), ilOrgUnitTypeAdvancedMetaDataFormGUI\fillObject(), ilOrgUnitTypeFormGUI\fillObject(), ilStudyProgrammeTypeAdvancedMetaDataFormGUI\fillObject(), ilStudyProgrammeTypeFormGUI\fillObject(), ilMemcacheServerFormGUI\fillObject(), ilCourseLPBadgeGUI\getConfigFromForm(), ilCharSelectorGUI\getFormValues(), ilAdvancedMDFieldDefinitionFloat\importCustomDefinitionFormPostValues(), ilAdvancedMDFieldDefinitionInteger\importCustomDefinitionFormPostValues(), ilAdvancedMDFieldDefinitionSelect\importCustomDefinitionFormPostValues(), ilAdvancedMDFieldDefinitionSelectMulti\importCustomDefinitionFormPostValues(), ilAdvancedMDFieldDefinitionText\importCustomDefinitionFormPostValues(), ilExcCriteriaText\importCustomForm(), ilAdvancedMDFieldDefinition\importDefinitionFormPostValues(), SurveyMatrixQuestionGUI\importEditFormValues(), SurveyMetricQuestionGUI\importEditFormValues(), SurveyMultipleChoiceQuestionGUI\importEditFormValues(), SurveySingleChoiceQuestionGUI\importEditFormValues(), SurveyTextQuestionGUI\importEditFormValues(), ilAdvancedMDFieldDefinitionSelect\prepareCustomDefinitionFormConfirmation(), ilAdvancedMDFieldDefinition\prepareDefinitionFormConfirmation(), ilExAssignmentEditorGUI\processForm(), ilExAssignmentEditorGUI\processPeerReviewForm(), ilPersonalChatSettingsFormGUI\saveChatOptions(), ilMemberAgreementGUI\saveCourseDefinedFields(), ilForumCronNotification\saveCustomSettings(), ilConsultationHourCron\saveCustomSettings(), ilLoggerCronCleanErrorFiles\saveCustomSettings(), ilMailCronOrphanedMails\saveCustomSettings(), ilSCCronTrash\saveCustomSettings(), ilAssQuestionFeedback\saveGenericFormProperties(), ilObjBibliographicAdminLibrariesFormGUI\saveObject(), ilContainerGUI\saveSortingSettings(), ilAssConfigurableMultiOptionQuestionFeedback\saveSpecificFormProperties(), ilAssMultiOptionQuestionFeedback\saveSpecificFormProperties(), ilObjTestSettingsGeneralGUI\saveTestRunProperties(), ilObjTestSettingsGeneralGUI\saveTestSequenceSettings(), arConfigFormGUI\saveValueForItem(), arEditGUI\setDateTimeRecordField(), ilBookingScheduleGUI\setDefinitionFromPost(), arEditGUI\setNumericRecordField(), arEditGUI\setTextRecordField(), ilObjBibliographicGUI\updateCustom(), ilObjBlogGUI\updateCustom(), ilObjBookingPoolGUI\updateCustom(), ilObjDataCollectionGUI\updateCustom(), ilObjExerciseGUI\updateCustom(), ilObjItemGroupGUI\updateCustom(), ilObjMediaPoolGUI\updateCustom(), ilObjPollGUI\updateCustom(), ilObjPortfolioBaseGUI\updateCustom(), ilObjPortfolioGUI\updateCustom(), ilObjPortfolioTemplateGUI\updateCustom(), ilObjectServiceSettingsGUI\updateServiceSettingsForm(), ilDclTableViewEditFormGUI\updateTableView(), ilObjOrgUnitSettingsFormGUI\updateTranslation(), ilObjPollGUI\validateCustom(), SurveyMultipleChoiceQuestionGUI\validateEditForm(), and ilCourseLPBadgeGUI\validateForm().

+ Here is the caller graph for this function:

◆ getInputItemsRecursive()

ilPropertyFormGUI::getInputItemsRecursive ( )

returns a flat array of all input items including the possibly existing subitems recursively

Returns
array

Definition at line 319 of file class.ilPropertyFormGUI.php.

320 {
321 $inputItems = array();
322
323 foreach($this->items as $item)
324 {
325 if( $item->getType() == 'section_header' )
326 {
327 continue;
328 }
329
330 $inputItems[] = $item;
331
332 if( $item instanceof ilSubEnabledFormPropertyGUI )
333 {
334 $inputItems = array_merge( $inputItems, $item->getSubInputItemsRecursive() );
335 }
336 }
337
338 return $inputItems;
339 }
This class represents a property that may include a sub form.

Referenced by ilTestSettingsChangeConfirmationGUI\populateParametersFromPropertyForm(), and ilObjTestSettingsScoringResultsGUI\showConfirmation().

+ Here is the caller graph for this function:

◆ getItemByPostVar()

ilPropertyFormGUI::getItemByPostVar (   $a_post_var)

Get Item by POST variable.

Parameters
string$a_postvarPost Var

Definition at line 275 of file class.ilPropertyFormGUI.php.

276 {
277 foreach ($this->items as $key => $item)
278 {
279 if ($item->getType() != "section_header")
280 {
281 //if ($item->getPostVar() == $a_post_var)
282 $ret = $item->getItemByPostVar($a_post_var);
283 if (is_object($ret))
284 {
285 return $ret;
286 }
287 }
288 }
289
290 return false;
291 }
$ret
Definition: parser.php:6

References $ret.

Referenced by ilCronDeleteInactiveUserAccounts\addCustomSettingsToForm(), ilTestRandomQuestionSetPoolDefinitionFormGUI\applySubmit(), ilChatroomFormFactory\applyValues(), ilDclTextFieldModel\checkFieldCreationInput(), executeCommand(), ilExcCriteriaText\exportCustomForm(), ilExcCriteriaGUI\exportForm(), ilExcCriteriaCatalogueGUI\exportForm(), assOrderingQuestion\fetchSolutionListFromSubmittedForm(), ilTestSettingsGUI\formPropertyExists(), ilObjQuestionPoolSettingsGeneralGUI\formPropertyExists(), ilExAssignmentEditorGUI\getAssignmentValues(), ilAssOrderingQuestionAuthoringFormGUI\getOrderingElementInputField(), ilExAssignmentEditorGUI\handleDisabledFields(), ilExAssignmentEditorGUI\handleDisabledPeerFields(), ilObjTestSettingsScoringResultsGUI\hasScoringSettingsChanged(), ilCourseLPBadgeGUI\importConfigToForm(), ilUserProfileBadgeGUI\importConfigToForm(), ilAdvancedMDFieldDefinition\importDefinitionFormPostValues(), ilAssQuestionFeedback\initGenericFormProperties(), ilAssConfigurableMultiOptionQuestionFeedback\initSpecificFormProperties(), ilAssMultiOptionQuestionFeedback\initSpecificFormProperties(), ilObjTestSettingsGeneralGUI\isSkillServiceSettingToBeAdjusted(), assMatchingQuestionGUI\isValidTermAndDefinitionAmount(), ilObjTestDynamicQuestionSetConfigGUI\performSaveForm(), ilObjTestSettingsGeneralGUI\performSaveForm(), ilObjQuestionPoolSettingsGeneralGUI\performSaveForm(), ilAdvancedMDFieldDefinitionSelect\prepareCustomDefinitionFormConfirmation(), ilAdvancedMDFieldDefinition\prepareDefinitionFormConfirmation(), ilExAssignmentEditorGUI\processForm(), ilExAssignmentEditorGUI\processPeerReviewForm(), ilAssOrderingQuestionAuthoringFormGUI\renewOrderingElementInput(), ilTestRandomQuestionSetGeneralConfigFormGUI\save(), ilObjTestSettingsGeneralGUI\saveAvailabilityProperties(), ilCronDeleteInactiveUserAccounts\saveCustomSettings(), ilObjTestSettingsGeneralGUI\saveGeneralProperties(), ilObjTestSettingsGeneralGUI\saveQuestionBehaviourProperties(), ilObjTestSettingsScoringResultsGUI\saveResultDetailsSettings(), ilObjTestSettingsScoringResultsGUI\saveResultMiscOptionsSettings(), ilObjTestSettingsScoringResultsGUI\saveResultSummarySettings(), ilObjTestSettingsScoringResultsGUI\saveScoringSettingsFormSection(), ilObjTestSettingsGeneralGUI\saveTestAccessProperties(), ilObjTestSettingsGeneralGUI\saveTestFinishProperties(), ilObjTestSettingsGeneralGUI\saveTestIntroProperties(), ilObjTestSettingsGeneralGUI\saveTestRunProperties(), ilObjTestSettingsGeneralGUI\saveTestSequenceSettings(), ilBadgeManagementGUI\setBadgeFormValues(), ilMemberAgreementGUI\setCourseDefinedFieldValues(), ilBookingScheduleGUI\setDefinitionFromPost(), ilExAssignmentEditorGUI\setDisabledFieldValues(), ilExAssignmentEditorGUI\setDisabledPeerReviewFieldValues(), ilCharSelectorGUI\setFormValues(), ilSessionMembershipRegistrationSettingsGUI\setFormValues(), ilObjBadgeAdministrationGUI\setImageTemplateFormValues(), ilObjBlogGUI\updateCustom(), ilObjPollGUI\updateCustom(), ilObjPortfolioBaseGUI\updateCustom(), ilObjPortfolioTemplateGUI\updateCustom(), ilObjPollGUI\validateCustom(), SurveyMultipleChoiceQuestionGUI\validateEditForm(), ilCourseLPBadgeGUI\validateForm(), assImagemapQuestionGUI\writeAnswerSpecificPostData(), assKprimChoiceGUI\writeAnswerSpecificPostData(), assKprimChoiceGUI\writeQuestionSpecificPostData(), and assMultipleChoiceGUI\writeQuestionSpecificPostData().

+ Here is the caller graph for this function:

◆ getItems()

ilPropertyFormGUI::getItems ( )

◆ getMode()

ilPropertyFormGUI::getMode ( )

Get Mode ('std', 'subform').

Returns
string Mode ('std', 'subform')

Definition at line 142 of file class.ilPropertyFormGUI.php.

143 {
144 return $this->mode;
145 }

References $mode.

Referenced by getContent(), and insertItem().

+ Here is the caller graph for this function:

◆ getShowTopButtons()

ilPropertyFormGUI::getShowTopButtons ( )

Set show top buttons.

Definition at line 238 of file class.ilPropertyFormGUI.php.

References $show_top_buttons.

Referenced by getContent().

+ Here is the caller graph for this function:

◆ getTableWidth()

ilPropertyFormGUI::getTableWidth ( )
final

get table width

@access public

Definition at line 122 of file class.ilPropertyFormGUI.php.

References $tbl_width.

Referenced by getContent().

+ Here is the caller graph for this function:

◆ getTitle()

ilPropertyFormGUI::getTitle ( )

Get Title.

Returns
string Title

Definition at line 162 of file class.ilPropertyFormGUI.php.

163 {
164 return $this->title;
165 }

References $title.

Referenced by getContent().

+ Here is the caller graph for this function:

◆ getTitleIcon()

ilPropertyFormGUI::getTitleIcon ( )

Get TitleIcon.

Returns
string TitleIcon

Definition at line 182 of file class.ilPropertyFormGUI.php.

References $titleicon.

Referenced by getContent().

+ Here is the caller graph for this function:

◆ getTopAnchor()

ilPropertyFormGUI::getTopAnchor ( )

Get top anchor.

Returns
string top anchor

Definition at line 222 of file class.ilPropertyFormGUI.php.

References $top_anchor.

Referenced by getContent().

+ Here is the caller graph for this function:

◆ hasFileUpload()

ilPropertyFormGUI::hasFileUpload (   $a_field,
  $a_index = null,
  $a_sub_index = null 
)

Was any file uploaded?

Parameters
string$a_fieldform field
mixed$a_indexform field index (if array)
mixed$a_sub_indexform field subindex (if array)
Returns
bool

Definition at line 1032 of file class.ilPropertyFormGUI.php.

1033 {
1034 $data = $this->getFileUpload($a_field, $a_index, $a_sub_index);
1035 return (bool)$data["tmp_name"];
1036 }
getFileUpload($a_field, $a_index=null, $a_sub_index=null)
Get file upload data.

References $data, and getFileUpload().

+ Here is the call graph for this function:

◆ hideRequired()

ilPropertyFormGUI::hideRequired (   $a_type)
protected

Definition at line 727 of file class.ilPropertyFormGUI.php.

728 {
729 // #15818
730 return in_array($a_type, array("non_editable_value"));
731 }
$a_type
Definition: workflow.php:93

References $a_type.

Referenced by insertItem().

+ Here is the caller graph for this function:

◆ insertItem()

ilPropertyFormGUI::insertItem (   $item,
  $a_sub_item = false 
)

Definition at line 733 of file class.ilPropertyFormGUI.php.

734 {
735 global $tpl, $lng;
736
737
738 $cfg = array();
739
740 //if(method_exists($item, "getMulti") && $item->getMulti())
741 if ($item instanceof ilMultiValuesItem && $item->getMulti())
742 {
743 $tpl->addJavascript("./Services/Form/js/ServiceFormMulti.js");
744
745 $this->tpl->setCurrentBlock("multi_in");
746 $this->tpl->setVariable("ID", $item->getFieldId());
747 $this->tpl->parseCurrentBlock();
748
749 $this->tpl->touchBlock("multi_out");
750
751
752 // add hidden item to enable preset multi items
753 // not used yet, should replace hidden field stuff
754 $multi_values = $item->getMultiValues();
755 if(is_array($multi_values) && sizeof($multi_values) > 1)
756 {
757 $multi_value = new ilHiddenInputGUI("ilMultiValues~".$item->getPostVar());
758 $multi_value->setValue(implode("~", $multi_values));
759 $this->addItem($multi_value);
760 }
761 $cfg["multi_values"] = $multi_values;
762 }
763
764 $item->insert($this->tpl);
765
766 if ($item->getType() == "file" || $item->getType() == "image_file")
767 {
768 $this->setMultipart(true);
769 }
770
771 if ($item->getType() != "section_header")
772 {
773 $cfg["id"] = $item->getFieldId();
774
775 // info text
776 if ($item->getInfo() != "")
777 {
778 $this->tpl->setCurrentBlock("description");
779 $this->tpl->setVariable("PROPERTY_DESCRIPTION",
780 $item->getInfo());
781 $this->tpl->parseCurrentBlock();
782 }
783
784 if ($this->getMode() == "subform")
785 {
786 // required
787 if (!$this->hideRequired($item->getType()))
788 {
789 if ($item->getRequired())
790 {
791 $this->tpl->touchBlock("sub_required");
792 $this->required_text = true;
793 }
794 }
795
796 // hidden title (for accessibility, e.g. file upload)
797 if ($item->getHiddenTitle() != "")
798 {
799 $this->tpl->setCurrentBlock("sub_hid_title");
800 $this->tpl->setVariable("SPHID_TITLE",
801 $item->getHiddenTitle());
802 $this->tpl->parseCurrentBlock();
803 }
804
805 $this->tpl->setCurrentBlock("sub_prop_start");
806 $this->tpl->setVariable("PROPERTY_TITLE", $item->getTitle());
807 $this->tpl->setVariable("PROPERTY_CLASS", "il_".$item->getType());
808 if ($item->getType() != "non_editable_value")
809 {
810 $this->tpl->setVariable("LAB_ID", $item->getFieldId());
811 }
812 $this->tpl->parseCurrentBlock();
813 }
814 else
815 {
816 // required
817 if (!$this->hideRequired($item->getType()))
818 {
819 if ($item->getRequired())
820 {
821 $this->tpl->touchBlock("required");
822 $this->required_text = true;
823 }
824 }
825
826 // hidden title (for accessibility, e.g. file upload)
827 if ($item->getHiddenTitle() != "")
828 {
829 $this->tpl->setCurrentBlock("std_hid_title");
830 $this->tpl->setVariable("PHID_TITLE",
831 $item->getHiddenTitle());
832 $this->tpl->parseCurrentBlock();
833 }
834
835 $this->tpl->setCurrentBlock("std_prop_start");
836 $this->tpl->setVariable("PROPERTY_TITLE", $item->getTitle());
837 if ($item->getType() != "non_editable_value")
838 {
839 $this->tpl->setVariable("LAB_ID", $item->getFieldId());
840 }
841 if ($this->getHideLabels())
842 {
843 $this->tpl->setVariable("HIDE_LABELS_STYLE", " ilFormOptionHidden");
844 }
845 $this->tpl->parseCurrentBlock();
846 }
847
848 // alert
849 if ($item->getType() != "non_editable_value" && $item->getAlert() != "")
850 {
851 $this->tpl->setCurrentBlock("alert");
852 $this->tpl->setVariable("IMG_ALERT",
853 ilUtil::getImagePath("icon_alert.svg"));
854 $this->tpl->setVariable("ALT_ALERT",
855 $lng->txt("alert"));
856 $this->tpl->setVariable("TXT_ALERT",
857 $item->getAlert());
858 $this->tpl->parseCurrentBlock();
859 }
860
861 // subitems
862 $sf = null;
863 if ($item->getType() != "non_editable_value" or 1)
864 {
865 $sf = $item->getSubForm();
866 if ($item->hideSubForm() && is_object($sf))
867 {
868 $this->tpl->setCurrentBlock("sub_form_hide");
869 $this->tpl->setVariable("DSFID", $item->getFieldId());
870 $this->tpl->parseCurrentBlock();
871 }
872 }
873
874
875 $sf_content = "";
876 if (is_object($sf))
877 {
878 $sf_content = $sf->getContent();
879 if ($sf->getMultipart())
880 {
881 $this->setMultipart(true);
882 }
883 $this->tpl->setCurrentBlock("sub_form");
884 $this->tpl->setVariable("PROP_SUB_FORM", $sf_content);
885 $this->tpl->setVariable("SFID", $item->getFieldId());
886 $this->tpl->parseCurrentBlock();
887 }
888
889 $this->tpl->setCurrentBlock("prop");
890 /* not used yet
891 $this->tpl->setVariable("ID", $item->getFieldId());
892 $this->tpl->setVariable("CFG", ilJsonUtil::encode($cfg));*/
893 $this->tpl->parseCurrentBlock();
894 }
895
896
897 $this->tpl->touchBlock("item");
898 }
setMultipart($a_multipart)
Set Enctype Multipart/Formdata true/false.
getHideLabels()
Get a value indicating whether the labels should be hidden or not.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
Interface for multi values support.

References $lng, $tpl, addItem(), getHideLabels(), ilUtil\getImagePath(), getMode(), hideRequired(), and ilFormGUI\setMultipart().

Referenced by getContent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ moveFileUpload()

ilPropertyFormGUI::moveFileUpload (   $a_target_directory,
  $a_field,
  $a_target_name = null,
  $a_index = null,
  $a_sub_index = null 
)

Move upload to target directory.

Parameters
string$a_target_directorytarget directory (without filename!)
string$a_fieldform field
string$a_target_nametarget file name (if different from uploaded file)
mixed$a_indexform field index (if array)
mixed$a_sub_indexform field subindex (if array)
Returns
string target file name incl. path

Definition at line 1048 of file class.ilPropertyFormGUI.php.

1049 {
1050 if(!is_dir($a_target_directory))
1051 {
1052 return;
1053 }
1054
1055 $data = $this->getFileUpload($a_field, $a_index, $a_sub_index);
1056 if($data["tmp_name"] && file_exists($data["tmp_name"]))
1057 {
1058 if($a_target_name)
1059 {
1060 $data["name"] = $a_target_name;
1061 }
1062
1063 $target_file = $a_target_directory."/".$data["name"];
1064 $target_file = str_replace("//", "/", $target_file);
1065
1066 if($data["is_upload"])
1067 {
1068 if (!ilUtil::moveUploadedFile($data["tmp_name"], $data["name"], $target_file))
1069 {
1070 return;
1071 }
1072 }
1073 else
1074 {
1075 if (!rename($data["tmp_name"], $target_file))
1076 {
1077 return;
1078 }
1079 }
1080
1081 return $target_file;
1082 }
1083 }
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file

References $data, getFileUpload(), and ilUtil\moveUploadedFile().

+ Here is the call graph for this function:

◆ rebuildUploadedFiles()

ilPropertyFormGUI::rebuildUploadedFiles ( )
protected

try to rebuild files

Definition at line 1088 of file class.ilPropertyFormGUI.php.

1089 {
1090 if(isset($_POST["ilfilehash"]) && $_POST["ilfilehash"])
1091 {
1092 $temp_path = ilUtil::getDataDir() . "/temp";
1093 if(is_dir($temp_path))
1094 {
1095 $temp_files = glob($temp_path."/".session_id()."~~".$_POST["ilfilehash"]."~~*");
1096 if(is_array($temp_files))
1097 {
1098 foreach($temp_files as $full_file)
1099 {
1100 $file = explode("~~", basename($full_file));
1101 $field = $file[2];
1102 $idx = $file[3];
1103 $idx2 = $file[4];
1104 $type = $file[5]."/".$file[6];
1105 $name = $file[7];
1106
1107 if($idx2 != "")
1108 {
1109 if(!$_FILES[$field]["tmp_name"][$idx][$idx2])
1110 {
1111 $_FILES[$field]["tmp_name"][$idx][$idx2] = $full_file;
1112 $_FILES[$field]["name"][$idx][$idx2] = $name;
1113 $_FILES[$field]["type"][$idx][$idx2] = $type;
1114 $_FILES[$field]["error"][$idx][$idx2] = 0;
1115 $_FILES[$field]["size"][$idx][$idx2] = filesize($full_file);
1116 }
1117 }
1118 else if($idx != "")
1119 {
1120 if(!$_FILES[$field]["tmp_name"][$idx])
1121 {
1122 $_FILES[$field]["tmp_name"][$idx] = $full_file;
1123 $_FILES[$field]["name"][$idx] = $name;
1124 $_FILES[$field]["type"][$idx] = $type;
1125 $_FILES[$field]["error"][$idx] = 0;
1126 $_FILES[$field]["size"][$idx] = filesize($full_file);
1127 }
1128 }
1129 else
1130 {
1131 if(!$_FILES[$field]["tmp_name"])
1132 {
1133 $_FILES[$field]["tmp_name"] = $full_file;
1134 $_FILES[$field]["name"] = $name;
1135 $_FILES[$field]["type"] = $type;
1136 $_FILES[$field]["error"] = 0;
1137 $_FILES[$field]["size"] = filesize($full_file);
1138 }
1139 }
1140 }
1141 }
1142 }
1143 }
1144 }
static getDataDir()
get data directory (outside webspace)

References $_POST, $file, ilFormGUI\$name, and ilUtil\getDataDir().

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeItemByPostVar()

ilPropertyFormGUI::removeItemByPostVar (   $a_post_var)

Remove Item.

Parameters
string$a_postvarPost Var

Definition at line 259 of file class.ilPropertyFormGUI.php.

260 {
261 foreach ($this->items as $key => $item)
262 {
263 if (method_exists($item, "getPostVar") && $item->getPostVar() == $a_post_var)
264 {
265 unset($this->items[$key]);
266 }
267 }
268 }

Referenced by ilObjItemGroupGUI\initEditCustomForm(), and ilTestSettingsGUI\removeHiddenItems().

+ Here is the caller graph for this function:

◆ setDescription()

ilPropertyFormGUI::setDescription (   $a_val)

Set description.

Parameters
stringdescription

Definition at line 192 of file class.ilPropertyFormGUI.php.

193 {
194 $this->description = $a_val;
195 }

◆ setDisableStandardMessage()

ilPropertyFormGUI::setDisableStandardMessage (   $a_val)

Set disable standard message.

Parameters
booleandisable standard message

Definition at line 346 of file class.ilPropertyFormGUI.php.

347 {
348 $this->disable_standard_message = $a_val;
349 }

◆ setHideLabels()

ilPropertyFormGUI::setHideLabels (   $a_value = true)

Set a value indicating whether the labels should be hidden or not.

Parameters
boolean$a_valueIndicates whether the labels should be hidden.

Definition at line 376 of file class.ilPropertyFormGUI.php.

377 {
378 $this->hide_labels = $a_value;
379 }

◆ setItems()

ilPropertyFormGUI::setItems (   $a_items)

Set Items.

Parameters
array$a_itemsarray of item objects

Definition at line 298 of file class.ilPropertyFormGUI.php.

299 {
300 $this->items = $a_items;
301 }

Referenced by ilAssQuestionAuthoringFormGUI\replaceFormItemByPostVar().

+ Here is the caller graph for this function:

◆ setMode()

ilPropertyFormGUI::setMode (   $a_mode)

Set Mode ('std', 'subform').

Parameters
string$a_modeMode ('std', 'subform')

Definition at line 132 of file class.ilPropertyFormGUI.php.

133 {
134 $this->mode = $a_mode;
135 }

◆ setShowTopButtons()

ilPropertyFormGUI::setShowTopButtons (   $a_val)

Get show top buttons.

Definition at line 230 of file class.ilPropertyFormGUI.php.

231 {
232 $this->show_top_buttons = $a_val;
233 }

◆ setTableWidth()

ilPropertyFormGUI::setTableWidth (   $a_width)
final

Set table width.

@access public

Parameters
stringtable width

Definition at line 111 of file class.ilPropertyFormGUI.php.

112 {
113 $this->tbl_width = $a_width;
114 }

◆ setTitle()

◆ setTitleIcon()

ilPropertyFormGUI::setTitleIcon (   $a_titleicon)

Set TitleIcon.

Parameters
string$a_titleiconTitleIcon

Definition at line 172 of file class.ilPropertyFormGUI.php.

173 {
174 $this->titleicon = $a_titleicon;
175 }

◆ setTopAnchor()

ilPropertyFormGUI::setTopAnchor (   $a_val)

Set top anchor.

Parameters
stringtop anchor

Definition at line 212 of file class.ilPropertyFormGUI.php.

213 {
214 $this->top_anchor = $a_val;
215 }

◆ setValuesByArray()

ilPropertyFormGUI::setValuesByArray (   $a_values,
  $a_restrict_to_value_keys = false 
)

Set form values from an array.

Parameters
array$a_valuesValue array (key is post variable name, value is value)

Definition at line 386 of file class.ilPropertyFormGUI.php.

387 {
388 foreach($this->items as $item)
389 {
390 if(!($a_restrict_to_value_keys) ||
391 in_array($item->getPostVar(), array_keys($a_values)))
392 {
393 $item->setValueByArray($a_values);
394 }
395 }
396 }

Referenced by ilObjBibliographicAdminLibrariesFormGUI\fillForm(), arConfigFormGUI\fillForm(), ilMemcacheServerFormGUI\fillForm(), ilIndividualAssessmentMemberGUI\fillForm(), ilIndividualAssessmentSettingsGUI\fillForm(), ilIndividualAssessmentSettingsGUI\fillInfoForm(), ilExAssignmentEditorGUI\getAssignmentValues(), ilSystemStyleIconsGUI\getByColorValues(), ilSystemStyleIconsGUI\getByIconValues(), ilSystemStyleLessGUI\getVariablesValues(), ilMarkSchemaGUI\populateEctsForm(), ilObjWikiSettingsGUI\populateWithCurrentSettings(), and ilPersonalChatSettingsFormGUI\showChatOptions().

+ Here is the caller graph for this function:

◆ setValuesByPost()

ilPropertyFormGUI::setValuesByPost ( )

Set form values from POST values.

Definition at line 402 of file class.ilPropertyFormGUI.php.

403 {
404 foreach ($this->items as $item)
405 {
406 $item->setValueByArray($_POST);
407 }
408 }

References $_POST.

Referenced by ilObjOrgUnitSettingsFormGUI\fillObject(), ilOrgUnitTypeAdvancedMetaDataFormGUI\fillObject(), ilOrgUnitTypeFormGUI\fillObject(), ilStudyProgrammeTypeAdvancedMetaDataFormGUI\fillObject(), and ilStudyProgrammeTypeFormGUI\fillObject().

+ Here is the caller graph for this function:

Field Documentation

◆ $buttons

ilPropertyFormGUI::$buttons = array()
private

Definition at line 49 of file class.ilPropertyFormGUI.php.

Referenced by getCommandButtons().

◆ $check_input_called

ilPropertyFormGUI::$check_input_called = false
protected

Definition at line 52 of file class.ilPropertyFormGUI.php.

◆ $description

ilPropertyFormGUI::$description = ""
protected

◆ $disable_standard_message

ilPropertyFormGUI::$disable_standard_message = false
protected

Definition at line 53 of file class.ilPropertyFormGUI.php.

Referenced by getDisableStandardMessage().

◆ $hide_labels

ilPropertyFormGUI::$hide_labels = false
protected

Definition at line 59 of file class.ilPropertyFormGUI.php.

Referenced by getHideLabels().

◆ $items

ilPropertyFormGUI::$items = array()
private

Definition at line 50 of file class.ilPropertyFormGUI.php.

Referenced by getItems().

◆ $mode

ilPropertyFormGUI::$mode = "std"
protected

Definition at line 51 of file class.ilPropertyFormGUI.php.

Referenced by getMode().

◆ $show_top_buttons

ilPropertyFormGUI::$show_top_buttons = true
protected

Definition at line 58 of file class.ilPropertyFormGUI.php.

Referenced by getShowTopButtons().

◆ $tbl_width

ilPropertyFormGUI::$tbl_width = false
protected

Definition at line 57 of file class.ilPropertyFormGUI.php.

Referenced by getTableWidth().

◆ $titleicon

ilPropertyFormGUI::$titleicon = false
protected

Definition at line 55 of file class.ilPropertyFormGUI.php.

Referenced by getTitleIcon().

◆ $top_anchor

ilPropertyFormGUI::$top_anchor = "il_form_top"
protected

Definition at line 54 of file class.ilPropertyFormGUI.php.

Referenced by getTopAnchor().


The documentation for this class was generated from the following file: