3b2ea754ce41fc218982d128825a4a6e122bc0ee
[Packages/TYPO3.CMS.git] / typo3 / sysext / backend / Classes / Form / Element / AbstractFormElement.php
1 <?php
2 namespace TYPO3\CMS\Backend\Form\Element;
3
4 /*
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16
17 use TYPO3\CMS\Backend\Form\AbstractNode;
18 use TYPO3\CMS\Backend\Form\NodeFactory;
19 use TYPO3\CMS\Backend\Form\Utility\FormEngineUtility;
20 use TYPO3\CMS\Backend\Utility\BackendUtility;
21 use TYPO3\CMS\Core\Imaging\IconFactory;
22 use TYPO3\CMS\Core\Utility\ArrayUtility;
23 use TYPO3\CMS\Core\Utility\GeneralUtility;
24 use TYPO3\CMS\Core\Utility\MathUtility;
25 use TYPO3\CMS\Lang\LanguageService;
26
27 /**
28 * Base class for form elements of FormEngine. Contains several helper methods used by single elements.
29 */
30 abstract class AbstractFormElement extends AbstractNode
31 {
32 /**
33 * Default width value for a couple of elements like text
34 *
35 * @var int
36 */
37 protected $defaultInputWidth = 30;
38
39 /**
40 * Minimum width value for a couple of elements like text
41 *
42 * @var int
43 */
44 protected $minimumInputWidth = 10;
45
46 /**
47 * Maximum width value for a couple of elements like text
48 *
49 * @var int
50 */
51 protected $maxInputWidth = 50;
52
53 /**
54 * @var IconFactory
55 */
56 protected $iconFactory;
57
58 /**
59 * Container objects give $nodeFactory down to other containers.
60 *
61 * @param NodeFactory $nodeFactory
62 * @param array $data
63 */
64 public function __construct(NodeFactory $nodeFactory, array $data)
65 {
66 parent::__construct($nodeFactory, $data);
67 $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
68 }
69
70 /**
71 * Merge field information configuration with default and render them.
72 *
73 * @return array Result array
74 */
75 protected function renderFieldInformation(): array
76 {
77 $options = $this->data;
78 $fieldInformation = $this->defaultFieldInformation;
79 $fieldInformationFromTca = $options['parameterArray']['fieldConf']['config']['fieldInformation'] ?? [];
80 ArrayUtility::mergeRecursiveWithOverrule($fieldInformation, $fieldInformationFromTca);
81 $options['renderType'] = 'fieldInformation';
82 $options['renderData']['fieldInformation'] = $fieldInformation;
83 return $this->nodeFactory->create($options)->render();
84 }
85
86 /**
87 * Merge field control configuration with default controls and render them.
88 *
89 * @return array Result array
90 */
91 protected function renderFieldControl(): array
92 {
93 $options = $this->data;
94 $fieldControl = $this->defaultFieldControl;
95 $fieldControlFromTca = $options['parameterArray']['fieldConf']['config']['fieldControl'] ?? [];
96 ArrayUtility::mergeRecursiveWithOverrule($fieldControl, $fieldControlFromTca);
97 $options['renderType'] = 'fieldControl';
98 $options['renderData']['fieldControl'] = $fieldControl;
99 return $this->nodeFactory->create($options)->render();
100 }
101
102 /**
103 * Merge field wizard configuration with default wizards and render them.
104 *
105 * @return array Result array
106 */
107 protected function renderFieldWizard(): array
108 {
109 $options = $this->data;
110 $fieldWizard = $this->defaultFieldWizard;
111 $fieldWizardFromTca = $options['parameterArray']['fieldConf']['config']['fieldWizard'] ?? [];
112 ArrayUtility::mergeRecursiveWithOverrule($fieldWizard, $fieldWizardFromTca);
113 $options['renderType'] = 'fieldWizard';
114 $options['renderData']['fieldWizard'] = $fieldWizard;
115 return $this->nodeFactory->create($options)->render();
116 }
117
118 /**
119 * Returns true if the "null value" checkbox should be rendered. This is used in some
120 * "text" based types like "text" and "input" for some renderType's.
121 *
122 * A field has eval=null set, but has no useOverridePlaceholder defined.
123 * Goal is to have a field that can distinct between NULL and empty string in the database.
124 * A checkbox and an additional hidden field will be created, both with the same name
125 * and prefixed with "control[active]". If the checkbox is set (value 1), the value from the casual
126 * input field will be written to the database. If the checkbox is not set, the hidden field
127 * transfers value=0 to DataHandler, the value of the input field will then be reset to NULL by the
128 * DataHandler at an early point in processing, so NULL will be written to DB as field value.
129 *
130 * All that only works if the field is not within flex form scope since flex forms
131 * can not store a "null" value or distinct it from "empty string".
132 *
133 * @return bool
134 */
135 protected function hasNullCheckboxButNoPlaceholder(): bool
136 {
137 $hasNullCheckboxNoPlaceholder = false;
138 $parameterArray = $this->data['parameterArray'];
139 $mode = $parameterArray['fieldConf']['config']['mode'] ?? '';
140 if (empty($this->data['flexFormDataStructureIdentifier'])
141 && !empty($parameterArray['fieldConf']['config']['eval'])
142 && GeneralUtility::inList($parameterArray['fieldConf']['config']['eval'], 'null')
143 && ($mode !== 'useOrOverridePlaceholder')
144 ) {
145 $hasNullCheckboxNoPlaceholder = true;
146 }
147 return $hasNullCheckboxNoPlaceholder;
148 }
149
150 /**
151 * Returns true if the "null value" checkbox should be rendered and the placeholder
152 * handling is enabled. This is used in some "text" based types like "text" and
153 * "input" for some renderType's.
154 *
155 * A field has useOverridePlaceholder set and null in eval and is not within a flex form.
156 * Here, a value from a deeper DB structure can be "fetched up" as value, and can also be overridden by a
157 * local value. This is used in FAL, where eg. the "title" field can have the default value from sys_file_metadata,
158 * the title field of sys_file_reference is then set to NULL. Or the "override" checkbox is set, and a string
159 * or an empty string is then written to the field of sys_file_reference.
160 * The situation is similar to hasNullCheckboxButNoPlaceholder(), but additionally a "default" value should be shown.
161 * To achieve this, again a hidden control[hidden] field is added together with a checkbox with the same name
162 * to transfer the information whether the default value should be used or not: Checkbox checked transfers 1 as
163 * value in control[active], meaning the overridden value should be used.
164 * Additionally to the casual input field, a second field is added containing the "placeholder" value. This
165 * field has no name attribute and is not transferred at all. Those two are then hidden / shown depending
166 * on the state of the above checkbox in via JS.
167 *
168 * @return bool
169 */
170 protected function hasNullCheckboxWithPlaceholder(): bool
171 {
172 $hasNullCheckboxWithPlaceholder = false;
173 $parameterArray = $this->data['parameterArray'];
174 $mode = $parameterArray['fieldConf']['config']['mode'] ?? '';
175 if (empty($this->data['flexFormDataStructureIdentifier'])
176 && !empty($parameterArray['fieldConf']['config']['eval'])
177 && GeneralUtility::inList($parameterArray['fieldConf']['config']['eval'], 'null')
178 && ($mode === 'useOrOverridePlaceholder')
179 ) {
180 $hasNullCheckboxWithPlaceholder = true;
181 }
182 return $hasNullCheckboxWithPlaceholder;
183 }
184
185 /**
186 * Format field content if 'format' is set to date, filesize, ..., user
187 *
188 * @param string $format Configuration for the display.
189 * @param string $itemValue The value to display
190 * @param array $formatOptions Format options
191 * @return string Formatted field value
192 */
193 protected function formatValue($format, $itemValue, $formatOptions = [])
194 {
195 switch ($format) {
196 case 'date':
197 if ($itemValue) {
198 $option = isset($formatOptions['option']) ? trim($formatOptions['option']) : '';
199 if ($option) {
200 if (isset($formatOptions['strftime']) && $formatOptions['strftime']) {
201 $value = strftime($option, $itemValue);
202 } else {
203 $value = date($option, $itemValue);
204 }
205 } else {
206 $value = date('d-m-Y', $itemValue);
207 }
208 } else {
209 $value = '';
210 }
211 if (isset($formatOptions['appendAge']) && $formatOptions['appendAge']) {
212 $age = BackendUtility::calcAge(
213 $GLOBALS['EXEC_TIME'] - $itemValue,
214 $this->getLanguageService()->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.minutesHoursDaysYears')
215 );
216 $value .= ' (' . $age . ')';
217 }
218 $itemValue = $value;
219 break;
220 case 'datetime':
221 // compatibility with "eval" (type "input")
222 if ($itemValue !== '' && !is_null($itemValue)) {
223 $itemValue = date('H:i d-m-Y', (int)$itemValue);
224 }
225 break;
226 case 'time':
227 // compatibility with "eval" (type "input")
228 if ($itemValue !== '' && !is_null($itemValue)) {
229 $itemValue = gmdate('H:i', (int)$itemValue);
230 }
231 break;
232 case 'timesec':
233 // compatibility with "eval" (type "input")
234 if ($itemValue !== '' && !is_null($itemValue)) {
235 $itemValue = gmdate('H:i:s', (int)$itemValue);
236 }
237 break;
238 case 'year':
239 // compatibility with "eval" (type "input")
240 if ($itemValue !== '' && !is_null($itemValue)) {
241 $itemValue = date('Y', (int)$itemValue);
242 }
243 break;
244 case 'int':
245 $baseArr = ['dec' => 'd', 'hex' => 'x', 'HEX' => 'X', 'oct' => 'o', 'bin' => 'b'];
246 $base = isset($formatOptions['base']) ? trim($formatOptions['base']) : '';
247 $format = isset($baseArr[$base]) ? $baseArr[$base] : 'd';
248 $itemValue = sprintf('%' . $format, $itemValue);
249 break;
250 case 'float':
251 // default precision
252 $precision = 2;
253 if (isset($formatOptions['precision'])) {
254 $precision = MathUtility::forceIntegerInRange($formatOptions['precision'], 1, 10, $precision);
255 }
256 $itemValue = sprintf('%.' . $precision . 'f', $itemValue);
257 break;
258 case 'number':
259 $format = isset($formatOptions['option']) ? trim($formatOptions['option']) : '';
260 $itemValue = sprintf('%' . $format, $itemValue);
261 break;
262 case 'md5':
263 $itemValue = md5($itemValue);
264 break;
265 case 'filesize':
266 // We need to cast to int here, otherwise empty values result in empty output,
267 // but we expect zero.
268 $value = GeneralUtility::formatSize((int)$itemValue);
269 if (!empty($formatOptions['appendByteSize'])) {
270 $value .= ' (' . $itemValue . ')';
271 }
272 $itemValue = $value;
273 break;
274 case 'user':
275 $func = trim($formatOptions['userFunc']);
276 if ($func) {
277 $params = [
278 'value' => $itemValue,
279 'args' => $formatOptions['userFunc'],
280 'config' => [
281 'type' => 'none',
282 'format' => $format,
283 'format.' => $formatOptions,
284 ],
285 ];
286 $itemValue = GeneralUtility::callUserFunction($func, $params, $this);
287 }
288 break;
289 default:
290 // Do nothing e.g. when $format === ''
291 }
292 return $itemValue;
293 }
294
295 /**
296 * Returns the max width in pixels for an elements like input and text
297 *
298 * @param int $size The abstract size value (1-48)
299 * @return int Maximum width in pixels
300 */
301 protected function formMaxWidth($size = 48)
302 {
303 $compensationForLargeDocuments = 1.33;
304 $compensationForFormFields = 12;
305
306 $size = round($size * $compensationForLargeDocuments);
307 return ceil($size * $compensationForFormFields);
308 }
309
310 /**
311 * @return bool TRUE if wizards are disabled on a global level
312 * @deprecated since TYPO3 v8, will be removed in TYPO3 v9 - remove together with renderWizards(), log is thrown in renderWizards()
313 */
314 protected function isWizardsDisabled()
315 {
316 return !empty($this->data['disabledWizards']);
317 }
318
319 /**
320 * Rendering wizards for form fields.
321 *
322 * Deprecated, old "wizard" API. This method will be removed in v9, but is kept for
323 * backwards compatibility. Extensions that give the item HTML in $itemKinds, trigger
324 * the legacy mode of this method which wraps calculated wizards around the given item HTML.
325 *
326 * This method is deprecated and will vanish in v9. Migrate old wizards to the "fieldWizard",
327 * "fieldInformation" and "fieldControl" API instead.
328 *
329 * @param null|array $itemKinds Array with the real item in the first value. Array in legacy mode, else null
330 * @param array $wizConf The "wizards" key from the config array for the field (from TCA)
331 * @param string $table Table name
332 * @param array $row The record array
333 * @param string $fieldName The field name
334 * @param array $PA Additional configuration array.
335 * @param string $itemName The field name
336 * @param array $specConf Special configuration if available.
337 * @param bool $RTE Whether the RTE could have been loaded.
338 * @return string|array String in legacy mode, an array with the buttons and the controls in non-legacy mode
339 * @throws \InvalidArgumentException
340 * @deprecated since TYPO3 v8, will be removed in TYPO3 v9
341 */
342 protected function renderWizards(
343 $itemKinds = null,
344 $wizConf = null,
345 $table = null,
346 $row = null,
347 $fieldName = null,
348 $PA = null,
349 $itemName = null,
350 $specConf = null,
351 $RTE = null
352 ) {
353 if ($itemKinds !== null) {
354 // Deprecation log if the old $itemsKinds array comes in containing the item HTML - all core elements
355 // deliver null here. If not null, the legacy mode of the method is enabled that wraps the calculated
356 // wizards around given item HTML.
357 GeneralUtility::logDeprecatedFunction();
358 }
359 $item = '';
360 if (is_array($itemKinds)) {
361 $item = $itemKinds[0];
362 }
363
364 if ($wizConf === null) {
365 $wizConf = $this->data['parameterArray']['fieldConf']['config']['wizards'] ?? null;
366 }
367 if ($table === null) {
368 $table = $this->data['tableName'];
369 }
370 if ($row === null) {
371 $row = $this->data['databaseRow'];
372 }
373 if ($fieldName === null) {
374 $fieldName = $this->data['fieldName'];
375 }
376 if ($PA === null) {
377 $PA = $this->data['parameterArray'];
378 }
379 if ($itemName === null) {
380 $itemName = $PA['itemFormElName'];
381 }
382 if ($RTE === null) {
383 $RTE = false;
384 if ((bool)$this->data['parameterArray']['fieldConf']['config']['enableRichtext'] === true) {
385 $RTE = true;
386 }
387 }
388
389 // Return not changed main item directly if wizards are disabled
390 if (!is_array($wizConf) || $this->isWizardsDisabled()) {
391 if ($itemKinds === null) {
392 return [
393 'fieldControl' => [],
394 'fieldWizard' => [],
395 ];
396 }
397 return $item;
398 }
399
400 $languageService = $this->getLanguageService();
401
402 $fieldChangeFunc = $PA['fieldChangeFunc'];
403 $md5ID = 'ID' . GeneralUtility::shortMD5($itemName);
404 $prefixOfFormElName = 'data[' . $table . '][' . $row['uid'] . '][' . $fieldName . ']';
405 $flexFormPath = '';
406 if (GeneralUtility::isFirstPartOfStr($PA['itemFormElName'], $prefixOfFormElName)) {
407 $flexFormPath = str_replace('][', '/', substr($PA['itemFormElName'], strlen($prefixOfFormElName) + 1, -1));
408 }
409
410 // Add a suffix-value if the item is a selector box with renderType "selectSingleBox":
411 if ($PA['fieldConf']['config']['type'] === 'select' && (int)$PA['fieldConf']['config']['maxitems'] > 1 && $PA['fieldConf']['config']['renderType'] === 'selectSingleBox') {
412 $itemName .= '[]';
413 }
414
415 $buttonWizards = [];
416 $otherWizards = [];
417 foreach ($wizConf as $wizardIdentifier => $wizardConfiguration) {
418 if (!isset($wizardConfiguration['module']['name']) && isset($wizardConfiguration['script'])) {
419 throw new \InvalidArgumentException('The way registering a wizard in TCA has changed in 6.2 and was removed in CMS 7. '
420 . 'Please set module[name]=module_name instead of using script=path/to/script.php in your TCA. ', 1437750231);
421 }
422
423 // If an identifier starts with "_", this is a configuration option like _POSITION and not a wizard
424 if ($wizardIdentifier[0] === '_') {
425 continue;
426 }
427
428 // Sanitize wizard type
429 $wizardConfiguration['type'] = (string)$wizardConfiguration['type'];
430
431 // Wizards can be shown based on selected "type" of record. If this is the case, the wizard configuration
432 // is set to enableByTypeConfig = 1, and the wizardIdentifier is found in $wizardsEnabledByType
433 $wizardIsEnabled = true;
434 // Disable if wizard is for RTE fields only and the handled field is no RTE field or RTE can not be loaded
435 if (isset($wizardConfiguration['RTEonly']) && (bool)$wizardConfiguration['RTEonly'] && !$RTE) {
436 $wizardIsEnabled = false;
437 }
438 // Disable if wizard is for not-new records only and we're handling a new record
439 if (isset($wizardConfiguration['notNewRecords']) && $wizardConfiguration['notNewRecords'] && !MathUtility::canBeInterpretedAsInteger($row['uid'])) {
440 $wizardIsEnabled = false;
441 }
442 // Wizard types script, colorbox and popup must contain a module name configuration
443 if (!isset($wizardConfiguration['module']['name']) && in_array($wizardConfiguration['type'], ['script', 'colorbox', 'popup'], true)) {
444 $wizardIsEnabled = false;
445 }
446
447 if (!$wizardIsEnabled) {
448 continue;
449 }
450
451 // Title / icon:
452 $iTitle = htmlspecialchars($languageService->sL($wizardConfiguration['title']));
453 if (isset($wizardConfiguration['icon'])) {
454 $icon = FormEngineUtility::getIconHtml($wizardConfiguration['icon'], $iTitle, $iTitle);
455 } else {
456 $icon = $iTitle;
457 }
458
459 switch ($wizardConfiguration['type']) {
460 case 'userFunc':
461 GeneralUtility::logDeprecatedFunction();
462 $params = [];
463 $params['params'] = $wizardConfiguration['params'];
464 $params['exampleImg'] = $wizardConfiguration['exampleImg'];
465 $params['table'] = $table;
466 $params['uid'] = $row['uid'];
467 $params['pid'] = $row['pid'];
468 $params['field'] = $fieldName;
469 $params['flexFormPath'] = $flexFormPath;
470 $params['md5ID'] = $md5ID;
471 $params['returnUrl'] = $this->data['returnUrl'];
472
473 $params['formName'] = 'editform';
474 $params['itemName'] = $itemName;
475 $params['hmac'] = GeneralUtility::hmac($params['formName'] . $params['itemName'], 'wizard_js');
476 $params['fieldChangeFunc'] = $fieldChangeFunc;
477 $params['fieldChangeFuncHash'] = GeneralUtility::hmac(serialize($fieldChangeFunc));
478
479 $params['item'] = $item;
480 $params['icon'] = $icon;
481 $params['iTitle'] = $iTitle;
482 $params['wConf'] = $wizardConfiguration;
483 $params['row'] = $row;
484 $otherWizards[] = GeneralUtility::callUserFunction($wizardConfiguration['userFunc'], $params, $this);
485 break;
486
487 case 'script':
488 GeneralUtility::logDeprecatedFunction();
489 $params = [];
490 $params['params'] = $wizardConfiguration['params'];
491 $params['exampleImg'] = $wizardConfiguration['exampleImg'];
492 $params['table'] = $table;
493 $params['uid'] = $row['uid'];
494 $params['pid'] = $row['pid'];
495 $params['field'] = $fieldName;
496 $params['flexFormPath'] = $flexFormPath;
497 $params['md5ID'] = $md5ID;
498 $params['returnUrl'] = $this->data['returnUrl'];
499
500 // Resolving script filename and setting URL.
501 $urlParameters = [];
502 if (isset($wizardConfiguration['module']['urlParameters']) && is_array($wizardConfiguration['module']['urlParameters'])) {
503 $urlParameters = $wizardConfiguration['module']['urlParameters'];
504 }
505 $wScript = BackendUtility::getModuleUrl($wizardConfiguration['module']['name'], $urlParameters);
506 $url = $wScript . (strstr($wScript, '?') ? '' : '?') . GeneralUtility::implodeArrayForUrl('', ['P' => $params]);
507 $buttonWizards[] =
508 '<a class="btn btn-default" href="' . htmlspecialchars($url) . '" onclick="this.blur(); return !TBE_EDITOR.isFormChanged();">'
509 . $icon .
510 '</a>';
511 break;
512
513 case 'popup':
514 GeneralUtility::logDeprecatedFunction();
515 $params = [];
516 $params['params'] = $wizardConfiguration['params'];
517 $params['exampleImg'] = $wizardConfiguration['exampleImg'];
518 $params['table'] = $table;
519 $params['uid'] = $row['uid'];
520 $params['pid'] = $row['pid'];
521 $params['field'] = $fieldName;
522 $params['flexFormPath'] = $flexFormPath;
523 $params['md5ID'] = $md5ID;
524 $params['returnUrl'] = $this->data['returnUrl'];
525
526 $params['formName'] = 'editform';
527 $params['itemName'] = $itemName;
528 $params['hmac'] = GeneralUtility::hmac($params['formName'] . $params['itemName'], 'wizard_js');
529 $params['fieldChangeFunc'] = $fieldChangeFunc;
530 $params['fieldChangeFuncHash'] = GeneralUtility::hmac(serialize($fieldChangeFunc));
531
532 // Resolving script filename and setting URL.
533 $urlParameters = [];
534 if (isset($wizardConfiguration['module']['urlParameters']) && is_array($wizardConfiguration['module']['urlParameters'])) {
535 $urlParameters = $wizardConfiguration['module']['urlParameters'];
536 }
537 $wScript = BackendUtility::getModuleUrl($wizardConfiguration['module']['name'], $urlParameters);
538 $url = $wScript . (strstr($wScript, '?') ? '' : '?') . GeneralUtility::implodeArrayForUrl('', ['P' => $params]);
539
540 $onlyIfSelectedJS = '';
541 if (isset($wizardConfiguration['popup_onlyOpenIfSelected']) && $wizardConfiguration['popup_onlyOpenIfSelected']) {
542 $notSelectedText = $languageService->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:mess.noSelItemForEdit');
543 $onlyIfSelectedJS =
544 'if (!TBE_EDITOR.curSelected(' . GeneralUtility::quoteJSvalue($itemName) . ')){' .
545 'alert(' . GeneralUtility::quoteJSvalue($notSelectedText) . ');' .
546 'return false;' .
547 '}';
548 }
549 $aOnClick =
550 'this.blur();' .
551 $onlyIfSelectedJS .
552 'vHWin=window.open(' . GeneralUtility::quoteJSvalue($url) . '+\'&P[currentValue]=\'+TBE_EDITOR.rawurlencode(' .
553 'document.editform[' . GeneralUtility::quoteJSvalue($itemName) . '].value,300' .
554 ')' .
555 '+\'&P[currentSelectedValues]=\'+TBE_EDITOR.curSelected(' . GeneralUtility::quoteJSvalue($itemName) . '),' .
556 GeneralUtility::quoteJSvalue('popUp' . $md5ID) . ',' .
557 GeneralUtility::quoteJSvalue($wizardConfiguration['JSopenParams']) .
558 ');' .
559 'vHWin.focus();' .
560 'return false;';
561
562 $buttonWizards[] =
563 '<a class="btn btn-default" href="#" onclick="' . htmlspecialchars($aOnClick) . '">' .
564 $icon .
565 '</a>';
566 break;
567 }
568 }
569
570 if ($itemKinds === null) {
571 // Return an array with the two wizard types directly if the legacy mode
572 // is not enabled.
573 return [
574 'fieldControl' => $buttonWizards,
575 'fieldWizard' => $otherWizards,
576 ];
577 }
578
579 // For each rendered wizard, put them together around the item.
580 if (!empty($buttonWizards) || !empty($otherWizards)) {
581 $innerContent = '';
582 if (!empty($buttonWizards)) {
583 $innerContent .= '<div class="btn-group' . ($wizConf['_VERTICAL'] ? ' btn-group-vertical' : '') . '">' . implode('', $buttonWizards) . '</div>';
584 }
585 $innerContent .= implode(' ', $otherWizards);
586
587 // Position
588 if ($wizConf['_POSITION'] === 'left') {
589 $innerContent = '<div class="form-wizards-items-aside">' . $innerContent . '</div><div class="form-wizards-element">' . $item . '</div>';
590 } elseif ($wizConf['_POSITION'] === 'top') {
591 $innerContent = '<div class="form-wizards-items-top">' . $innerContent . '</div><div class="form-wizards-element">' . $item . '</div>';
592 } elseif ($wizConf['_POSITION'] === 'bottom') {
593 $innerContent = '<div class="form-wizards-element">' . $item . '</div><div class="form-wizards-items-bottom">' . $innerContent . '</div>';
594 } else {
595 $innerContent = '<div class="form-wizards-element">' . $item . '</div><div class="form-wizards-items-aside">' . $innerContent . '</div>';
596 }
597 $item = '
598 <div class="form-wizards-wrap">
599 ' . $innerContent . '
600 </div>';
601 }
602
603 return $item;
604 }
605
606 /**
607 * @return LanguageService
608 */
609 protected function getLanguageService()
610 {
611 return $GLOBALS['LANG'];
612 }
613 }