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

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

References getIndicatorBrandedIdentifier().

Referenced by manipulateFormInputValues().

+ 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.

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 }

References cleanSubmitCommandFromPossibleIdentifierIndicators(), isValueIdentifier(), and removeIdentifierIndicator().

Referenced by cleanSubmitCommandFromPossibleIdentifierIndicators(), and manipulateFormSubmitValues().

+ 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.

130 {
131 return current($value);
132 }

Referenced by removePositionIndexLevels().

+ Here is the caller graph for this function:

◆ getIndicatorBrandedIdentifier()

ilIdentifiedMultiValuesJsPositionIndexRemover::getIndicatorBrandedIdentifier (   $identifier)
protected

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

34 {
35 return self::IDENTIFIER_INDICATOR_PREFIX . $identifier;
36 }

Referenced by brandIdentifiersWithIndicator().

+ Here is the caller graph for this function:

◆ isPositionIndexLevel()

ilIdentifiedMultiValuesJsPositionIndexRemover::isPositionIndexLevel (   $val)
protected

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

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 }

Referenced by removePositionIndexLevels().

+ Here is the caller graph for this function:

◆ isValueIdentifier()

ilIdentifiedMultiValuesJsPositionIndexRemover::isValueIdentifier (   $key)
protected

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

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 }

References IDENTIFIER_INDICATOR_PREFIX.

Referenced by cleanSubmitCommandFromPossibleIdentifierIndicators(), and removePositionIndexLevels().

+ Here is the caller graph for this function:

◆ manipulateFormInputValues()

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

Implements ilFormValuesManipulator.

Reimplemented in ilIdentifiedMultiFilesJsPositionIndexRemover.

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.

Reimplemented in ilIdentifiedMultiFilesJsPositionIndexRemover.

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.

125 {
126 return str_replace(self::IDENTIFIER_INDICATOR_PREFIX, '', $key);
127 }

Referenced by cleanSubmitCommandFromPossibleIdentifierIndicators(), and removePositionIndexLevels().

+ Here is the caller graph for this function:

◆ removePositionIndexLevels()

ilIdentifiedMultiValuesJsPositionIndexRemover::removePositionIndexLevels (   $values)
protected

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

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 }

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

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

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