| @@ 88-106 (lines=19) @@ | ||
| 85 | } |
|
| 86 | ||
| 87 | // @todo: The whole eval handling is a mess and needs refactoring |
|
| 88 | foreach ($evalList as $func) { |
|
| 89 | // @todo: This is ugly: The code should find out on it's own whether a eval definition is a |
|
| 90 | // @todo: keyword like "date", or a class reference. The global registration could be dropped then |
|
| 91 | // Pair hook to the one in \TYPO3\CMS\Core\DataHandling\DataHandler::checkValue_input_Eval() |
|
| 92 | if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tce']['formevals'][$func])) { |
|
| 93 | if (class_exists($func)) { |
|
| 94 | $evalObj = GeneralUtility::makeInstance($func); |
|
| 95 | if (method_exists($evalObj, 'deevaluateFieldValue')) { |
|
| 96 | $_params = [ |
|
| 97 | 'value' => $itemValue |
|
| 98 | ]; |
|
| 99 | $itemValue = $evalObj->deevaluateFieldValue($_params); |
|
| 100 | } |
|
| 101 | if (method_exists($evalObj, 'returnFieldJS')) { |
|
| 102 | $resultArray['additionalJavaScriptPost'][] = 'TBE_EDITOR.customEvalFunctions[' . GeneralUtility::quoteJSvalue($evalData) . '] = function(value) {' . $evalObj->returnFieldJS() . '};'; |
|
| 103 | } |
|
| 104 | } |
|
| 105 | } |
|
| 106 | } |
|
| 107 | ||
| 108 | // Load needed js library |
|
| 109 | $resultArray['requireJsModules'][] = [ |
|
| @@ 95-114 (lines=20) @@ | ||
| 92 | } |
|
| 93 | ||
| 94 | // @todo: The whole eval handling is a mess and needs refactoring |
|
| 95 | foreach ($evalList as $func) { |
|
| 96 | // @todo: This is ugly: The code should find out on it's own whether a eval definition is a |
|
| 97 | // @todo: keyword like "date", or a class reference. The global registration could be dropped then |
|
| 98 | // Pair hook to the one in \TYPO3\CMS\Core\DataHandling\DataHandler::checkValue_input_Eval() |
|
| 99 | if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tce']['formevals'][$func])) { |
|
| 100 | if (class_exists($func)) { |
|
| 101 | $evalObj = GeneralUtility::makeInstance($func); |
|
| 102 | if (method_exists($evalObj, 'deevaluateFieldValue')) { |
|
| 103 | $_params = [ |
|
| 104 | 'value' => $itemValue |
|
| 105 | ]; |
|
| 106 | $itemValue = $evalObj->deevaluateFieldValue($_params); |
|
| 107 | } |
|
| 108 | if (method_exists($evalObj, 'returnFieldJS')) { |
|
| 109 | $resultArray['additionalJavaScriptPost'][] = 'TBE_EDITOR.customEvalFunctions[' . GeneralUtility::quoteJSvalue($func) . ']' |
|
| 110 | . ' = function(value) {' . $evalObj->returnFieldJS() . '};'; |
|
| 111 | } |
|
| 112 | } |
|
| 113 | } |
|
| 114 | } |
|
| 115 | ||
| 116 | $attributes = [ |
|
| 117 | 'value' => '', |
|
| @@ 83-102 (lines=20) @@ | ||
| 80 | } |
|
| 81 | ||
| 82 | // @todo: The whole eval handling is a mess and needs refactoring |
|
| 83 | foreach ($evalList as $func) { |
|
| 84 | // @todo: This is ugly: The code should find out on it's own whether a eval definition is a |
|
| 85 | // @todo: keyword like "date", or a class reference. The global registration could be dropped then |
|
| 86 | // Pair hook to the one in \TYPO3\CMS\Core\DataHandling\DataHandler::checkValue_input_Eval() |
|
| 87 | if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tce']['formevals'][$func])) { |
|
| 88 | if (class_exists($func)) { |
|
| 89 | $evalObj = GeneralUtility::makeInstance($func); |
|
| 90 | if (method_exists($evalObj, 'deevaluateFieldValue')) { |
|
| 91 | $_params = [ |
|
| 92 | 'value' => $itemValue |
|
| 93 | ]; |
|
| 94 | $itemValue = $evalObj->deevaluateFieldValue($_params); |
|
| 95 | } |
|
| 96 | if (method_exists($evalObj, 'returnFieldJS')) { |
|
| 97 | $resultArray['additionalJavaScriptPost'][] = 'TBE_EDITOR.customEvalFunctions[' . GeneralUtility::quoteJSvalue($func) . ']' |
|
| 98 | . ' = function(value) {' . $evalObj->returnFieldJS() . '};'; |
|
| 99 | } |
|
| 100 | } |
|
| 101 | } |
|
| 102 | } |
|
| 103 | $evalList = array_filter($evalList, function ($value) { |
|
| 104 | return $value !== 'password'; |
|
| 105 | }); |
|
| @@ 112-131 (lines=20) @@ | ||
| 109 | } |
|
| 110 | ||
| 111 | // @todo: The whole eval handling is a mess and needs refactoring |
|
| 112 | foreach ($evalList as $func) { |
|
| 113 | // @todo: This is ugly: The code should find out on it's own whether a eval definition is a |
|
| 114 | // @todo: keyword like "date", or a class reference. The global registration could be dropped then |
|
| 115 | // Pair hook to the one in \TYPO3\CMS\Core\DataHandling\DataHandler::checkValue_input_Eval() |
|
| 116 | if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tce']['formevals'][$func])) { |
|
| 117 | if (class_exists($func)) { |
|
| 118 | $evalObj = GeneralUtility::makeInstance($func); |
|
| 119 | if (method_exists($evalObj, 'deevaluateFieldValue')) { |
|
| 120 | $_params = [ |
|
| 121 | 'value' => $itemValue |
|
| 122 | ]; |
|
| 123 | $itemValue = $evalObj->deevaluateFieldValue($_params); |
|
| 124 | } |
|
| 125 | if (method_exists($evalObj, 'returnFieldJS')) { |
|
| 126 | $resultArray['additionalJavaScriptPost'][] = 'TBE_EDITOR.customEvalFunctions[' . GeneralUtility::quoteJSvalue($func) . ']' |
|
| 127 | . ' = function(value) {' . $evalObj->returnFieldJS() . '};'; |
|
| 128 | } |
|
| 129 | } |
|
| 130 | } |
|
| 131 | } |
|
| 132 | ||
| 133 | $attributes = [ |
|
| 134 | 'value' => '', |
|