Created
May 20, 2015 17:17
-
-
Save twaurisch/a55a3c836c0600e683e0 to your computer and use it in GitHub Desktop.
Revisions
-
twaurisch created this gist
May 20, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,41 @@ <?php namespace BTU\BtuDevlib\Xclass\Backend\Form; use TYPO3\CMS\Core\Utility\GeneralUtility; class FormEngine extends \TYPO3\CMS\Backend\Form\FormEngine { /** * Backport from TYPO3 7.x * Changeset: 9a6a133c9aa3db73ba9983a9cdd1cd28467de03c * Ticket: #24906 * * @param string $table The table name of the record * @param string $field The field name which this element is supposed to edit * @param array $row The record data array where the value(s) for the field can be found * @param array $PA An array with additional configuration options. * @return string The HTML code for the TCEform field * @deprecated since 6.2, will be removed two versions later */ public function getSingleField_typeText($table, $field, $row, &$PA) { $item = parent::getSingleField_typeText($table, $field, $row, $PA); $delim = '>'; $config = $PA['fieldConf']['config']; $maxlengthAttribute = ''; if (isset($config['max']) && (int)$config['max'] > 0) { $maxlengthAttribute = ' maxlength="' . (int)$config['max'] . '"'; $splitTag = GeneralUtility::trimExplode($delim, $item, FALSE, 2); if (stripos($splitTag[0], 'maxlength') === FALSE) { $splitTag[0] = $splitTag[0] . $maxlengthAttribute; $item = implode($delim, $splitTag); } } // Return field HTML: return $item; } } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ <?php if (!defined ('TYPO3_MODE')) { die ('Access denied.'); } $boot = function($packageKey) { // ... if (version_compare(TYPO3_branch, '7.0', '<') === TRUE) { $GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects']['TYPO3\CMS\Backend\Form\FormEngine'] = array( 'className' => 'BTU\BtuDevlib\Xclass\Backend\Form\FormEngine' ); } // ... }; $boot($_EXTKEY); unset($boot);