ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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  $brandedValues[$this->getIndicatorBrandedIdentifier($identifier)] = $val;
27  }
28 
29  return $brandedValues;
30  }
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 43 of file class.ilIdentifiedMultiValuesJsPositionIndexRemover.php.

References isValueIdentifier(), and removeIdentifierIndicator().

Referenced by manipulateFormSubmitValues().

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

Referenced by removePositionIndexLevels().

118  {
119  return current($value);
120  }
+ Here is the caller graph for this function:

◆ getIndicatorBrandedIdentifier()

ilIdentifiedMultiValuesJsPositionIndexRemover::getIndicatorBrandedIdentifier (   $identifier)
protected

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

Referenced by brandIdentifiersWithIndicator().

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

◆ isPositionIndexLevel()

ilIdentifiedMultiValuesJsPositionIndexRemover::isPositionIndexLevel (   $val)
protected

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

Referenced by removePositionIndexLevels().

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  }
+ Here is the caller graph for this function:

◆ isValueIdentifier()

ilIdentifiedMultiValuesJsPositionIndexRemover::isValueIdentifier (   $key)
protected

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

References $key.

Referenced by cleanSubmitCommandFromPossibleIdentifierIndicators(), and removePositionIndexLevels().

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  }
$key
Definition: croninfo.php:18
+ 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 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.

References $key.

Referenced by cleanSubmitCommandFromPossibleIdentifierIndicators(), and removePositionIndexLevels().

113  {
114  return str_replace(self::IDENTIFIER_INDICATOR_PREFIX, '', $key);
115  }
$key
Definition: croninfo.php:18
+ Here is the caller graph for this function:

◆ removePositionIndexLevels()

ilIdentifiedMultiValuesJsPositionIndexRemover::removePositionIndexLevels (   $values)
protected

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

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

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

64  {
65  foreach ($values as $key => $val) {
66  unset($values[$key]);
67 
68  if ($this->isValueIdentifier($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  }
$key
Definition: croninfo.php:18
+ 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: