2 namespace TYPO3\CMS\Backend\Form\Element;
40 $table = $this->data[
'tableName'];
41 $fieldName = $this->data[
'fieldName'];
42 $row = $this->data[
'databaseRow'];
43 $parameterArray = $this->data[
'parameterArray'];
47 $config = $parameterArray[
'fieldConf'][
'config'];
52 $attributes = array();
59 'timesec' =>
'%H:%M:%S'
61 if (
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'USdateFormat']) {
62 $dateFormats[
'date'] =
'%m-%d-%Y';
64 $dateFormats[
'datetime'] = $dateFormats[
'time'] .
' ' . $dateFormats[
'date'];
65 $dateFormats[
'datetimesec'] = $dateFormats[
'timesec'] .
' ' . $dateFormats[
'date'];
68 if ($config[
'readOnly']) {
69 $itemFormElValue = $parameterArray[
'itemFormElValue'];
70 if (in_array(
'date', $evalList)) {
71 $config[
'format'] =
'date';
72 }
elseif (in_array(
'datetime', $evalList)) {
73 $config[
'format'] =
'datetime';
74 }
elseif (in_array(
'time', $evalList)) {
75 $config[
'format'] =
'time';
77 if (in_array(
'password', $evalList)) {
78 $itemFormElValue = $itemFormElValue ?
'*********' :
'';
81 $options[
'parameterArray'] = array(
85 'itemFormElValue' => $itemFormElValue,
87 $options[
'renderType'] =
'none';
88 return $this->nodeFactory->create($options)->render();
91 if (in_array(
'datetime', $evalList,
true)
92 || in_array(
'date', $evalList)) {
93 $classes[] =
't3js-datetimepicker';
95 if (in_array(
'datetime', $evalList)) {
96 $attributes[
'data-date-type'] =
'datetime';
97 $dateFormat = $dateFormats[
'datetime'];
98 }
elseif (in_array(
'date', $evalList)) {
99 $attributes[
'data-date-type'] =
'date';
100 $dateFormat = $dateFormats[
'date'];
102 if ($parameterArray[
'itemFormElValue'] > 0) {
103 $parameterArray[
'itemFormElValue'] += date(
'Z', $parameterArray[
'itemFormElValue']);
105 if (isset($config[
'range'][
'lower'])) {
106 $attributes[
'data-date-minDate'] = (int)$config[
'range'][
'lower'];
108 if (isset($config[
'range'][
'upper'])) {
109 $attributes[
'data-date-maxDate'] = (int)$config[
'range'][
'upper'];
111 }
elseif (in_array(
'time', $evalList)) {
112 $dateFormat = $dateFormats[
'time'];
114 $classes[] =
't3js-datetimepicker';
115 $attributes[
'data-date-type'] =
'time';
116 }
elseif (in_array(
'timesec', $evalList)) {
117 $dateFormat = $dateFormats[
'timesec'];
119 $classes[] =
't3js-datetimepicker';
120 $attributes[
'data-date-type'] =
'timesec';
124 foreach ($evalList as $func) {
133 if (isset(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'tce'][
'formevals'][$func])) {
134 if (class_exists($func)) {
136 if (method_exists($evalObj,
'deevaluateFieldValue')) {
138 'value' => $parameterArray[
'itemFormElValue']
140 $parameterArray[
'itemFormElValue'] = $evalObj->deevaluateFieldValue($_params);
147 'field' => $parameterArray[
'itemFormElName'],
148 'evalList' => implode(
',', $evalList),
149 'is_in' => trim($config[
'is_in']),
152 $classes[] =
'form-control';
153 $classes[] =
't3js-clearable';
154 $classes[] =
'hasDefaultValue';
158 $attributes[
'data-formengine-input-params'] = json_encode($paramsList);
159 $attributes[
'data-formengine-input-name'] = htmlspecialchars($parameterArray[
'itemFormElName']);
161 $attributes[
'value'] =
'';
162 if (isset($config[
'max']) && (
int)$config[
'max'] > 0) {
163 $attributes[
'maxlength'] = (int)$config[
'max'];
165 if (!empty($classes)) {
166 $attributes[
'class'] = implode(
' ', $classes);
170 if (!empty($config[
'placeholder'])) {
171 $attributes[
'placeholder'] = trim($config[
'placeholder']);
174 if (isset($config[
'autocomplete'])) {
175 $attributes[
'autocomplete'] = empty($config[
'autocomplete']) ?
'off' :
'on';
179 $attributeString =
'';
180 foreach ($attributes as $attributeName => $attributeValue) {
181 $attributeString .=
' ' . $attributeName .
'="' . htmlspecialchars($attributeValue) .
'"';
187 . $parameterArray[
'onFocus'] .
' />';
190 $html .=
'<input type="hidden" name="' . $parameterArray[
'itemFormElName'] .
'" value="' . htmlspecialchars($parameterArray[
'itemFormElValue']) .
'" />';
194 foreach ($evalList as $evalData) {
195 if (isset(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'tce'][
'formevals'][$evalData])) {
196 if (class_exists($evalData)) {
198 if (method_exists($evalObj,
'returnFieldJS')) {
199 $resultArray[
'extJSCODE'] .= LF .
'TBE_EDITOR.customEvalFunctions[' .
GeneralUtility::quoteJSvalue($evalData) .
'] = function(value) {' . $evalObj->returnFieldJS() .
'}';
208 <div class="input-group">
210 <span class="input-group-btn">
211 <label class="btn btn-default" for="' . $attributes[
'id'] .
'">
219 $html = $this->renderWizards(
226 $parameterArray[
'itemFormElName'],
232 $html =
'<div class="form-control-wrap"' . ($width ?
' style="max-width: ' . $width .
'px"' :
'') .
'>' . $html .
'</div>';
233 $resultArray[
'html'] = $html;