ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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 $brandedValues[$this->getIndicatorBrandedIdentifier($identifier)] = $val;
27 }
28
29 return $brandedValues;
30 }

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 43 of file class.ilIdentifiedMultiValuesJsPositionIndexRemover.php.

44 {
45 if (is_array($cmdArrayLevel)) {
46 $currentKey = key($cmdArrayLevel);
47 $nextLevel = current($cmdArrayLevel);
48
49 $nextLevel = $this->cleanSubmitCommandFromPossibleIdentifierIndicators($nextLevel);
50
51 unset($cmdArrayLevel[$currentKey]);
52
53 if ($this->isValueIdentifier($currentKey)) {
54 $currentKey = $this->removeIdentifierIndicator($currentKey);
55 }
56
57 $cmdArrayLevel[$currentKey] = $nextLevel;
58 }
59
60 return $cmdArrayLevel;
61 }

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 117 of file class.ilIdentifiedMultiValuesJsPositionIndexRemover.php.

118 {
119 return current($value);
120 }

Referenced by removePositionIndexLevels().

+ Here is the caller graph for this function:

◆ getIndicatorBrandedIdentifier()

ilIdentifiedMultiValuesJsPositionIndexRemover::getIndicatorBrandedIdentifier (   $identifier)
protected

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

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

Referenced by brandIdentifiersWithIndicator().

+ Here is the caller graph for this function:

◆ isPositionIndexLevel()

ilIdentifiedMultiValuesJsPositionIndexRemover::isPositionIndexLevel (   $val)
protected

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

85 {
86 if (!is_array($val)) {
87 return false;
88 }
89
90 if (count($val) != 1) {
91 return false;
92 }
93
94 return true;
95 }

Referenced by removePositionIndexLevels().

+ Here is the caller graph for this function:

◆ isValueIdentifier()

ilIdentifiedMultiValuesJsPositionIndexRemover::isValueIdentifier (   $key)
protected

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

98 {
99 $indicatorPrefixLength = self::IDENTIFIER_INDICATOR_PREFIX;
100
101 if (strlen($key) <= strlen($indicatorPrefixLength)) {
102 return false;
103 }
104
105 if (substr($key, 0, strlen($indicatorPrefixLength)) != $indicatorPrefixLength) {
106 return false;
107 }
108
109 return true;
110 }

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 37 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 112 of file class.ilIdentifiedMultiValuesJsPositionIndexRemover.php.

113 {
114 return str_replace(self::IDENTIFIER_INDICATOR_PREFIX, '', $key);
115 }

Referenced by cleanSubmitCommandFromPossibleIdentifierIndicators(), and removePositionIndexLevels().

+ Here is the caller graph for this function:

◆ removePositionIndexLevels()

ilIdentifiedMultiValuesJsPositionIndexRemover::removePositionIndexLevels (   $values)
protected

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

64 {
65 foreach ($values as $key => $val) {
66 unset($values[$key]);
67
68 if ($this->isValueIdentifier($key)) {
69 $key = $this->removeIdentifierIndicator($key);
70
71 if ($this->isPositionIndexLevel($val)) {
72 $val = $this->fetchPositionIndexedValue($val);
73 }
74 } elseif (is_array($val)) {
75 $val = $this->removePositionIndexLevels($val);
76 }
77
78 $values[$key] = $val;
79 }
80
81 return $values;
82 }

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: