ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilMultipleImagesAdditionalIndexLevelRemover Class Reference
+ Inheritance diagram for ilMultipleImagesAdditionalIndexLevelRemover:
+ Collaboration diagram for ilMultipleImagesAdditionalIndexLevelRemover:

Public Member Functions

 getPostVar ()
 
 setPostVar ($postVar)
 
 manipulateFormInputValues ($inputValues)
 
 manipulateFormSubmitValues ($submitValues)
 

Protected Member Functions

 getFilesSubmissionProperties ()
 
 isSubFieldAvailable ($values, $subFieldName)
 
 isIteratorSubfieldAvailable ($values)
 
 isUploadSubfieldAvailable ($values)
 
 removeAdditionalSubFieldsLevelFromSubmitValues ($values)
 
 removeAdditionalSubFieldsLevelFromFilesSubmitProperty ($uploadProperty)
 
 removeAdditionalSubFieldsLevelFromFilesSubmit ($filesSubmit)
 

Protected Attributes

 $filesSubmissionProperties
 
 $postVar
 

Detailed Description

Member Function Documentation

◆ getFilesSubmissionProperties()

ilMultipleImagesAdditionalIndexLevelRemover::getFilesSubmissionProperties ( )
protected

◆ getPostVar()

ilMultipleImagesAdditionalIndexLevelRemover::getPostVar ( )

Definition at line 20 of file class.ilMultipleImagesAdditionalIndexLevelRemover.php.

References $postVar.

Referenced by manipulateFormSubmitValues().

+ Here is the caller graph for this function:

◆ isIteratorSubfieldAvailable()

ilMultipleImagesAdditionalIndexLevelRemover::isIteratorSubfieldAvailable (   $values)
protected

Definition at line 68 of file class.ilMultipleImagesAdditionalIndexLevelRemover.php.

References isSubFieldAvailable(), and ilMultipleImagesInputGUI\ITERATOR_SUBFIELD_NAME.

Referenced by removeAdditionalSubFieldsLevelFromSubmitValues().

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

◆ isSubFieldAvailable()

ilMultipleImagesAdditionalIndexLevelRemover::isSubFieldAvailable (   $values,
  $subFieldName 
)
protected

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

Referenced by isIteratorSubfieldAvailable(), and isUploadSubfieldAvailable().

52  {
53  if (!is_array($values)) {
54  return false;
55  }
56 
57  if (!isset($values[$subFieldName])) {
58  return false;
59  }
60 
61  if (!is_array($values[$subFieldName])) {
62  return false;
63  }
64 
65  return true;
66  }
+ Here is the caller graph for this function:

◆ isUploadSubfieldAvailable()

ilMultipleImagesAdditionalIndexLevelRemover::isUploadSubfieldAvailable (   $values)
protected

◆ manipulateFormInputValues()

ilMultipleImagesAdditionalIndexLevelRemover::manipulateFormInputValues (   $inputValues)
Parameters
array$inputValues
Returns
array $inputValues

Implements ilFormValuesManipulator.

Definition at line 34 of file class.ilMultipleImagesAdditionalIndexLevelRemover.php.

35  {
36  return $inputValues;
37  }

◆ manipulateFormSubmitValues()

ilMultipleImagesAdditionalIndexLevelRemover::manipulateFormSubmitValues (   $submitValues)
Parameters
array$submitValues
Returns
array $submitValues

Implements ilFormValuesManipulator.

Definition at line 39 of file class.ilMultipleImagesAdditionalIndexLevelRemover.php.

References getPostVar(), removeAdditionalSubFieldsLevelFromFilesSubmit(), and removeAdditionalSubFieldsLevelFromSubmitValues().

40  {
41  $submitValues = $this->removeAdditionalSubFieldsLevelFromSubmitValues($submitValues);
42 
43  if ($_FILES) {
45  $_FILES[$this->getPostVar()]
46  );
47  }
48 
49  return $submitValues;
50  }
+ Here is the call graph for this function:

◆ removeAdditionalSubFieldsLevelFromFilesSubmit()

ilMultipleImagesAdditionalIndexLevelRemover::removeAdditionalSubFieldsLevelFromFilesSubmit (   $filesSubmit)
protected

Definition at line 116 of file class.ilMultipleImagesAdditionalIndexLevelRemover.php.

References getFilesSubmissionProperties(), and removeAdditionalSubFieldsLevelFromFilesSubmitProperty().

Referenced by manipulateFormSubmitValues().

117  {
118  foreach ($this->getFilesSubmissionProperties() as $uploadProperty) {
119  if (!isset($filesSubmit[$uploadProperty])) {
120  continue;
121  }
122 
123  $filesSubmit[$uploadProperty] = $this->removeAdditionalSubFieldsLevelFromFilesSubmitProperty(
124  $filesSubmit[$uploadProperty]
125  );
126  }
127 
128  return $filesSubmit;
129  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeAdditionalSubFieldsLevelFromFilesSubmitProperty()

ilMultipleImagesAdditionalIndexLevelRemover::removeAdditionalSubFieldsLevelFromFilesSubmitProperty (   $uploadProperty)
protected

Definition at line 99 of file class.ilMultipleImagesAdditionalIndexLevelRemover.php.

References isUploadSubfieldAvailable().

Referenced by removeAdditionalSubFieldsLevelFromFilesSubmit().

100  {
101  if (!$this->isUploadSubfieldAvailable($uploadProperty)) {
102  return $uploadProperty;
103  }
104 
105  foreach ($uploadProperty as $subField => $submittedFile) {
106  foreach ($submittedFile as $identifier => $uploadValue) {
107  $uploadProperty[$identifier] = $uploadValue;
108  }
109 
110  unset($uploadProperty[$subField]);
111  }
112 
113  return $uploadProperty;
114  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeAdditionalSubFieldsLevelFromSubmitValues()

ilMultipleImagesAdditionalIndexLevelRemover::removeAdditionalSubFieldsLevelFromSubmitValues (   $values)
protected

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

References $index, array, isIteratorSubfieldAvailable(), ilMultipleImagesInputGUI\ITERATOR_SUBFIELD_NAME, and ilMultipleImagesInputGUI\STORED_IMAGE_SUBFIELD_NAME.

Referenced by manipulateFormSubmitValues().

79  {
80  if (!$this->isIteratorSubfieldAvailable($values)) {
81  return $values;
82  }
83 
85  $actualValues = array();
86 
87  foreach ($values[ilMultipleImagesInputGUI::ITERATOR_SUBFIELD_NAME] as $index => $value) {
88  if (!isset($storedImages[$index])) {
89  $actualValues[$index] = '';
90  continue;
91  }
92 
93  $actualValues[$index] = $storedImages[$index];
94  }
95 
96  return $actualValues;
97  }
$index
Definition: metadata.php:60
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setPostVar()

ilMultipleImagesAdditionalIndexLevelRemover::setPostVar (   $postVar)

Field Documentation

◆ $filesSubmissionProperties

ilMultipleImagesAdditionalIndexLevelRemover::$filesSubmissionProperties
protected
Initial value:
'name', 'tmp_name', 'type', 'error', 'size'
)

Definition at line 14 of file class.ilMultipleImagesAdditionalIndexLevelRemover.php.

Referenced by getFilesSubmissionProperties().

◆ $postVar

ilMultipleImagesAdditionalIndexLevelRemover::$postVar
protected

Definition at line 18 of file class.ilMultipleImagesAdditionalIndexLevelRemover.php.

Referenced by getPostVar(), and setPostVar().


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