ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
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...
 
 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

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

ilPropertyFormGUI::addCommandButton (   $a_cmd,
  $a_text 
)

◆ 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(), ilPaymentCronNotification\addCustomSettingsToForm(), ilCronDeleteInactivatedUserAccounts\addCustomSettingsToForm(), ilCronDeleteInactiveUserAccounts\addCustomSettingsToForm(), ilDAVCronDiskQuota\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(), ilTestRandomQuestionSetGeneralConfigFormGUI\build(), ilTestRandomQuestionSetPoolDefinitionFormGUI\build(), ilAssQuestionFeedback\completeGenericFormProperties(), ilAssConfigurableMultiOptionQuestionFeedback\completeSpecificFormProperties(), ilAssMultiOptionQuestionFeedback\completeSpecificFormProperties(), getContent(), ilObjForumAdministrationGUI\getSettingsForm(), 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(), arConfigFormGUI\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(), 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(), 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

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
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(), arConfigFormGUI\fillObject(), 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 547 of file class.ilPropertyFormGUI.php.

548 {
549 $this->buttons = array();
550 }

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

◆ getContent()

ilPropertyFormGUI::getContent ( )

Get Content.

Reimplemented from ilFormGUI.

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

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

950 {
951 $res = array();
952 if($a_index)
953 {
954 if($_FILES[$a_field]["tmp_name"][$a_index][$a_sub_index])
955 {
956 $res = array(
957 "tmp_name" => $_FILES[$a_field]["tmp_name"][$a_index][$a_sub_index],
958 "name" => $_FILES[$a_field]["name"][$a_index][$a_sub_index],
959 "type" => $_FILES[$a_field]["type"][$a_index][$a_sub_index],
960 "error" => $_FILES[$a_field]["error"][$a_index][$a_sub_index],
961 "size" => $_FILES[$a_field]["size"][$a_index][$a_sub_index],
962 "is_upload" => true
963 );
964 }
965 else if($this->reloaded_files[$a_field]["tmp_name"][$a_index][$a_sub_index])
966 {
967 $res = array(
968 "tmp_name" => $this->reloaded_files["tmp_name"][$a_index][$a_sub_index],
969 "name" => $this->reloaded_files["name"][$a_index][$a_sub_index],
970 "type" => $this->reloaded_files["type"][$a_index][$a_sub_index],
971 "error" => $this->reloaded_files["error"][$a_index][$a_sub_index],
972 "size" => $this->reloaded_files["size"][$a_index][$a_sub_index],
973 "is_upload" => false
974 );
975 }
976 }
977 else if($a_sub_index)
978 {
979 if($_FILES[$a_field]["tmp_name"][$a_index])
980 {
981 $res = array(
982 "tmp_name" => $_FILES[$a_field]["tmp_name"][$a_index],
983 "name" => $_FILES[$a_field]["name"][$a_index],
984 "type" => $_FILES[$a_field]["type"][$a_index],
985 "error" => $_FILES[$a_field]["error"][$a_index],
986 "size" => $_FILES[$a_field]["size"][$a_index],
987 "is_upload" => true
988 );
989 }
990 else if($this->reloaded_files[$a_field]["tmp_name"][$a_index])
991 {
992 $res = array(
993 "tmp_name" => $this->reloaded_files[$a_field]["tmp_name"][$a_index],
994 "name" => $this->reloaded_files[$a_field]["name"][$a_index],
995 "type" => $this->reloaded_files[$a_field]["type"][$a_index],
996 "error" => $this->reloaded_files[$a_field]["error"][$a_index],
997 "size" => $this->reloaded_files[$a_field]["size"][$a_index],
998 "is_upload" => false
999 );
1000 }
1001 }
1002 else
1003 {
1004 if($_FILES[$a_field]["tmp_name"])
1005 {
1006 $res = array(
1007 "tmp_name" => $_FILES[$a_field]["tmp_name"],
1008 "name" => $_FILES[$a_field]["name"],
1009 "type" => $_FILES[$a_field]["type"],
1010 "error" => $_FILES[$a_field]["error"],
1011 "size" => $_FILES[$a_field]["size"],
1012 "is_upload" => true
1013 );
1014 }
1015 else if($this->reloaded_files[$a_field]["tmp_name"])
1016 {
1017 $res = array(
1018 "tmp_name" => $this->reloaded_files[$a_field]["tmp_name"],
1019 "name" => $this->reloaded_files[$a_field]["name"],
1020 "type" => $this->reloaded_files[$a_field]["type"],
1021 "error" => $this->reloaded_files[$a_field]["error"],
1022 "size" => $this->reloaded_files[$a_field]["size"],
1023 "is_upload" => false
1024 );
1025 }
1026 }
1027 return $res;
1028 }

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.

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

874 {
875 $html = parent::getHTML();
876
877 // #13531 - get content that has to reside outside of the parent form tag, e.g. panels/layers
878 foreach($this->items as $item)
879 {
880 // #13536 - ilFormSectionHeaderGUI does NOT extend ilFormPropertyGUI ?!
881 if(method_exists($item, "getContentOutsideFormTag"))
882 {
883 $outside = $item->getContentOutsideFormTag();
884 if($outside)
885 {
886 $html .= $outside;
887 }
888 }
889 }
890
891 return $html;
892 }

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(), ilCharSelectorGUI\getFormValues(), ilAdvancedMDFieldDefinitionFloat\importCustomDefinitionFormPostValues(), ilAdvancedMDFieldDefinitionInteger\importCustomDefinitionFormPostValues(), ilAdvancedMDFieldDefinitionSelect\importCustomDefinitionFormPostValues(), ilAdvancedMDFieldDefinitionSelectMulti\importCustomDefinitionFormPostValues(), ilAdvancedMDFieldDefinitionText\importCustomDefinitionFormPostValues(), ilAdvancedMDFieldDefinition\importDefinitionFormPostValues(), SurveyMatrixQuestionGUI\importEditFormValues(), SurveyMetricQuestionGUI\importEditFormValues(), SurveyMultipleChoiceQuestionGUI\importEditFormValues(), SurveySingleChoiceQuestionGUI\importEditFormValues(), SurveyTextQuestionGUI\importEditFormValues(), ilAdvancedMDFieldDefinitionSelect\prepareCustomDefinitionFormConfirmation(), ilAdvancedMDFieldDefinition\prepareDefinitionFormConfirmation(), ilMemberAgreementGUI\saveCourseDefinedFields(), ilForumCronNotification\saveCustomSettings(), ilConsultationHourCron\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(), 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 assMultipleChoiceGUI\addBasicQuestionFormProperties(), ilCronDeleteInactiveUserAccounts\addCustomSettingsToForm(), ilTestRandomQuestionSetPoolDefinitionFormGUI\applySubmit(), ilChatroomFormFactory\applyValues(), executeCommand(), ilTestSettingsGUI\formPropertyExists(), ilObjExerciseGUI\handleDisabledAssignmentFields(), ilObjTestSettingsScoringResultsGUI\hasScoringSettingsChanged(), ilAdvancedMDFieldDefinition\importDefinitionFormPostValues(), ilAssQuestionFeedback\initGenericFormProperties(), ilAssConfigurableMultiOptionQuestionFeedback\initSpecificFormProperties(), ilAssMultiOptionQuestionFeedback\initSpecificFormProperties(), ilObjTestSettingsGeneralGUI\isSkillServiceSettingToBeAdjusted(), assMatchingQuestionGUI\isValidTermAndDefinitionAmount(), ilObjTestDynamicQuestionSetConfigGUI\performSaveForm(), ilObjTestSettingsGeneralGUI\performSaveForm(), ilObjQuestionPoolSettingsGeneralGUI\performSaveForm(), ilAdvancedMDFieldDefinitionSelect\prepareCustomDefinitionFormConfirmation(), ilAdvancedMDFieldDefinition\prepareDefinitionFormConfirmation(), 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(), 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 ilUserFormSettings\exportToForm(), arConfigFormGUI\fillForm(), 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 1038 of file class.ilPropertyFormGUI.php.

1039 {
1040 $data = $this->getFileUpload($a_field, $a_index, $a_sub_index);
1041 return (bool)$data["tmp_name"];
1042 }
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:

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

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

912 {
913 global $ilUser;
914
915 $user_id = $ilUser->getId();
916 if(!$user_id || $user_id == ANONYMOUS_USER_ID)
917 {
918 return;
919 }
920
921 $a_name = ilUtil::getAsciiFileName($a_name);
922
923 $tmp_file_name = implode("~~", array($user_id,
924 $a_hash,
925 $a_field,
926 $a_index,
927 $a_sub_index,
928 str_replace("/", "~~", $a_type),
929 str_replace("~~", "_", $a_name)));
930
931 // make sure temp directory exists
932 $temp_path = ilUtil::getDataDir() . "/temp";
933 if (!is_dir($temp_path))
934 {
935 ilUtil::createDirectory($temp_path);
936 }
937
938 move_uploaded_file($a_tmp_name, $temp_path."/".$tmp_file_name);
939 }
static getDataDir()
get data directory (outside webspace)
static createDirectory($a_dir, $a_mod=0755)
create directory

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

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

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

References $data, and getFileUpload().

+ Here is the call graph for this function:

◆ rebuildUploadedFiles()

ilPropertyFormGUI::rebuildUploadedFiles ( )
protected

try to rebuild files

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

1095 {
1096 global $ilUser;
1097
1098 if($_POST["ilfilehash"])
1099 {
1100 $user_id = $ilUser->getId();
1101 $temp_path = ilUtil::getDataDir() . "/temp";
1102 if(is_dir($temp_path) && $user_id && $user_id != ANONYMOUS_USER_ID)
1103 {
1104 $reload = array();
1105
1106 $temp_files = glob($temp_path."/".$ilUser->getId()."~~".$_POST["ilfilehash"]."~~*");
1107 if(is_array($temp_files))
1108 {
1109 foreach($temp_files as $full_file)
1110 {
1111 $file = explode("~~", basename($full_file));
1112 $field = $file[2];
1113 $idx = $file[3];
1114 $idx2 = $file[4];
1115 $type = $file[5]."/".$file[6];
1116 $name = $file[7];
1117
1118 if($idx2 != "")
1119 {
1120 if(!$_FILES[$field]["tmp_name"][$idx][$idx2])
1121 {
1122 $reload[$field]["tmp_name"][$idx][$idx2] = $full_file;
1123 $reload[$field]["name"][$idx][$idx2] = $name;
1124 $reload[$field]["type"][$idx][$idx2] = $type;
1125 $reload[$field]["error"][$idx][$idx2] = 0;
1126 $reload[$field]["size"][$idx][$idx2] = filesize($full_file);
1127 }
1128 }
1129 else if($idx != "")
1130 {
1131 if(!$_FILES[$field]["tmp_name"][$idx])
1132 {
1133 $reload[$field]["tmp_name"][$idx] = $full_file;
1134 $reload[$field]["name"][$idx] = $name;
1135 $reload[$field]["type"][$idx] = $type;
1136 $reload[$field]["error"][$idx] = 0;
1137 $reload[$field]["size"][$idx] = filesize($full_file);
1138 }
1139 }
1140 else
1141 {
1142 if(!$_FILES[$field]["tmp_name"])
1143 {
1144 $reload[$field]["tmp_name"] = $full_file;
1145 $reload[$field]["name"] = $name;
1146 $reload[$field]["type"] = $type;
1147 $reload[$field]["error"] = 0;
1148 $reload[$field]["size"] = filesize($full_file);
1149 }
1150 }
1151 }
1152 }
1153
1154 $this->reloaded_files = $reload;
1155 }
1156 }
1157 }

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(), 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(), and ilOrgUnitTypeFormGUI\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.

◆ $check_input_called

ilPropertyFormGUI::$check_input_called = false
protected

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

◆ $description

ilPropertyFormGUI::$description = ""
protected

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

Referenced by ilOrgUnitTypeFormGUI\fillObject(), and getDescription().

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