[BUGFIX] Remove remaining usages of FormEngine 53/43153/5
authorMarkus Klein <markus.klein@typo3.org>
Wed, 9 Sep 2015 13:21:25 +0000 (15:21 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Wed, 9 Sep 2015 13:53:56 +0000 (15:53 +0200)
Resolves: #69626
Releases: master
Change-Id: I447ae0a8b31b98f0cf56170e31c9f9f1ae532db4
Reviewed-on: http://review.typo3.org/43153
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/backend/Classes/Form/DatabaseFileIconsHookInterface.php
typo3/sysext/backend/Classes/Form/Element/NoneElement.php
typo3/sysext/backend/Classes/Form/Element/UserElement.php
typo3/sysext/core/Classes/Resource/Hook/FileInfoHook.php
typo3/sysext/core/Classes/Resource/Service/UserStorageCapabilityService.php
typo3/sysext/core/Configuration/TCA/sys_file_storage.php

index acb2e31..02f8a73 100644 (file)
@@ -30,7 +30,7 @@ interface DatabaseFileIconsHookInterface {
         * @param string $rightbox Thumbnail view of images. Only filled if there are other types as images. This images will be shown right next to the selectorbox.
         * @param string $fName Form element name
         * @param array $uidList The array of item-uids. Have a look at \TYPO3\CMS\Backend\Form\FormEngine::dbFileIcons parameter "$itemArray
-        * @param array $additionalParams Array with additional parameters which are be available at method call. Includes $mode, $allowed, $itemArray, $onFocus, $table, $field, $uid. For more information have a look at PHPDoc-Comment of \TYPO3\CMS\Backend\Form\FormEngine::dbFileIcons
+        * @param array $additionalParams Array with additional parameters which are be available at method call. Includes $mode, $allowed, $itemArray, $onFocus, $table, $field, $uid.
         * @param object $parentObject Parent object
         * @return void
         */
index 75a05a8..bf76eeb 100644 (file)
@@ -17,7 +17,6 @@ namespace TYPO3\CMS\Backend\Form\Element;
 use TYPO3\CMS\Core\Utility\MathUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
-use TYPO3\CMS\Backend\Form\FormEngine;
 
 /**
  * Generation of TCEform elements where no rendering could be found
@@ -154,14 +153,12 @@ class NoneElement extends AbstractFormElement {
                        case 'user':
                                $func = trim($config['format.']['userFunc']);
                                if ($func) {
-                                       $dummyFormEngine = new FormEngine;
-                                       $params = array(
+                                       $params = [
                                                'value' => $itemValue,
                                                'args' => $config['format.']['userFunc'],
                                                'config' => $config,
-                                               'pObj' => $dummyFormEngine
-                                       );
-                                       $itemValue = GeneralUtility::callUserFunction($func, $params, $dummyFormEngine);
+                                       ];
+                                       $itemValue = GeneralUtility::callUserFunction($func, $params, $this);
                                }
                                break;
                        default:
index f6ce436..a2c4f9e 100644 (file)
@@ -15,10 +15,9 @@ namespace TYPO3\CMS\Backend\Form\Element;
  */
 
 use TYPO3\CMS\Core\Utility\GeneralUtility;
-use TYPO3\CMS\Backend\Form\FormEngine;
 
 /**
- * Generation of TCEform elements of the type "user"
+ * Generation of elements of the type "user"
  */
 class UserElement extends AbstractFormElement {
 
@@ -35,13 +34,11 @@ class UserElement extends AbstractFormElement {
                $parameterArray['parameters'] = isset($parameterArray['fieldConf']['config']['parameters'])
                        ? $parameterArray['fieldConf']['config']['parameters']
                        : array();
-               // Instance of FormEngine is kept here for backwards compatibility - but it is a dummy only
-               $parameterArray['pObj'] = $this;
                $resultArray = $this->initializeResultArray();
                $resultArray['html'] = GeneralUtility::callUserFunction(
                        $parameterArray['fieldConf']['config']['userFunc'],
                        $parameterArray,
-                       $dummyFormEngine
+                       $this
                );
                return $resultArray;
        }
index 6e6b4d1..3915b72 100644 (file)
@@ -26,10 +26,9 @@ class FileInfoHook {
         * User function for sys_file (element)
         *
         * @param array $propertyArray the array with additional configuration options.
-        * @param \TYPO3\CMS\Backend\Form\FormEngine $tceformsObj the TCEforms parent object
         * @return string The HTML code for the TCEform field
         */
-       public function renderFileInfo(array $propertyArray, \TYPO3\CMS\Backend\Form\FormEngine $tceformsObj) {
+       public function renderFileInfo(array $propertyArray) {
                $fileRecord = $propertyArray['row'];
                $fileObject = NULL;
                if ($fileRecord['uid'] > 0) {
@@ -43,10 +42,9 @@ class FileInfoHook {
         * User function for sys_file_meta (element)
         *
         * @param array $propertyArray the array with additional configuration options.
-        * @param \TYPO3\CMS\Backend\Form\FormEngine $tceformsObj the TCEforms parent object
         * @return string The HTML code for the TCEform field
         */
-       public function renderFileMetadataInfo(array $propertyArray, \TYPO3\CMS\Backend\Form\FormEngine $tceformsObj) {
+       public function renderFileMetadataInfo(array $propertyArray) {
                $fileMetadataRecord = $propertyArray['row'];
                $fileObject = NULL;
                if ($fileMetadataRecord['file'] > 0) {
index 5fee2ec..88d9993 100644 (file)
@@ -28,10 +28,9 @@ class UserStorageCapabilityService {
         * for storages driven by special driver such as Flickr, ...
         *
         * @param array $propertyArray the array with additional configuration options.
-        * @param \TYPO3\CMS\Backend\Form\FormEngine $tceformsObj the TCEforms parent object
         * @return string
         */
-       public function renderIsPublic(array $propertyArray, \TYPO3\CMS\Backend\Form\FormEngine $tceformsObj) {
+       public function renderIsPublic(array $propertyArray) {
 
                $isPublic = $GLOBALS['TCA']['sys_file_storage']['columns']['is_public']['config']['default'];
                $fileRecord = $propertyArray['row'];
index ddf0139..fe01972 100644 (file)
@@ -63,7 +63,7 @@ return array(
                        'config' => array(
                                'default' => TRUE,
                                'type' => 'user',
-                               'userFunc' => 'typo3/sysext/core/Classes/Resource/Service/UserStorageCapabilityService.php:TYPO3\CMS\Core\Resource\Service\UserStorageCapabilityService->renderIsPublic',
+                               'userFunc' => \TYPO3\CMS\Core\Resource\Service\UserStorageCapabilityService::class . '->renderIsPublic',
                        )
                ),
                'is_writable' => array(