ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilPropertyFormGUI Class Reference

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

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

Public Member Functions

 ilPropertyFormGUI ()
 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)
 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
 ilFormGUI ()
 Constructor. More...
 
 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)
 
 keepFileUpload ($a_hash, $a_field, $a_tmp_name, $a_name, $a_type, $a_index=null, $a_sub_index=null)
 Import upload into temp directory. More...
 
 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
 
 $reloaded_files
 
 $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.

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 524 of file class.ilPropertyFormGUI.php.

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

◆ addItem()

ilPropertyFormGUI::addItem (   $a_item)

Add Item (Property, SectionHeader).

Parameters
object$a_propertyItem object

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

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

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(), ilMailCronNotification\addCustomSettingsToForm(), ilMailCronOrphanedMails\addCustomSettingsToForm(), ilPaymentCronNotification\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(), ilExcCriteriaText\initCustomForm(), ilObjPortfolioTemplateGUI\initDidacticTemplate(), ilObjectGUI\initDidacticTemplate(), ilObjBibliographicGUI\initEditCustomForm(), ilObjBlogGUI\initEditCustomForm(), ilObjBookingPoolGUI\initEditCustomForm(), ilObjDataCollectionGUI\initEditCustomForm(), ilObjExerciseGUI\initEditCustomForm(), ilObjMediaPoolGUI\initEditCustomForm(), ilObjPollGUI\initEditCustomForm(), ilObjPortfolioBaseGUI\initEditCustomForm(), ilObjPortfolioTemplateGUI\initEditCustomForm(), ilObjBibliographicAdminLibrariesFormGUI\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 418 of file class.ilPropertyFormGUI.php.

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

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

Referenced by ilObjOrgUnitSettingsFormGUI\fillObject(), ilOrgUnitTypeAdvancedMetaDataFormGUI\fillObject(), ilOrgUnitTypeFormGUI\fillObject(), ilStudyProgrammeTypeAdvancedMetaDataFormGUI\fillObject(), ilStudyProgrammeTypeFormGUI\fillObject(), arConfigFormGUI\fillObject(), ilMemcacheServerFormGUI\fillObject(), ilExAssignmentEditorGUI\processForm(), ilExAssignmentEditorGUI\processPeerReviewForm(), 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 557 of file class.ilPropertyFormGUI.php.

558 {
559 $this->buttons = array();
560 }

◆ executeCommand()

& ilPropertyFormGUI::executeCommand ( )

Execute command.

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

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

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

+ Here is the call graph for this function:

◆ getCommandButtons()

ilPropertyFormGUI::getCommandButtons ( )

Return all Command buttons.

Returns
array

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

550 {
551 return $this->buttons;
552 }

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 565 of file class.ilPropertyFormGUI.php.

566 {
567 global $lng, $tpl, $ilUser, $ilSetting;
568
569 include_once("./Services/YUI/classes/class.ilYuiUtil.php");
573
574 $tpl->addJavaScript("./Services/JavaScript/js/Basic.js");
575 $tpl->addJavaScript("Services/Form/js/Form.js");
576
577 $this->tpl = new ilTemplate("tpl.property_form.html", true, true, "Services/Form");
578
579 // check if form has not title and first item is a section header
580 // -> use section header for title and remove section header
581 // -> command buttons are presented on top
582 $fi = $this->items[0];
583 if ($this->getMode() == "std" &&
584 $this->getTitle() == "" &&
585 is_object($fi) && $fi->getType() == "section_header"
586 )
587 {
588 $this->setTitle($fi->getTitle());
589 unset($this->items[0]);
590 }
591
592
593 // title icon
594 if ($this->getTitleIcon() != "" && @is_file($this->getTitleIcon()))
595 {
596 $this->tpl->setCurrentBlock("title_icon");
597 $this->tpl->setVariable("IMG_ICON", $this->getTitleIcon());
598 $this->tpl->parseCurrentBlock();
599 }
600
601 // title
602 if ($this->getTitle() != "")
603 {
604 // commands on top
605 if (count($this->buttons) > 0 && $this->getShowTopButtons() && count($this->items) > 2)
606 {
607 // command buttons
608 foreach($this->buttons as $button)
609 {
610 $this->tpl->setCurrentBlock("cmd2");
611 $this->tpl->setVariable("CMD", $button["cmd"]);
612 $this->tpl->setVariable("CMD_TXT", $button["text"]);
613 $this->tpl->parseCurrentBlock();
614 }
615 $this->tpl->setCurrentBlock("commands2");
616 $this->tpl->parseCurrentBlock();
617 }
618
619 if (is_object($ilSetting))
620 {
621 if ($ilSetting->get('char_selector_availability') > 0)
622 {
623 require_once 'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
625 {
626 $char_selector = ilCharSelectorGUI::_getCurrentGUI();
627 if ($char_selector->getConfig()->getAvailability() == ilCharSelectorConfig::ENABLED)
628 {
629 $char_selector->addToPage();
630 $this->tpl->TouchBlock('char_selector');
631 }
632 }
633 }
634 }
635
636 $this->tpl->setCurrentBlock("header");
637 $this->tpl->setVariable("TXT_TITLE", $this->getTitle());
638 $this->tpl->setVariable("LABEL", $this->getTopAnchor());
639 $this->tpl->setVariable("TXT_DESCRIPTION", $this->getDescription());
640 $this->tpl->parseCurrentBlock();
641 }
642 $this->tpl->touchBlock("item");
643
644 // properties
645 $this->required_text = false;
646 foreach($this->items as $item)
647 {
648 if ($item->getType() != "hidden")
649 {
650 $this->insertItem($item);
651 }
652 }
653
654 // required
655 if ($this->required_text && $this->getMode() == "std")
656 {
657 $this->tpl->setCurrentBlock("required_text");
658 $this->tpl->setVariable("TXT_REQUIRED", $lng->txt("required_field"));
659 $this->tpl->parseCurrentBlock();
660 }
661
662 // command buttons
663 foreach($this->buttons as $button)
664 {
665 $this->tpl->setCurrentBlock("cmd");
666 $this->tpl->setVariable("CMD", $button["cmd"]);
667 $this->tpl->setVariable("CMD_TXT", $button["text"]);
668 $this->tpl->parseCurrentBlock();
669 }
670
671 // #18808
672 if ($this->getMode() != "subform")
673 {
674 // try to keep uploads even if checking input fails
675 if($this->getMultipart())
676 {
677 $hash = $_POST["ilfilehash"];
678 if(!$hash)
679 {
680 $hash = md5(uniqid(mt_rand(), true));
681 }
682 $fhash = new ilHiddenInputGUI("ilfilehash");
683 $fhash->setValue($hash);
684 $this->addItem($fhash);
685 }
686 }
687
688 // hidden properties
689 $hidden_fields = false;
690 foreach($this->items as $item)
691 {
692 if ($item->getType() == "hidden")
693 {
694 $item->insert($this->tpl);
695 $hidden_fields = true;
696 }
697 }
698
699 if ($this->required_text || count($this->buttons) > 0 || $hidden_fields)
700 {
701 $this->tpl->setCurrentBlock("commands");
702 $this->tpl->parseCurrentBlock();
703 }
704
705
706 if ($this->getMode() == "subform")
707 {
708 $this->tpl->touchBlock("sub_table");
709 }
710 else
711 {
712 $this->tpl->touchBlock("std_table");
713 $this->tpl->setVariable('STD_TABLE_WIDTH',$this->getTableWidth());
714 }
715
716 return $this->tpl->get();
717 }
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:40
global $ilUser
Definition: imgupload.php:15

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 204 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 358 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 974 of file class.ilPropertyFormGUI.php.

975 {
976 $res = array();
977 if($a_index)
978 {
979 if($_FILES[$a_field]["tmp_name"][$a_index][$a_sub_index])
980 {
981 $res = array(
982 "tmp_name" => $_FILES[$a_field]["tmp_name"][$a_index][$a_sub_index],
983 "name" => $_FILES[$a_field]["name"][$a_index][$a_sub_index],
984 "type" => $_FILES[$a_field]["type"][$a_index][$a_sub_index],
985 "error" => $_FILES[$a_field]["error"][$a_index][$a_sub_index],
986 "size" => $_FILES[$a_field]["size"][$a_index][$a_sub_index],
987 "is_upload" => true
988 );
989 }
990 else if($this->reloaded_files[$a_field]["tmp_name"][$a_index][$a_sub_index])
991 {
992 $res = array(
993 "tmp_name" => $this->reloaded_files["tmp_name"][$a_index][$a_sub_index],
994 "name" => $this->reloaded_files["name"][$a_index][$a_sub_index],
995 "type" => $this->reloaded_files["type"][$a_index][$a_sub_index],
996 "error" => $this->reloaded_files["error"][$a_index][$a_sub_index],
997 "size" => $this->reloaded_files["size"][$a_index][$a_sub_index],
998 "is_upload" => false
999 );
1000 }
1001 }
1002 else if($a_sub_index)
1003 {
1004 if($_FILES[$a_field]["tmp_name"][$a_index])
1005 {
1006 $res = array(
1007 "tmp_name" => $_FILES[$a_field]["tmp_name"][$a_index],
1008 "name" => $_FILES[$a_field]["name"][$a_index],
1009 "type" => $_FILES[$a_field]["type"][$a_index],
1010 "error" => $_FILES[$a_field]["error"][$a_index],
1011 "size" => $_FILES[$a_field]["size"][$a_index],
1012 "is_upload" => true
1013 );
1014 }
1015 else if($this->reloaded_files[$a_field]["tmp_name"][$a_index])
1016 {
1017 $res = array(
1018 "tmp_name" => $this->reloaded_files[$a_field]["tmp_name"][$a_index],
1019 "name" => $this->reloaded_files[$a_field]["name"][$a_index],
1020 "type" => $this->reloaded_files[$a_field]["type"][$a_index],
1021 "error" => $this->reloaded_files[$a_field]["error"][$a_index],
1022 "size" => $this->reloaded_files[$a_field]["size"][$a_index],
1023 "is_upload" => false
1024 );
1025 }
1026 }
1027 else
1028 {
1029 if($_FILES[$a_field]["tmp_name"])
1030 {
1031 $res = array(
1032 "tmp_name" => $_FILES[$a_field]["tmp_name"],
1033 "name" => $_FILES[$a_field]["name"],
1034 "type" => $_FILES[$a_field]["type"],
1035 "error" => $_FILES[$a_field]["error"],
1036 "size" => $_FILES[$a_field]["size"],
1037 "is_upload" => true
1038 );
1039 }
1040 else if($this->reloaded_files[$a_field]["tmp_name"])
1041 {
1042 $res = array(
1043 "tmp_name" => $this->reloaded_files[$a_field]["tmp_name"],
1044 "name" => $this->reloaded_files[$a_field]["name"],
1045 "type" => $this->reloaded_files[$a_field]["type"],
1046 "error" => $this->reloaded_files[$a_field]["error"],
1047 "size" => $this->reloaded_files[$a_field]["size"],
1048 "is_upload" => false
1049 );
1050 }
1051 }
1052 return $res;
1053 }

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 368 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 893 of file class.ilPropertyFormGUI.php.

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

References $html.

Referenced by arGUI\save().

+ 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 504 of file class.ilPropertyFormGUI.php.

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

References $_POST.

Referenced by ilAdvancedMDFieldDefinitionSelect\buildConfirmedObjects(), ilObjOrgUnitSettingsFormGUI\fillObject(), ilOrgUnitTypeAdvancedMetaDataFormGUI\fillObject(), ilOrgUnitTypeFormGUI\fillObject(), ilStudyProgrammeTypeAdvancedMetaDataFormGUI\fillObject(), ilStudyProgrammeTypeFormGUI\fillObject(), ilMemcacheServerFormGUI\fillObject(), 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(), ilMemberAgreementGUI\saveCourseDefinedFields(), ilForumCronNotification\saveCustomSettings(), ilConsultationHourCron\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(), ilObjOrgUnitSettingsFormGUI\updateTranslation(), ilObjPollGUI\validateCustom(), and SurveyMultipleChoiceQuestionGUI\validateEditForm().

+ 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 321 of file class.ilPropertyFormGUI.php.

322 {
323 $inputItems = array();
324
325 foreach($this->items as $item)
326 {
327 if( $item->getType() == 'section_header' )
328 {
329 continue;
330 }
331
332 $inputItems[] = $item;
333
334 if( $item instanceof ilSubEnabledFormPropertyGUI )
335 {
336 $inputItems = array_merge( $inputItems, $item->getSubInputItemsRecursive() );
337 }
338 }
339
340 return $inputItems;
341 }
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 277 of file class.ilPropertyFormGUI.php.

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

References $ret.

Referenced by ilCronDeleteInactiveUserAccounts\addCustomSettingsToForm(), ilTestRandomQuestionSetPoolDefinitionFormGUI\applySubmit(), ilChatroomFormFactory\applyValues(), executeCommand(), ilExcCriteriaText\exportCustomForm(), ilExcCriteriaGUI\exportForm(), ilExcCriteriaCatalogueGUI\exportForm(), ilTestSettingsGUI\formPropertyExists(), ilObjQuestionPoolSettingsGeneralGUI\formPropertyExists(), ilExAssignmentEditorGUI\getAssignmentValues(), ilExAssignmentEditorGUI\handleDisabledFields(), ilExAssignmentEditorGUI\handleDisabledPeerFields(), ilObjTestSettingsScoringResultsGUI\hasScoringSettingsChanged(), ilAdvancedMDFieldDefinition\importDefinitionFormPostValues(), ilAssQuestionFeedback\initGenericFormProperties(), ilAssConfigurableMultiOptionQuestionFeedback\initSpecificFormProperties(), ilAssMultiOptionQuestionFeedback\initSpecificFormProperties(), ilObjTestSettingsGeneralGUI\isSkillServiceSettingToBeAdjusted(), assMatchingQuestionGUI\isValidTermAndDefinitionAmount(), ilObjGroupGUI\load(), ilObjTestDynamicQuestionSetConfigGUI\performSaveForm(), ilObjTestSettingsGeneralGUI\performSaveForm(), ilObjQuestionPoolSettingsGeneralGUI\performSaveForm(), ilAdvancedMDFieldDefinitionSelect\prepareCustomDefinitionFormConfirmation(), ilAdvancedMDFieldDefinition\prepareDefinitionFormConfirmation(), ilExAssignmentEditorGUI\processForm(), ilExAssignmentEditorGUI\processPeerReviewForm(), 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(), ilMemberAgreementGUI\setCourseDefinedFieldValues(), ilBookingScheduleGUI\setDefinitionFromPost(), ilExAssignmentEditorGUI\setDisabledFieldValues(), ilExAssignmentEditorGUI\setDisabledPeerReviewFieldValues(), ilCharSelectorGUI\setFormValues(), ilSessionMembershipRegistrationSettingsGUI\setFormValues(), ilObjBlogGUI\updateCustom(), ilObjPollGUI\updateCustom(), ilObjPortfolioBaseGUI\updateCustom(), ilObjPortfolioTemplateGUI\updateCustom(), ilObjPollGUI\validateCustom(), SurveyMultipleChoiceQuestionGUI\validateEditForm(), assKprimChoiceGUI\writeAnswerSpecificPostData(), and assKprimChoiceGUI\writeQuestionSpecificPostData().

+ Here is the caller graph for this function:

◆ getItems()

ilPropertyFormGUI::getItems ( )

Get Items.

Returns
array array of item objects

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

311 {
312 return $this->items;
313 }

References $items.

Referenced by ilAsyncPropertyFormGUI\cloneForm(), ilUserFormSettings\exportToForm(), arConfigFormGUI\fillForm(), ilAsyncPropertyFormGUI\getErrors(), ilUserFormSettings\importFromForm(), and arConfigFormGUI\saveObject().

+ Here is the caller graph for this function:

◆ getMode()

ilPropertyFormGUI::getMode ( )

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

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

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

145 {
146 return $this->mode;
147 }

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 240 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 124 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 164 of file class.ilPropertyFormGUI.php.

165 {
166 return $this->title;
167 }

Referenced by getContent().

+ Here is the caller graph for this function:

◆ getTitleIcon()

ilPropertyFormGUI::getTitleIcon ( )

Get TitleIcon.

Returns
string TitleIcon

Definition at line 184 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 224 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 1063 of file class.ilPropertyFormGUI.php.

1064 {
1065 $data = $this->getFileUpload($a_field, $a_index, $a_sub_index);
1066 return (bool)$data["tmp_name"];
1067 }
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 719 of file class.ilPropertyFormGUI.php.

720 {
721 // #15818
722 return in_array($a_type, array("non_editable_value"));
723 }

Referenced by insertItem().

+ Here is the caller graph for this function:

◆ ilPropertyFormGUI()

ilPropertyFormGUI::ilPropertyFormGUI ( )

Constructor.

Parameters

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

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

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

Referenced by ilSCORM2004TrackingItemsPerScoFilterGUI\parse(), ilSCORMTrackingItemsPerScoFilterGUI\parse(), ilSCORM2004TrackingItemsPerUserFilterGUI\parse(), and ilSCORMTrackingItemsPerUserFilterGUI\parse().

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

◆ insertItem()

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

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

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

◆ keepFileUpload()

ilPropertyFormGUI::keepFileUpload (   $a_hash,
  $a_field,
  $a_tmp_name,
  $a_name,
  $a_type,
  $a_index = null,
  $a_sub_index = null 
)
protected

Import upload into temp directory.

Parameters
string$a_hashunique form hash
string$a_fieldform field
string$a_tmp_nametemp file name
string$a_nameoriginal file name
string$a_typefile mime type
mixed$a_indexform field index (if array)
mixed$a_sub_indexform field subindex (if array)
Returns
bool

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

932 {
933 global $ilUser;
934
935 if (trim($a_tmp_name) == "")
936 {
937 return;
938 }
939
940 $user_id = $ilUser->getId();
941 if(!$user_id || $user_id == ANONYMOUS_USER_ID)
942 {
943 return;
944 }
945
946 $a_name = ilUtil::getAsciiFileName($a_name);
947
948 $tmp_file_name = implode("~~", array($user_id,
949 $a_hash,
950 $a_field,
951 $a_index,
952 $a_sub_index,
953 str_replace("/", "~~", $a_type),
954 str_replace("~~", "_", $a_name)));
955
956 // make sure temp directory exists
957 $temp_path = ilUtil::getDataDir() . "/temp";
958 if (!is_dir($temp_path))
959 {
960 ilUtil::createDirectory($temp_path);
961 }
962
963 ilUtil::moveUploadedFile($a_tmp_name, $tmp_file_name, $temp_path."/".$tmp_file_name);
964 }
static getDataDir()
get data directory (outside webspace)
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
static createDirectory($a_dir, $a_mod=0755)
create directory

References $ilUser, ilUtil\createDirectory(), ilUtil\getDataDir(), and ilUtil\moveUploadedFile().

Referenced by checkInput().

+ 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 1079 of file class.ilPropertyFormGUI.php.

1080 {
1081 if(!is_dir($a_target_directory))
1082 {
1083 return;
1084 }
1085
1086 $data = $this->getFileUpload($a_field, $a_index, $a_sub_index);
1087 if($data["tmp_name"] && file_exists($data["tmp_name"]))
1088 {
1089 if($a_target_name)
1090 {
1091 $data["name"] = $a_target_name;
1092 }
1093
1094 $target_file = $a_target_directory."/".$data["name"];
1095 $target_file = str_replace("//", "/", $target_file);
1096
1097 if($data["is_upload"])
1098 {
1099 if (!ilUtil::moveUploadedFile($data["tmp_name"], $data["name"], $target_file))
1100 {
1101 return;
1102 }
1103 }
1104 else
1105 {
1106 if (!rename($data["tmp_name"], $target_file))
1107 {
1108 return;
1109 }
1110 }
1111
1112 return $target_file;
1113 }
1114 }

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 1119 of file class.ilPropertyFormGUI.php.

1120 {
1121 global $ilUser;
1122
1123 if($_POST["ilfilehash"])
1124 {
1125 $user_id = $ilUser->getId();
1126 $temp_path = ilUtil::getDataDir() . "/temp";
1127 if(is_dir($temp_path) && $user_id && $user_id != ANONYMOUS_USER_ID)
1128 {
1129 $reload = array();
1130
1131 $temp_files = glob($temp_path."/".$ilUser->getId()."~~".$_POST["ilfilehash"]."~~*");
1132 if(is_array($temp_files))
1133 {
1134 foreach($temp_files as $full_file)
1135 {
1136 $file = explode("~~", basename($full_file));
1137 $field = $file[2];
1138 $idx = $file[3];
1139 $idx2 = $file[4];
1140 $type = $file[5]."/".$file[6];
1141 $name = $file[7];
1142
1143 if($idx2 != "")
1144 {
1145 if(!$_FILES[$field]["tmp_name"][$idx][$idx2])
1146 {
1147 $reload[$field]["tmp_name"][$idx][$idx2] = $full_file;
1148 $reload[$field]["name"][$idx][$idx2] = $name;
1149 $reload[$field]["type"][$idx][$idx2] = $type;
1150 $reload[$field]["error"][$idx][$idx2] = 0;
1151 $reload[$field]["size"][$idx][$idx2] = filesize($full_file);
1152 }
1153 }
1154 else if($idx != "")
1155 {
1156 if(!$_FILES[$field]["tmp_name"][$idx])
1157 {
1158 $reload[$field]["tmp_name"][$idx] = $full_file;
1159 $reload[$field]["name"][$idx] = $name;
1160 $reload[$field]["type"][$idx] = $type;
1161 $reload[$field]["error"][$idx] = 0;
1162 $reload[$field]["size"][$idx] = filesize($full_file);
1163 }
1164 }
1165 else
1166 {
1167 if(!$_FILES[$field]["tmp_name"])
1168 {
1169 $reload[$field]["tmp_name"] = $full_file;
1170 $reload[$field]["name"] = $name;
1171 $reload[$field]["type"] = $type;
1172 $reload[$field]["error"] = 0;
1173 $reload[$field]["size"] = filesize($full_file);
1174 }
1175 }
1176 }
1177 }
1178
1179 $this->reloaded_files = $reload;
1180 }
1181 }
1182 }

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

Referenced by ilPropertyFormGUI().

+ 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 261 of file class.ilPropertyFormGUI.php.

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

Referenced by ilTestSettingsGUI\removeHiddenItems().

+ Here is the caller graph for this function:

◆ setDescription()

ilPropertyFormGUI::setDescription (   $a_val)

Set description.

Parameters
stringdescription

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

195 {
196 $this->description = $a_val;
197 }

◆ setDisableStandardMessage()

ilPropertyFormGUI::setDisableStandardMessage (   $a_val)

Set disable standard message.

Parameters
booleandisable standard message

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

349 {
350 $this->disable_standard_message = $a_val;
351 }

◆ 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 378 of file class.ilPropertyFormGUI.php.

379 {
380 $this->hide_labels = $a_value;
381 }

◆ setItems()

ilPropertyFormGUI::setItems (   $a_items)

Set Items.

Parameters
array$a_itemsarray of item objects

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

301 {
302 $this->items = $a_items;
303 }

◆ setMode()

ilPropertyFormGUI::setMode (   $a_mode)

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

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

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

135 {
136 $this->mode = $a_mode;
137 }

◆ setShowTopButtons()

ilPropertyFormGUI::setShowTopButtons (   $a_val)

Get show top buttons.

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

233 {
234 $this->show_top_buttons = $a_val;
235 }

◆ setTableWidth()

ilPropertyFormGUI::setTableWidth (   $a_width)
final

Set table width.

@access public

Parameters
stringtable width

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

114 {
115 $this->tbl_width = $a_width;
116 }

◆ setTitle()

◆ setTitleIcon()

ilPropertyFormGUI::setTitleIcon (   $a_titleicon)

Set TitleIcon.

Parameters
string$a_titleiconTitleIcon

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

175 {
176 $this->titleicon = $a_titleicon;
177 }

◆ setTopAnchor()

ilPropertyFormGUI::setTopAnchor (   $a_val)

Set top anchor.

Parameters
stringtop anchor

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

215 {
216 $this->top_anchor = $a_val;
217 }

◆ 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 388 of file class.ilPropertyFormGUI.php.

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

Referenced by ilObjBibliographicAdminLibrariesFormGUI\fillForm(), arConfigFormGUI\fillForm(), ilMemcacheServerFormGUI\fillForm(), ilExAssignmentEditorGUI\getAssignmentValues(), ilMarkSchemaGUI\populateEctsForm(), and ilObjWikiSettingsGUI\populateWithCurrentSettings().

+ Here is the caller graph for this function:

◆ setValuesByPost()

ilPropertyFormGUI::setValuesByPost ( )

Set form values from POST values.

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

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

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 60 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().

◆ $reloaded_files

ilPropertyFormGUI::$reloaded_files
protected

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

◆ $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: