2 namespace TYPO3\CMS\Backend\Form\Wizard;
32 $field = $params[
'field'];
33 if (is_array($params[
'row'][$field])) {
34 $value = $params[
'row'][$field][0];
36 $value = $params[
'row'][$field];
39 if (!empty($params[
'flexFormPath'])) {
42 if ($flexFormValue !== null) {
43 $value = $flexFormValue;
46 $itemName = $params[
'itemName'];
51 if (isset($params[
'fieldConfig'][
'range'])) {
52 $min = isset($params[
'fieldConfig'][
'range'][
'lower']) ? (int)$params[
'fieldConfig'][
'range'][
'lower'] : 0;
53 $max = isset($params[
'fieldConfig'][
'range'][
'upper']) ? (int)$params[
'fieldConfig'][
'range'][
'upper'] : 10000;
55 $elementType = $params[
'fieldConfig'][
'type'];
56 $step = $params[
'wConf'][
'step'] ?: 1;
57 $width = (int)$params[
'wConf'][
'width'] ?: 400;
59 if (isset($params[
'fieldConfig'][
'eval'])) {
61 if (in_array(
'int', $eval,
true)) {
64 }
elseif (in_array(
'double2', $eval,
true)) {
66 $value = (double)$value;
69 if (isset($params[
'fieldConfig'][
'items'])) {
72 $itemAmount = count($params[
'fieldConfig'][
'items']);
73 for (; $index < $itemAmount; ++$index) {
74 $item = $params[
'fieldConfig'][
'items'][$index];
75 if ((
string)$item[1] === $value) {
80 $max = $itemAmount -1;
84 $callbackParams = [ $params[
'table'], $params[
'row'][
'uid'], $params[
'field'], $params[
'itemName'] ];
85 $id =
'slider-' . $params[
'md5ID'];
89 .
' data-slider-id="' . $id .
'"'
90 .
' data-slider-min="' . $min .
'"'
91 .
' data-slider-max="' . $max .
'"'
92 .
' data-slider-step="' . htmlspecialchars($step) .
'"'
93 .
' data-slider-value="' . htmlspecialchars($value) .
'"'
94 .
' data-slider-value-type="' . htmlspecialchars($type) .
'"'
95 .
' data-slider-item-name="' . htmlspecialchars($itemName) .
'"'
96 .
' data-slider-element-type="' . htmlspecialchars($elementType) .
'"'
97 .
' data-slider-callback-params="' . htmlspecialchars(json_encode($callbackParams)) .
'"'
98 .
' style="width: ' . $width .
'px;"'