[BUGFIX] No fields in "start field" available for conditions, condition containers...
authorAlex Kellner <alexander.kellner@in2code.de>
Thu, 8 Oct 2015 10:11:03 +0000 (12:11 +0200)
committerAlex Kellner <alexander.kellner@in2code.de>
Thu, 8 Oct 2015 10:11:03 +0000 (12:11 +0200)
Removed usage of FormEngine in UserFunc calls

Related: #70487

Classes/UserFunc/GetPowermailFields.php
Classes/UserFunc/GetPowermailFormsWithoutConditionRelation.php
ext_emconf.php

index 429fcb3..529777a 100644 (file)
@@ -30,6 +30,7 @@ namespace In2code\PowermailCond\UserFunc;
 use In2code\PowermailCond\Utility\ArrayUtility;
 use TYPO3\CMS\Backend\Form\FormEngine;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
+use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
 
 /**
  * List powermail fields in Backend for powermail_cond rules
@@ -51,11 +52,6 @@ class GetPowermailFields {
        protected $params = array();
 
        /**
-        * @var FormEngine
-        */
-       protected $formEngine = NULL;
-
-       /**
         * @var int
         */
        protected $formUid = 0;
@@ -75,11 +71,10 @@ class GetPowermailFields {
         * show all fields in the backend
         *
         * @param array $params
-        * @param FormEngine $formEngine
         * @return void
         */
-       public function getFields(array &$params, FormEngine $formEngine) {
-               $this->initialize($params, $formEngine);
+       public function getFields(array &$params) {
+               $this->initialize($params);
                $this->addFieldsToParams();
                $this->addFieldsetsToParams();
        }
@@ -220,18 +215,16 @@ class GetPowermailFields {
         * @return string
         */
        protected function getLabelFromFieldProperties(array $properties) {
-               return $this->formEngine->sL($properties['title']) . ', {' . $properties['marker'] . '}, uid' . $properties['uid'];
+               return $properties['title'] . ' , {' . $properties['marker'] . '}, uid' . $properties['uid'];
        }
 
        /**
         * @param array $params
-        * @param FormEngine $formEngine
         * @return void
         */
-       protected function initialize(array &$params, FormEngine $formEngine) {
+       protected function initialize(array &$params) {
                $this->databaseConnection = $GLOBALS['TYPO3_DB'];
                $this->params = &$params;
-               $this->formEngine = $formEngine;
                $this
                        ->setFormUid()
                        ->setDefaultFieldTypes();
index 6b85f8a..68536d7 100644 (file)
@@ -49,11 +49,6 @@ class GetPowermailFormsWithoutConditionRelation {
        protected $params = array();
 
        /**
-        * @var FormEngine
-        */
-       protected $formEngine = NULL;
-
-       /**
         * @var int
         */
        protected $currentFormUid = 0;
@@ -62,11 +57,10 @@ class GetPowermailFormsWithoutConditionRelation {
         * remove forms that are already related to a condition container
         *
         * @param array $params
-        * @param FormEngine $formEngine
         * @return void
         */
-       public function filterForms(array &$params, FormEngine $formEngine) {
-               $this->initialize($params, $formEngine);
+       public function filterForms(array &$params) {
+               $this->initialize($params);
                foreach ((array) $this->params['items'] as $key => $form) {
                        if ($this->hasFormRelatedConditionContainers((int) $form[1]) && (int) $form[1] !== $this->currentFormUid) {
                                unset($this->params['items'][$key]);
@@ -93,13 +87,11 @@ class GetPowermailFormsWithoutConditionRelation {
 
        /**
         * @param array $params
-        * @param FormEngine $formEngine
         * @return void
         */
-       protected function initialize(array &$params, FormEngine $formEngine) {
+       protected function initialize(array &$params) {
                $this->databaseConnection = $GLOBALS['TYPO3_DB'];
                $this->params = &$params;
-               $this->formEngine = $formEngine;
                $this->currentFormUid = (int) $this->params['row']['form'];
        }
 }
index 8bd3170..1b2af33 100644 (file)
@@ -45,4 +45,4 @@ $EM_CONF[$_EXTKEY] = array(
                ),
        ),
        '_md5_values_when_last_written' => '',
-);
\ No newline at end of file
+);