[TASK] Re-work/simplify copyright header in PHP files - Part 9
[Packages/TYPO3.CMS.git] / typo3 / sysext / t3editor / Classes / FormWizard.php
1 <?php
2 namespace TYPO3\CMS\T3editor;
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 /**
18 * Wizard for tceforms
19 *
20 * @author Tobias Liebig <mail_typo3@etobi.de>
21 */
22 class FormWizard {
23
24 /**
25 * Main function
26 *
27 * @param array $parameters
28 * @param object $pObj
29 * @return string|NULL
30 */
31 public function main($parameters, $pObj) {
32 $t3editor = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\T3editor\\T3editor');
33 if (!$t3editor->isEnabled()) {
34 return;
35 }
36 if ($parameters['params']['format'] !== '') {
37 $t3editor->setModeByType($parameters['params']['format']);
38 } else {
39 $t3editor->setMode(\TYPO3\CMS\T3editor\T3editor::MODE_MIXED);
40 }
41 $config = $GLOBALS['TCA'][$parameters['table']]['columns'][$parameters['field']]['config'];
42 $doc = $GLOBALS['SOBE']->doc;
43 $attributes = 'rows="' . $config['rows'] . '" ' . 'cols="' . $config['cols'] . '" ' . 'wrap="off" ' . 'style="' . $config['wizards']['t3editor']['params']['style'] . '" ' . 'onchange="' . $parameters['fieldChangeFunc']['TBE_EDITOR_fieldChanged'] . '" ';
44 $parameters['item'] = '';
45 $parameters['item'] .= $t3editor->getCodeEditor($parameters['itemName'], 'fixed-font enable-tab', $parameters['row'][$parameters['field']], $attributes, $parameters['table'] . ' > ' . $parameters['field'], array(
46 'target' => (int)$pObj->target
47 ));
48 $parameters['item'] .= $t3editor->getJavascriptCode($doc);
49 return '';
50 }
51
52 }