ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilIdentifiedMultiValuesJsPositionIndexRemover Class Reference
+ Inheritance diagram for ilIdentifiedMultiValuesJsPositionIndexRemover:
+ Collaboration diagram for ilIdentifiedMultiValuesJsPositionIndexRemover:

Public Member Functions

 manipulateFormInputValues ($inputValues)
 
 manipulateFormSubmitValues ($submitValues)
 

Data Fields

const IDENTIFIER_INDICATOR_PREFIX = 'IDENTIFIER~'
 

Protected Member Functions

 brandIdentifiersWithIndicator ($origValues)
 
 getIndicatorBrandedIdentifier ($identifier)
 
 cleanSubmitCommandFromPossibleIdentifierIndicators ($cmdArrayLevel)
 
 removePositionIndexLevels ($values)
 
 isPositionIndexLevel ($val)
 
 isValueIdentifier ($key)
 
 removeIdentifierIndicator ($key)
 
 fetchPositionIndexedValue ($value)
 

Detailed Description

Member Function Documentation

◆ brandIdentifiersWithIndicator()

ilIdentifiedMultiValuesJsPositionIndexRemover::brandIdentifiersWithIndicator (   $origValues)
protected

Definition at line 21 of file class.ilIdentifiedMultiValuesJsPositionIndexRemover.php.

References array, and getIndicatorBrandedIdentifier().

Referenced by manipulateFormInputValues().

22  {
23  $brandedValues = array();
24 
25  foreach($origValues as $identifier => $val)
26  {
27  $brandedValues[$this->getIndicatorBrandedIdentifier($identifier)] = $val;
28  }
29 
30  return $brandedValues;
31  }
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:

◆ cleanSubmitCommandFromPossibleIdentifierIndicators()

ilIdentifiedMultiValuesJsPositionIndexRemover::cleanSubmitCommandFromPossibleIdentifierIndicators (   $cmdArrayLevel)
protected

Definition at line 44 of file class.ilIdentifiedMultiValuesJsPositionIndexRemover.php.

References isValueIdentifier(), and removeIdentifierIndicator().

Referenced by manipulateFormSubmitValues().

45  {
46  if( is_array($cmdArrayLevel) )
47  {
48  $currentKey = key($cmdArrayLevel);
49  $nextLevel = current($cmdArrayLevel);
50 
51  $nextLevel = $this->cleanSubmitCommandFromPossibleIdentifierIndicators($nextLevel);
52 
53  unset($cmdArrayLevel[$currentKey]);
54 
55  if( $this->isValueIdentifier($currentKey) )
56  {
57  $currentKey = $this->removeIdentifierIndicator($currentKey);
58  }
59 
60  $cmdArrayLevel[$currentKey] = $nextLevel;
61  }
62 
63  return $cmdArrayLevel;
64  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fetchPositionIndexedValue()

ilIdentifiedMultiValuesJsPositionIndexRemover::fetchPositionIndexedValue (   $value)
protected

Definition at line 129 of file class.ilIdentifiedMultiValuesJsPositionIndexRemover.php.

Referenced by removePositionIndexLevels().

130  {
131  return current($value);
132  }
+ Here is the caller graph for this function:

◆ getIndicatorBrandedIdentifier()

ilIdentifiedMultiValuesJsPositionIndexRemover::getIndicatorBrandedIdentifier (   $identifier)
protected

Definition at line 33 of file class.ilIdentifiedMultiValuesJsPositionIndexRemover.php.

Referenced by brandIdentifiersWithIndicator().

34  {
35  return self::IDENTIFIER_INDICATOR_PREFIX . $identifier;
36  }
+ Here is the caller graph for this function:

◆ isPositionIndexLevel()

ilIdentifiedMultiValuesJsPositionIndexRemover::isPositionIndexLevel (   $val)
protected

Definition at line 92 of file class.ilIdentifiedMultiValuesJsPositionIndexRemover.php.

Referenced by removePositionIndexLevels().

93  {
94  if( !is_array($val) )
95  {
96  return false;
97  }
98 
99  if( count($val) != 1 )
100  {
101  return false;
102  }
103 
104  return true;
105  }
+ Here is the caller graph for this function:

◆ isValueIdentifier()

ilIdentifiedMultiValuesJsPositionIndexRemover::isValueIdentifier (   $key)
protected

Definition at line 107 of file class.ilIdentifiedMultiValuesJsPositionIndexRemover.php.

Referenced by cleanSubmitCommandFromPossibleIdentifierIndicators(), and removePositionIndexLevels().

108  {
109  $indicatorPrefixLength = self::IDENTIFIER_INDICATOR_PREFIX;
110 
111  if( strlen($key) <= strlen($indicatorPrefixLength) )
112  {
113  return false;
114  }
115 
116  if( substr($key, 0, strlen($indicatorPrefixLength)) != $indicatorPrefixLength )
117  {
118  return false;
119  }
120 
121  return true;
122  }
+ Here is the caller graph for this function:

◆ manipulateFormInputValues()

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

Implements ilFormValuesManipulator.

Definition at line 16 of file class.ilIdentifiedMultiValuesJsPositionIndexRemover.php.

References brandIdentifiersWithIndicator().

+ Here is the call graph for this function:

◆ manipulateFormSubmitValues()

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

Implements ilFormValuesManipulator.

Definition at line 38 of file class.ilIdentifiedMultiValuesJsPositionIndexRemover.php.

References $_POST, cleanSubmitCommandFromPossibleIdentifierIndicators(), and removePositionIndexLevels().

+ Here is the call graph for this function:

◆ removeIdentifierIndicator()

ilIdentifiedMultiValuesJsPositionIndexRemover::removeIdentifierIndicator (   $key)
protected

Definition at line 124 of file class.ilIdentifiedMultiValuesJsPositionIndexRemover.php.

Referenced by cleanSubmitCommandFromPossibleIdentifierIndicators(), and removePositionIndexLevels().

125  {
126  return str_replace(self::IDENTIFIER_INDICATOR_PREFIX, '', $key);
127  }
+ Here is the caller graph for this function:

◆ removePositionIndexLevels()

ilIdentifiedMultiValuesJsPositionIndexRemover::removePositionIndexLevels (   $values)
protected

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

References fetchPositionIndexedValue(), isPositionIndexLevel(), isValueIdentifier(), and removeIdentifierIndicator().

Referenced by manipulateFormSubmitValues(), and ilIdentifiedMultiFilesJsPositionIndexRemover\prepareMultiFilesSubmitValues().

67  {
68  foreach($values as $key => $val)
69  {
70  unset($values[$key]);
71 
72  if( $this->isValueIdentifier($key) )
73  {
74  $key = $this->removeIdentifierIndicator($key);
75 
76  if( $this->isPositionIndexLevel($val) )
77  {
78  $val = $this->fetchPositionIndexedValue($val);
79  }
80  }
81  elseif( is_array($val) )
82  {
83  $val = $this->removePositionIndexLevels($val);
84  }
85 
86  $values[$key] = $val;
87  }
88 
89  return $values;
90  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ IDENTIFIER_INDICATOR_PREFIX

const ilIdentifiedMultiValuesJsPositionIndexRemover::IDENTIFIER_INDICATOR_PREFIX = 'IDENTIFIER~'

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