ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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, $a_remove_unused_headers=false)
 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

 $lng
 
 $ctrl
 
 $tpl
 
 $user
 
 $settings
 
 $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 92 of file class.ilPropertyFormGUI.php.

93 {
94 global $DIC;
95
96 $this->lng = $DIC->language();
97 $this->ctrl = $DIC->ctrl();
98
99 $this->user = null;
100 if (isset($DIC["ilUser"])) {
101 $this->user = $DIC["ilUser"];
102 }
103
104 $this->settings = null;
105 if (isset($DIC["ilSetting"])) {
106 $this->settings = $DIC["ilSetting"];
107 }
108
109 $lng = $DIC->language();
110
111 $lng->loadLanguageModule("form");
112
113 // avoid double submission
114 $this->setPreventDoubleSubmission(true);
115
116 // do it as early as possible
117 $this->rebuildUploadedFiles();
118 }
user()
Definition: user.php:4
setPreventDoubleSubmission($a_val)
Set prevent double submission.
rebuildUploadedFiles()
try to rebuild files
global $DIC
Definition: saml.php:7
settings()
Definition: settings.php:2

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

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

576 {
577 $this->properties[] = array("type" => "custom",
578 "title" => $a_title,
579 "html" => $a_html,
580 "info" => $a_info);
581 }

◆ addItem()

ilPropertyFormGUI::addItem (   $a_item)

Add Item (Property, SectionHeader).

Parameters
object$a_propertyItem object

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

289 {
290 $a_item->setParentForm($this);
291 return $this->items[] = $a_item;
292 }

Referenced by FormMailCodesGUI\__construct(), ilObjRemoteCourseGUI\addCustomEditForm(), ilObjRemoteGlossaryGUI\addCustomEditForm(), ilObjRemoteGroupGUI\addCustomEditForm(), ilObjRemoteLearningModuleGUI\addCustomEditForm(), ilObjRemoteTestGUI\addCustomEditForm(), ilObjRemoteWikiGUI\addCustomEditForm(), ilAdvancedMDFieldDefinitionFloat\addCustomFieldToDefinitionForm(), ilAdvancedMDFieldDefinitionInteger\addCustomFieldToDefinitionForm(), ilAdvancedMDFieldDefinitionSelect\addCustomFieldToDefinitionForm(), ilAdvancedMDFieldDefinitionText\addCustomFieldToDefinitionForm(), ilForumCronNotification\addCustomSettingsToForm(), ilConsultationHourCron\addCustomSettingsToForm(), ilLoggerCronCleanErrorFiles\addCustomSettingsToForm(), ilMailCronNotification\addCustomSettingsToForm(), ilMailCronOrphanedMails\addCustomSettingsToForm(), ilCronDeleteInactivatedUserAccounts\addCustomSettingsToForm(), ilCronDeleteInactiveUserAccounts\addCustomSettingsToForm(), ilDAVCronDiskQuota\addCustomSettingsToForm(), SurveyMatrixQuestionGUI\addFieldsToEditForm(), SurveyMetricQuestionGUI\addFieldsToEditForm(), SurveyMultipleChoiceQuestionGUI\addFieldsToEditForm(), SurveySingleChoiceQuestionGUI\addFieldsToEditForm(), SurveyTextQuestionGUI\addFieldsToEditForm(), arEditGUI\addFormField(), ilCharSelectorGUI\addFormProperties(), ilPersonalProfileGUI\addLocationToForm(), ilECSObjectSettings\addSettingsToForm(), ilSkillTreeNodeGUI\addStatusInput(), ilAdvancedMDFieldDefinition\addToFieldDefinitionForm(), ilTaxMDGUI\addToMDForm(), ilOrgUnitTypeFormGUI\addTranslationInputs(), ilStudyProgrammeTypeFormGUI\addTranslationInputs(), ilTestRandomQuestionSetGeneralConfigFormGUI\build(), ilAssQuestionSkillAssignmentPropertyFormGUI\build(), ilTestRandomQuestionSetPoolDefinitionFormGUI\build(), ilAsyncPropertyFormGUI\cloneForm(), getContent(), ilExAssignmentEditorGUI\handleDisabledPeerFields(), ilMailOptionsFormGUI\init(), ilCourseLPBadgeGUI\initConfigForm(), ilUserProfileBadgeGUI\initConfigForm(), ilObjPortfolioGUI\initCopyPageFormOptions(), ilObjPortfolioTemplateGUI\initCopyPageFormOptions(), ilExcCriteriaText\initCustomForm(), ilObjPortfolioTemplateGUI\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(), ilOrgUnitTypeCustomIconsFormGUI\initForm(), ilOrgUnitTypeFormGUI\initForm(), ilStudyProgrammeTypeCustomIconsFormGUI\initForm(), ilStudyProgrammeTypeFormGUI\initForm(), arConfigFormGUI\initForm(), ilMemcacheServerFormGUI\initForm(), ilOrgUnitAuthorityFormGUI\initFormElements(), ilOrgUnitPositionFormGUI\initFormElements(), ilOrgUnitDefaultPermissionFormGUI\initFormElements(), insertItem(), ilAdministrationSettingsFormHandler\parseFieldDefinition(), ilAssQuestionSkillAssignmentPropertyFormGUI\populateFullProperties(), ilAssQuestionSkillAssignmentPropertyFormGUI\populateLimitedProperties(), 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 465 of file class.ilPropertyFormGUI.php.

466 {
467 global $DIC;
468
469 if ($this->check_input_called) {
470 die("Error: ilPropertyFormGUI->checkInput() called twice.");
471 }
472
473 $ok = true;
474 foreach ($this->items as $item) {
475 $item_ok = $item->checkInput();
476 if (!$item_ok) {
477 $ok = false;
478 }
479 }
480
481 // check if POST is missint completely (if post_max_size exceeded)
482 if (count($this->items) > 0 && !is_array($_POST)) {
483 $ok = false;
484 }
485
486 $this->check_input_called = true;
487
488
489
490 // try to keep uploads for another try
491 if (!$ok && $_POST["ilfilehash"] && sizeof($_FILES)) {
492 $hash = $_POST["ilfilehash"];
493
494 foreach ($_FILES as $field => $data) {
495 // we support up to 2 nesting levels (see test/assesment)
496 if (is_array($data["tmp_name"])) {
497 foreach ($data["tmp_name"] as $idx => $upload) {
498 if (is_array($upload)) {
499 foreach ($upload as $idx2 => $file) {
500 if ($file && is_uploaded_file($file)) {
501 $file_name = $data["name"][$idx][$idx2];
502 $file_type = $data["type"][$idx][$idx2];
503 $this->keepFileUpload($hash, $field, $file, $file_name, $file_type, $idx, $idx2);
504 }
505 }
506 } elseif ($upload && is_uploaded_file($upload)) {
507 $file_name = $data["name"][$idx];
508 $file_type = $data["type"][$idx];
509 $this->keepFileUpload($hash, $field, $upload, $file_name, $file_type, $idx);
510 }
511 }
512 } else {
513 $this->keepFileUpload($hash, $field, $data["tmp_name"], $data["name"], $data["type"]);
514 }
515 }
516 }
517 $http = $DIC->http();
518 $txt = $DIC->language()->txt("form_input_not_valid");
519 switch ($http->request()->getHeaderLine('Accept')) {
520 // When JS asks for a valid JSON-Response, we send the success and message as JSON
521 case 'application/json':
523 'success' => $ok,
524 'message' => $txt,
525 ]));
526 $http->saveResponse($http->response()->withBody($stream));
527
528 return $ok;
529
530 // Otherwise we send it using ilUtil and it will be rendered in the Template
531 default:
532
533 if (!$ok && !$this->getDisableStandardMessage()) {
535 }
536
537 return $ok;
538 }
539 }
$_POST["username"]
static ofString($string)
Creates a new stream with an initial value.
Definition: Streams.php:29
getDisableStandardMessage()
Get disable standard message.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$txt
Definition: error.php:11
$stream
PHP stream implementation.
$http
Definition: raiseError.php:7
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file

References $_POST, $data, $DIC, $file, $http, $ok, GuzzleHttp\Psr7\$stream, $txt, getDisableStandardMessage(), ILIAS\Filesystem\Stream\Streams\ofString(), and ilUtil\sendFailure().

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

609 {
610 $this->buttons = array();
611 }

Referenced by ilAssOrderingQuestionAuthoringFormGUI\renewOrderingCommandButtons().

+ Here is the caller graph for this function:

◆ executeCommand()

ilPropertyFormGUI::executeCommand ( )

Execute command.

Reimplemented in ilPersonalChatSettingsFormGUI.

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

124 {
126
127 $next_class = $ilCtrl->getNextClass($this);
128 $cmd = $ilCtrl->getCmd();
129
130 switch ($next_class) {
131 case 'ilformpropertydispatchgui':
132 $ilCtrl->saveParameter($this, 'postvar');
133 include_once './Services/Form/classes/class.ilFormPropertyDispatchGUI.php';
134 $form_prop_dispatch = new ilFormPropertyDispatchGUI();
135 $item = $this->getItemByPostVar($_REQUEST["postvar"]);
136 $form_prop_dispatch->setItem($item);
137 return $ilCtrl->forwardCommand($form_prop_dispatch);
138 break;
139
140 }
141 return false;
142 }
getItemByPostVar($a_post_var)
Get Item by POST variable.
global $ilCtrl
Definition: ilias.php:18

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

+ Here is the call graph for this function:

◆ getCommandButtons()

ilPropertyFormGUI::getCommandButtons ( )

Return all Command buttons.

Returns
array

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

601 {
602 return $this->buttons;
603 }

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

617 {
618 global $DIC;
620 $tpl = $DIC["tpl"];
622
623 include_once("./Services/YUI/classes/class.ilYuiUtil.php");
627
628 $tpl->addJavaScript("./Services/JavaScript/js/Basic.js");
629 $tpl->addJavaScript("Services/Form/js/Form.js");
630
631 $this->tpl = new ilTemplate("tpl.property_form.html", true, true, "Services/Form");
632
633 // check if form has not title and first item is a section header
634 // -> use section header for title and remove section header
635 // -> command buttons are presented on top
636 $fi = $this->items[0];
637 if ($this->getMode() == "std" &&
638 $this->getTitle() == "" &&
639 is_object($fi) && $fi->getType() == "section_header"
640 ) {
641 $this->setTitle($fi->getTitle());
642 unset($this->items[0]);
643 }
644
645
646 // title icon
647 if ($this->getTitleIcon() != "" && @is_file($this->getTitleIcon())) {
648 $this->tpl->setCurrentBlock("title_icon");
649 $this->tpl->setVariable("IMG_ICON", $this->getTitleIcon());
650 $this->tpl->parseCurrentBlock();
651 }
652
653 // title
654 if ($this->getTitle() != "") {
655 // commands on top
656 if (count($this->buttons) > 0 && $this->getShowTopButtons() && count($this->items) > 2) {
657 // command buttons
658 foreach ($this->buttons as $button) {
659 $this->tpl->setCurrentBlock("cmd2");
660 $this->tpl->setVariable("CMD", $button["cmd"]);
661 $this->tpl->setVariable("CMD_TXT", $button["text"]);
662 if ($button["id"] != "") {
663 $this->tpl->setVariable("CMD2_ID", " id='" . $button["id"] . "_top'");
664 }
665 $this->tpl->parseCurrentBlock();
666 }
667 $this->tpl->setCurrentBlock("commands2");
668 $this->tpl->parseCurrentBlock();
669 }
670
671 if (is_object($ilSetting)) {
672 if ($ilSetting->get('char_selector_availability') > 0) {
673 require_once 'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
675 $char_selector = ilCharSelectorGUI::_getCurrentGUI();
676 if ($char_selector->getConfig()->getAvailability() == ilCharSelectorConfig::ENABLED) {
677 $char_selector->addToPage();
678 $this->tpl->TouchBlock('char_selector');
679 }
680 }
681 }
682 }
683
684 $this->tpl->setCurrentBlock("header");
685 $this->tpl->setVariable("TXT_TITLE", $this->getTitle());
686 $this->tpl->setVariable("LABEL", $this->getTopAnchor());
687 $this->tpl->setVariable("TXT_DESCRIPTION", $this->getDescription());
688 $this->tpl->parseCurrentBlock();
689 }
690 $this->tpl->touchBlock("item");
691
692 // properties
693 $this->required_text = false;
694 foreach ($this->items as $item) {
695 if ($item->getType() != "hidden") {
696 $this->insertItem($item);
697 }
698 }
699
700 // required
701 if ($this->required_text && $this->getMode() == "std") {
702 $this->tpl->setCurrentBlock("required_text");
703 $this->tpl->setVariable("TXT_REQUIRED", $lng->txt("required_field"));
704 $this->tpl->parseCurrentBlock();
705 }
706
707 // command buttons
708 foreach ($this->buttons as $button) {
709 $this->tpl->setCurrentBlock("cmd");
710 $this->tpl->setVariable("CMD", $button["cmd"]);
711 $this->tpl->setVariable("CMD_TXT", $button["text"]);
712
713 if ($button["id"] != "") {
714 $this->tpl->setVariable("CMD_ID", " id='" . $button["id"] . "'");
715 }
716
717 $this->tpl->parseCurrentBlock();
718 }
719
720 // #18808
721 if ($this->getMode() != "subform") {
722 // try to keep uploads even if checking input fails
723 if ($this->getMultipart()) {
724 $hash = $_POST["ilfilehash"];
725 if (!$hash) {
726 $hash = md5(uniqid(mt_rand(), true));
727 }
728 $fhash = new ilHiddenInputGUI("ilfilehash");
729 $fhash->setValue($hash);
730 $this->addItem($fhash);
731 }
732 }
733
734 // hidden properties
735 $hidden_fields = false;
736 foreach ($this->items as $item) {
737 if ($item->getType() == "hidden") {
738 $item->insert($this->tpl);
739 $hidden_fields = true;
740 }
741 }
742
743 if ($this->required_text || count($this->buttons) > 0 || $hidden_fields) {
744 $this->tpl->setCurrentBlock("commands");
745 $this->tpl->parseCurrentBlock();
746 }
747
748
749 if ($this->getMode() == "subform") {
750 $this->tpl->touchBlock("sub_table");
751 } else {
752 $this->tpl->touchBlock("std_table");
753 $this->tpl->setVariable('STD_TABLE_WIDTH', $this->getTableWidth());
754 }
755
756 return $this->tpl->get();
757 }
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

References $_POST, $DIC, $ilSetting, $lng, $settings, $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 242 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 408 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 997 of file class.ilPropertyFormGUI.php.

998 {
999 $res = array();
1000 if ($a_index) {
1001 if ($_FILES[$a_field]["tmp_name"][$a_index][$a_sub_index]) {
1002 $res = array(
1003 "tmp_name" => $_FILES[$a_field]["tmp_name"][$a_index][$a_sub_index],
1004 "name" => $_FILES[$a_field]["name"][$a_index][$a_sub_index],
1005 "type" => $_FILES[$a_field]["type"][$a_index][$a_sub_index],
1006 "error" => $_FILES[$a_field]["error"][$a_index][$a_sub_index],
1007 "size" => $_FILES[$a_field]["size"][$a_index][$a_sub_index],
1008 "is_upload" => true
1009 );
1010 }
1011 } elseif ($a_sub_index) {
1012 if ($_FILES[$a_field]["tmp_name"][$a_index]) {
1013 $res = array(
1014 "tmp_name" => $_FILES[$a_field]["tmp_name"][$a_index],
1015 "name" => $_FILES[$a_field]["name"][$a_index],
1016 "type" => $_FILES[$a_field]["type"][$a_index],
1017 "error" => $_FILES[$a_field]["error"][$a_index],
1018 "size" => $_FILES[$a_field]["size"][$a_index],
1019 "is_upload" => true
1020 );
1021 }
1022 } else {
1023 if ($_FILES[$a_field]["tmp_name"]) {
1024 $res = array(
1025 "tmp_name" => $_FILES[$a_field]["tmp_name"],
1026 "name" => $_FILES[$a_field]["name"],
1027 "type" => $_FILES[$a_field]["type"],
1028 "error" => $_FILES[$a_field]["error"],
1029 "size" => $_FILES[$a_field]["size"],
1030 "is_upload" => true
1031 );
1032 }
1033 }
1034 return $res;
1035 }
foreach($_POST as $key=> $value) $res

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

926 {
927 $html = parent::getHTML();
928
929 // #13531 - get content that has to reside outside of the parent form tag, e.g. panels/layers
930 foreach ($this->items as $item) {
931 // #13536 - ilFormSectionHeaderGUI does NOT extend ilFormPropertyGUI ?!
932 if (method_exists($item, "getContentOutsideFormTag")) {
933 $outside = $item->getContentOutsideFormTag();
934 if ($outside) {
935 $html .= $outside;
936 }
937 }
938 }
939
940 return $html;
941 }
$html
Definition: example_001.php:87

References $html.

Referenced by 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 551 of file class.ilPropertyFormGUI.php.

552 {
553 // this check ensures, that checkInput has been called (incl. stripSlashes())
554 if (!$this->check_input_called && $ensureValidation) {
555 die("Error: ilPropertyFormGUI->getInput() called without calling checkInput() first.");
556 }
557
558 return $_POST[$a_post_var];
559 }

References $_POST.

Referenced by ilAdvancedMDFieldDefinitionSelect\buildConfirmedObjects(), ilDclTableViewEditFormGUI\createTableView(), ilOrgUnitAuthorityFormGUI\fillObject(), ilOrgUnitDefaultPermissionFormGUI\fillObject(), 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(), ilMailOptionsFormGUI\save(), ilPersonalChatSettingsFormGUI\saveChatOptions(), ilForumCronNotification\saveCustomSettings(), ilConsultationHourCron\saveCustomSettings(), ilLoggerCronCleanErrorFiles\saveCustomSettings(), ilMailCronOrphanedMails\saveCustomSettings(), ilSCCronTrash\saveCustomSettings(), ilObjBibliographicAdminLibrariesFormGUI\saveObject(), arConfigFormGUI\saveValueForItem(), arEditGUI\setDateTimeRecordField(), 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(), ilForumSettingsGUI\updateCustomValues(), 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 374 of file class.ilPropertyFormGUI.php.

375 {
376 $inputItems = array();
377
378 foreach ($this->items as $item) {
379 if ($item->getType() == 'section_header') {
380 continue;
381 }
382
383 $inputItems[] = $item;
384
385 if ($item instanceof ilSubEnabledFormPropertyGUI) {
386 $inputItems = array_merge($inputItems, $item->getSubInputItemsRecursive());
387 }
388 }
389
390 return $inputItems;
391 }
This class represents a property that may include a sub form.

◆ getItemByPostVar()

ilPropertyFormGUI::getItemByPostVar (   $a_post_var)

Get Item by POST variable.

Parameters
string$a_postvarPost Var

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

334 {
335 foreach ($this->items as $key => $item) {
336 if ($item->getType() != "section_header") {
337 //if ($item->getPostVar() == $a_post_var)
338 $ret = $item->getItemByPostVar($a_post_var);
339 if (is_object($ret)) {
340 return $ret;
341 }
342 }
343 }
344
345 return false;
346 }
$key
Definition: croninfo.php:18
$ret
Definition: parser.php:6

References $key, and $ret.

Referenced by ilCronDeleteInactiveUserAccounts\addCustomSettingsToForm(), ilTestRandomQuestionSetPoolDefinitionFormGUI\applySubmit(), executeCommand(), ilExcCriteriaText\exportCustomForm(), ilExcCriteriaGUI\exportForm(), ilExcCriteriaCatalogueGUI\exportForm(), ilExAssignmentEditorGUI\getAssignmentValues(), ilAssOrderingQuestionAuthoringFormGUI\getOrderingElementInputField(), ilExAssignmentEditorGUI\handleDisabledFields(), ilExAssignmentEditorGUI\handleDisabledPeerFields(), ilCourseLPBadgeGUI\importConfigToForm(), ilUserProfileBadgeGUI\importConfigToForm(), ilAdvancedMDFieldDefinition\importDefinitionFormPostValues(), ilAdvancedMDFieldDefinitionSelect\prepareCustomDefinitionFormConfirmation(), ilAdvancedMDFieldDefinition\prepareDefinitionFormConfirmation(), ilExAssignmentEditorGUI\processForm(), ilExAssignmentEditorGUI\processPeerReviewForm(), ilAssOrderingQuestionAuthoringFormGUI\renewOrderingElementInput(), ilTestRandomQuestionSetGeneralConfigFormGUI\save(), ilCronDeleteInactiveUserAccounts\saveCustomSettings(), ilObjTestSettingsGeneralGUI\saveQuestionBehaviourProperties(), ilObjTestSettingsScoringResultsGUI\saveResultMiscOptionsSettings(), ilBadgeManagementGUI\setBadgeFormValues(), ilExAssignmentEditorGUI\setDisabledFieldValues(), ilExAssignmentEditorGUI\setDisabledPeerReviewFieldValues(), ilCharSelectorGUI\setFormValues(), ilObjBadgeAdministrationGUI\setImageTemplateFormValues(), ilObjBlogGUI\updateCustom(), ilObjPollGUI\updateCustom(), ilObjPortfolioBaseGUI\updateCustom(), ilObjPortfolioTemplateGUI\updateCustom(), ilObjPollGUI\validateCustom(), SurveyMultipleChoiceQuestionGUI\validateEditForm(), ilCourseLPBadgeGUI\validateForm(), assImagemapQuestionGUI\writeAnswerSpecificPostData(), and assKprimChoiceGUI\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 182 of file class.ilPropertyFormGUI.php.

183 {
184 return $this->mode;
185 }

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 278 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 162 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 202 of file class.ilPropertyFormGUI.php.

203 {
204 return $this->title;
205 }

References $title.

Referenced by getContent().

+ Here is the caller graph for this function:

◆ getTitleIcon()

ilPropertyFormGUI::getTitleIcon ( )

Get TitleIcon.

Returns
string TitleIcon

Definition at line 222 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 262 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 1045 of file class.ilPropertyFormGUI.php.

1046 {
1047 $data = $this->getFileUpload($a_field, $a_index, $a_sub_index);
1048 return (bool) $data["tmp_name"];
1049 }
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 759 of file class.ilPropertyFormGUI.php.

760 {
761 // #15818
762 return in_array($a_type, array("non_editable_value"));
763 }
$a_type
Definition: workflow.php:92

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

766 {
767 global $DIC;
768 $tpl = $DIC["tpl"];
769 ;
771
772
773 $cfg = array();
774
775 //if(method_exists($item, "getMulti") && $item->getMulti())
776 if ($item instanceof ilMultiValuesItem && $item->getMulti()) {
777 $tpl->addJavascript("./Services/Form/js/ServiceFormMulti.js");
778
779 $this->tpl->setCurrentBlock("multi_in");
780 $this->tpl->setVariable("ID", $item->getFieldId());
781 $this->tpl->parseCurrentBlock();
782
783 $this->tpl->touchBlock("multi_out");
784
785
786 // add hidden item to enable preset multi items
787 // not used yet, should replace hidden field stuff
788 $multi_values = $item->getMultiValues();
789 if (is_array($multi_values) && sizeof($multi_values) > 1) {
790 $multi_value = new ilHiddenInputGUI("ilMultiValues~" . $item->getPostVar());
791 $multi_value->setValue(implode("~", $multi_values));
792 $this->addItem($multi_value);
793 }
794 $cfg["multi_values"] = $multi_values;
795 }
796
797 $item->insert($this->tpl);
798
799 if ($item->getType() == "file" || $item->getType() == "image_file") {
800 $this->setMultipart(true);
801 }
802
803 if ($item->getType() != "section_header") {
804 $cfg["id"] = $item->getFieldId();
805
806 // info text
807 if ($item->getInfo() != "") {
808 $this->tpl->setCurrentBlock("description");
809 $this->tpl->setVariable(
810 "PROPERTY_DESCRIPTION",
811 $item->getInfo()
812 );
813 $this->tpl->parseCurrentBlock();
814 }
815
816 if ($this->getMode() == "subform") {
817 // required
818 if (!$this->hideRequired($item->getType())) {
819 if ($item->getRequired()) {
820 $this->tpl->touchBlock("sub_required");
821 $this->required_text = true;
822 }
823 }
824
825 // hidden title (for accessibility, e.g. file upload)
826 if ($item->getHiddenTitle() != "") {
827 $this->tpl->setCurrentBlock("sub_hid_title");
828 $this->tpl->setVariable(
829 "SPHID_TITLE",
830 $item->getHiddenTitle()
831 );
832 $this->tpl->parseCurrentBlock();
833 }
834
835 $this->tpl->setCurrentBlock("sub_prop_start");
836 $this->tpl->setVariable("PROPERTY_TITLE", $item->getTitle());
837 $this->tpl->setVariable("PROPERTY_CLASS", "il_" . $item->getType());
838 if ($item->getType() != "non_editable_value") {
839 $this->tpl->setVariable("LAB_ID", $item->getFieldId());
840 }
841 $this->tpl->parseCurrentBlock();
842 } else {
843 // required
844 if (!$this->hideRequired($item->getType())) {
845 if ($item->getRequired()) {
846 $this->tpl->touchBlock("required");
847 $this->required_text = true;
848 }
849 }
850
851 // hidden title (for accessibility, e.g. file upload)
852 if ($item->getHiddenTitle() != "") {
853 $this->tpl->setCurrentBlock("std_hid_title");
854 $this->tpl->setVariable(
855 "PHID_TITLE",
856 $item->getHiddenTitle()
857 );
858 $this->tpl->parseCurrentBlock();
859 }
860
861 $this->tpl->setCurrentBlock("std_prop_start");
862 $this->tpl->setVariable("PROPERTY_TITLE", $item->getTitle());
863 if ($item->getType() != "non_editable_value") {
864 $this->tpl->setVariable("LAB_ID", $item->getFieldId());
865 }
866 if ($this->getHideLabels()) {
867 $this->tpl->setVariable("HIDE_LABELS_STYLE", " ilFormOptionHidden");
868 }
869 $this->tpl->parseCurrentBlock();
870 }
871
872 // alert
873 if ($item->getType() != "non_editable_value" && $item->getAlert() != "") {
874 $this->tpl->setCurrentBlock("alert");
875 $this->tpl->setVariable(
876 "IMG_ALERT",
877 ilUtil::getImagePath("icon_alert.svg")
878 );
879 $this->tpl->setVariable(
880 "ALT_ALERT",
881 $lng->txt("alert")
882 );
883 $this->tpl->setVariable(
884 "TXT_ALERT",
885 $item->getAlert()
886 );
887 $this->tpl->parseCurrentBlock();
888 }
889
890 // subitems
891 $sf = null;
892 if ($item->getType() != "non_editable_value" or 1) {
893 $sf = $item->getSubForm();
894 if ($item->hideSubForm() && is_object($sf)) {
895 $this->tpl->setCurrentBlock("sub_form_hide");
896 $this->tpl->setVariable("DSFID", $item->getFieldId());
897 $this->tpl->parseCurrentBlock();
898 }
899 }
900
901
902 $sf_content = "";
903 if (is_object($sf)) {
904 $sf_content = $sf->getContent();
905 if ($sf->getMultipart()) {
906 $this->setMultipart(true);
907 }
908 $this->tpl->setCurrentBlock("sub_form");
909 $this->tpl->setVariable("PROP_SUB_FORM", $sf_content);
910 $this->tpl->setVariable("SFID", $item->getFieldId());
911 $this->tpl->parseCurrentBlock();
912 }
913
914 $this->tpl->setCurrentBlock("prop");
915 /* not used yet
916 $this->tpl->setVariable("ID", $item->getFieldId());
917 $this->tpl->setVariable("CFG", ilJsonUtil::encode($cfg));*/
918 $this->tpl->parseCurrentBlock();
919 }
920
921
922 $this->tpl->touchBlock("item");
923 }
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.
catch(Exception $e) if(isset( $_POST[ 'cancel'])) if(isset($_POST['continue'])) $cfg

References $cfg, $DIC, $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 1061 of file class.ilPropertyFormGUI.php.

1062 {
1063 if (!is_dir($a_target_directory)) {
1064 return;
1065 }
1066
1067 $data = $this->getFileUpload($a_field, $a_index, $a_sub_index);
1068 if ($data["tmp_name"] && file_exists($data["tmp_name"])) {
1069 if ($a_target_name) {
1070 $data["name"] = $a_target_name;
1071 }
1072
1073 $target_file = $a_target_directory . "/" . $data["name"];
1074 $target_file = str_replace("//", "/", $target_file);
1075
1076 if ($data["is_upload"]) {
1077 if (!ilUtil::moveUploadedFile($data["tmp_name"], $data["name"], $target_file)) {
1078 return;
1079 }
1080 } else {
1081 if (!rename($data["tmp_name"], $target_file)) {
1082 return;
1083 }
1084 }
1085
1086 return $target_file;
1087 }
1088 }

References $data, and getFileUpload().

+ Here is the call graph for this function:

◆ rebuildUploadedFiles()

ilPropertyFormGUI::rebuildUploadedFiles ( )
protected

try to rebuild files

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

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

References $_POST, $file, ilFormGUI\$name, $type, 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,
  $a_remove_unused_headers = false 
)

Remove Item.

Parameters
string$a_postvarPost Var

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

300 {
301 foreach ($this->items as $key => $item) {
302 if (method_exists($item, "getPostVar") && $item->getPostVar() == $a_post_var) {
303 unset($this->items[$key]);
304 }
305 }
306
307 // remove section headers if they do not contain any items anymore
308 if ($a_remove_unused_headers) {
309 $unset_keys = array();
310 $last_item = null;
311 $last_key = null;
312 foreach ($this->items as $key => $item) {
313 if ($item instanceof ilFormSectionHeaderGUI && $last_item instanceof ilFormSectionHeaderGUI) {
314 $unset_keys[] = $last_key;
315 }
316 $last_item = $item;
317 $last_key = $key;
318 }
319 if ($last_item instanceof ilFormSectionHeaderGUI) {
320 $unset_keys[] = $last_key;
321 }
322 foreach ($unset_keys as $key) {
323 unset($this->items[$key]);
324 }
325 }
326 }
This class represents a section header in a property form.

References $key.

Referenced by ilObjItemGroupGUI\initEditCustomForm().

+ Here is the caller graph for this function:

◆ setDescription()

ilPropertyFormGUI::setDescription (   $a_val)

Set description.

Parameters
stringdescription

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

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

◆ setDisableStandardMessage()

ilPropertyFormGUI::setDisableStandardMessage (   $a_val)

Set disable standard message.

Parameters
booleandisable standard message

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

399 {
400 $this->disable_standard_message = $a_val;
401 }

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

429 {
430 $this->hide_labels = $a_value;
431 }

◆ setItems()

ilPropertyFormGUI::setItems (   $a_items)

Set Items.

Parameters
array$a_itemsarray of item objects

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

354 {
355 $this->items = $a_items;
356 }

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

173 {
174 $this->mode = $a_mode;
175 }

◆ setShowTopButtons()

ilPropertyFormGUI::setShowTopButtons (   $a_val)

Get show top buttons.

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

271 {
272 $this->show_top_buttons = $a_val;
273 }

◆ setTableWidth()

ilPropertyFormGUI::setTableWidth (   $a_width)
final

Set table width.

@access public

Parameters
stringtable width

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

152 {
153 $this->tbl_width = $a_width;
154 }

◆ setTitle()

◆ setTitleIcon()

ilPropertyFormGUI::setTitleIcon (   $a_titleicon)

Set TitleIcon.

Parameters
string$a_titleiconTitleIcon

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

213 {
214 $this->titleicon = $a_titleicon;
215 }

◆ setTopAnchor()

ilPropertyFormGUI::setTopAnchor (   $a_val)

Set top anchor.

Parameters
stringtop anchor

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

253 {
254 $this->top_anchor = $a_val;
255 }

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

439 {
440 foreach ($this->items as $item) {
441 if (!($a_restrict_to_value_keys) ||
442 in_array($item->getPostVar(), array_keys($a_values))) {
443 $item->setValueByArray($a_values);
444 }
445 }
446 }

Referenced by ilObjBibliographicAdminLibrariesFormGUI\fillForm(), ilOrgUnitAuthorityFormGUI\fillForm(), ilOrgUnitPositionFormGUI\fillForm(), ilOrgUnitDefaultPermissionFormGUI\fillForm(), arConfigFormGUI\fillForm(), ilMemcacheServerFormGUI\fillForm(), ilIndividualAssessmentMemberGUI\fillForm(), ilIndividualAssessmentSettingsGUI\fillForm(), ilIndividualAssessmentSettingsGUI\fillInfoForm(), ilExAssignmentEditorGUI\getAssignmentValues(), ilMailOptionsFormGUI\populate(), and ilPersonalChatSettingsFormGUI\showChatOptions().

+ Here is the caller graph for this function:

◆ setValuesByPost()

ilPropertyFormGUI::setValuesByPost ( )

Set form values from POST values.

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

453 {
454 foreach ($this->items as $item) {
455 $item->setValueByArray($_POST);
456 }
457 }

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

Referenced by getCommandButtons().

◆ $check_input_called

ilPropertyFormGUI::$check_input_called = false
protected

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

◆ $ctrl

◆ $description

ilPropertyFormGUI::$description = ""
protected

◆ $disable_standard_message

ilPropertyFormGUI::$disable_standard_message = false
protected

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

Referenced by getDisableStandardMessage().

◆ $hide_labels

ilPropertyFormGUI::$hide_labels = false
protected

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

Referenced by getHideLabels().

◆ $items

ilPropertyFormGUI::$items = array()
private

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

Referenced by getItems().

◆ $lng

◆ $mode

ilPropertyFormGUI::$mode = "std"
protected

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

Referenced by getMode().

◆ $settings

ilPropertyFormGUI::$settings
protected

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

Referenced by FormMailCodesGUI\__construct(), and getContent().

◆ $show_top_buttons

ilPropertyFormGUI::$show_top_buttons = true
protected

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

Referenced by getShowTopButtons().

◆ $tbl_width

ilPropertyFormGUI::$tbl_width = false
protected

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

Referenced by getTableWidth().

◆ $titleicon

ilPropertyFormGUI::$titleicon = false
protected

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

Referenced by getTitleIcon().

◆ $top_anchor

ilPropertyFormGUI::$top_anchor = "il_form_top"
protected

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

Referenced by getTopAnchor().

◆ $tpl

◆ $user

ilPropertyFormGUI::$user
protected

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