Refactoring Step 1 - Namespaces
authorAlex Kellner <alexander.kellner@in2code.de>
Thu, 15 May 2014 10:26:14 +0000 (12:26 +0200)
committerAlex Kellner <alexander.kellner@in2code.de>
Thu, 15 May 2014 10:26:14 +0000 (12:26 +0200)
29 files changed:
Classes/Domain/Validator/MandatoryValidator.php [deleted file]
Classes/Domain/Validator/StringValidator.php [new file with mode: 0644]
Classes/Utility/Div.php
Classes/Utility/Eid/ClearSessionEid.php [new file with mode: 0644]
Classes/Utility/Eid/DeRequiredFieldEid.php [new file with mode: 0644]
Classes/Utility/Eid/DeRequiredFieldsEid.php [new file with mode: 0644]
Classes/Utility/Eid/DebugSessionEid.php [new file with mode: 0644]
Classes/Utility/Eid/GetFieldlistEid.php [new file with mode: 0644]
Classes/Utility/Eid/ReadSessionEid.php [new file with mode: 0644]
Classes/Utility/Eid/RequiredFieldEid.php [new file with mode: 0644]
Classes/Utility/Eid/SaveInSessionEid.php [new file with mode: 0644]
Classes/Utility/EidClearSession.php [deleted file]
Classes/Utility/EidDeRequiredField.php [deleted file]
Classes/Utility/EidDeRequiredFields.php [deleted file]
Classes/Utility/EidDebugSession.php [deleted file]
Classes/Utility/EidGetFieldlist.php [deleted file]
Classes/Utility/EidReadSession.php [deleted file]
Classes/Utility/EidRequiredField.php [deleted file]
Classes/Utility/EidSaveInSession.php [deleted file]
Classes/Utility/FieldlistingBackend.php [deleted file]
Classes/Utility/Tca/FieldlistingBackend.php [new file with mode: 0644]
Configuration/TCA/Condition.php
Configuration/TCA/Rule.php
Configuration/TypoScript/setup.txt
Resources/Public/Js/PowermailCond.js
ext_emconf.php
ext_localconf.php
ext_tables.php
ext_typoscript_setup.txt [deleted file]

diff --git a/Classes/Domain/Validator/MandatoryValidator.php b/Classes/Domain/Validator/MandatoryValidator.php
deleted file mode 100644 (file)
index 06e8e38..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-<?php
-
-/**
- * Class Tx_PowermailCond_Domain_Validator_MandatoryValidator
- */
-class Tx_PowermailCond_Domain_Validator_MandatoryValidator extends Tx_Powermail_Domain_Validator_MandatoryValidator {
-
-       /**
-        * Validation of given Params
-        *
-        * @param $params
-        * @return bool
-        */
-       public function isValid($params) {
-               $gp = t3lib_div::_GP('tx_powermail_pi1');
-               $formUid = $gp['form'];
-               $form = $this->formsRepository->findByUid($formUid);
-               if (!method_exists($form, 'getPages')) {
-                       return $this->isValid;
-               }
-
-               /* @var $divCond Tx_PowermailCond_Utility_Div */
-               $divCond = t3lib_div::makeInstance('Tx_PowermailCond_Utility_Div');
-               $sessionValues = $divCond->getAllSessionValuesFromForm($formUid, 'deRequiredFields');
-
-               // every page in current form
-               foreach ($form->getPages() as $page) {
-                       // every field in current page
-                       foreach ($page->getFields() as $field) {
-
-                               // if not a mandatory field
-                               if (!$field->getMandatory()) {
-                                       continue;
-                               }
-
-                               // set error
-                               if (is_array($params[$field->getUid()])) {
-                                       $empty = TRUE;
-                                       foreach ($params[$field->getUid()] as $value) {
-                                               if (strlen($value)) {
-                                                       $empty = FALSE;
-                                                       break;
-                                               }
-                                       }
-                                       if ($empty) {
-                                               $this->addError('mandatory', $field->getUid());
-                                               $this->isValid = FALSE;
-                                       }
-                               } else {
-                                       // extend this line for powermail_cond
-                                       if (!strlen($params[$field->getUid()]) && !isset($sessionValues['field_' . $field->getUid()])) {
-                                               $this->addError('mandatory', $field->getUid());
-                                               $this->isValid = FALSE;
-                                       }
-                               }
-                       }
-               }
-
-               return $this->isValid;
-       }
-}
\ No newline at end of file
diff --git a/Classes/Domain/Validator/StringValidator.php b/Classes/Domain/Validator/StringValidator.php
new file mode 100644 (file)
index 0000000..fb4c258
--- /dev/null
@@ -0,0 +1,76 @@
+<?php
+namespace In2code\PowermailCond\Domain\Model\Validator;
+
+/**
+ * Class StringValidator
+ */
+class StringValidator extends \In2code\Powermail\Domain\Validator\StringValidator {
+
+       /**
+        * Mandatory Check
+        *
+        * @param \mixed $value Fieldvalue from user
+        * @return bool
+        */
+       protected function validateMandatory($value) {
+               // stop mandatory check
+               if (1) {
+                       return TRUE;
+               }
+               return parent::validateMandatory($value);
+       }
+
+       /**
+        * Validation of given Params
+        *
+        * @param $params
+        * @return bool
+        */
+       public function isValid($params) {
+               $gp = GeneralUtility::_GP('tx_powermail_pi1');
+               $formUid = $gp['form'];
+               $form = $this->formsRepository->findByUid($formUid);
+               if (!method_exists($form, 'getPages')) {
+                       return $this->isValid;
+               }
+
+               /* @var $divCond \In2code\PowermailCond\Utility\Div */
+               $divCond = GeneralUtility::makeInstance('\In2code\PowermailCond\Utility\Div');
+               $sessionValues = $divCond->getAllSessionValuesFromForm($formUid, 'deRequiredFields');
+
+               // every page in current form
+               foreach ($form->getPages() as $page) {
+                       // every field in current page
+                       foreach ($page->getFields() as $field) {
+
+                               // if not a mandatory field
+                               if (!$field->getMandatory()) {
+                                       continue;
+                               }
+
+                               // set error
+                               if (is_array($params[$field->getUid()])) {
+                                       $empty = TRUE;
+                                       foreach ($params[$field->getUid()] as $value) {
+                                               if (strlen($value)) {
+                                                       $empty = FALSE;
+                                                       break;
+                                               }
+                                       }
+                                       if ($empty) {
+                                               $this->addError('mandatory', $field->getUid());
+                                               $this->isValid = FALSE;
+                                       }
+                               } else {
+                                       // extend this line for powermail_cond
+                                       if (!strlen($params[$field->getUid()]) && !isset($sessionValues['field_' . $field->getUid()])) {
+                                               $this->addError('mandatory', $field->getUid());
+                                               $this->isValid = FALSE;
+                                       }
+                               }
+                       }
+               }
+
+               return $this->isValid;
+       }
+}
\ No newline at end of file
index 0c9d9e6..9356c0d 100644 (file)
@@ -1,4 +1,6 @@
 <?php
+namespace In2code\PowermailCond\Utility;
+
 /***************************************************************
  *  Copyright notice
  *
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
 
-
 /**
  * Div is a class for a collection of misc functions
  *
  * @package powermail_cond
- * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
+ * @license http://www.gnu.org/licenses/lgpl.html
+ *                     GNU Lesser General Public License, version 3 or later
  */
-class Tx_PowermailCond_Utility_Div {
+class Div {
 
        /**
         * Extension Key
@@ -68,7 +70,7 @@ class Tx_PowermailCond_Utility_Div {
         * get condition as array from current page
         *
         * @param int $formUid
-        * @param tslib_cObj $cObj
+        * @param \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer $cObj
         * @return array $arr: Array with all conditions of the current page
         */
        public function getConditionsFromForm($formUid, $cObj) {
diff --git a/Classes/Utility/Eid/ClearSessionEid.php b/Classes/Utility/Eid/ClearSessionEid.php
new file mode 100644 (file)
index 0000000..cccb67f
--- /dev/null
@@ -0,0 +1,96 @@
+<?php
+namespace In2code\PowermailCond\Utility\Eid;
+
+use \TYPO3\CMS\Core\Utility\GeneralUtility;
+
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2014 Alex Kellner <alexander.kellner@in2code.de>, in2code.de
+ *
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * This class is for reading values from session
+ *
+ * @author Alex Kellner <alexander.kellner@in2code.de>, in2code.de
+ * @package TYPO3
+ * @subpackage EidClearSession
+ */
+class ClearSessionEid {
+
+       /**
+        * The extension key
+        *
+        * @var string
+        */
+       public $extKey = 'powermail_cond';
+
+       /**
+        * Prefix Id
+        *
+        * @var string
+        */
+       public $prefixId = 'tx_powermailcond_pi1';
+
+       /**
+        * @var \In2code\PowermailCond\Utility\Div
+        */
+       protected $div;
+
+       /**
+        * Read values from session - example: 18:braun;17:rot;12:xd;11:fc;
+        *
+        * @return void
+        */
+       public function main() {
+               $GLOBALS['TSFE']->sesData = \TYPO3\CMS\Frontend\Utility\EidUtility::initFeUser();
+               $piVars = GeneralUtility::_GP($this->prefixId);
+               $form = intval($piVars['form']);
+               $this->div->cleanfullSession($form, 'fieldSession');
+               $this->div->cleanfullSession($form, 'deRequiredFields');
+       }
+
+       /**
+        * Initialize eID
+        */
+       public function __construct($TYPO3_CONF_VARS) {
+               $userObj = \TYPO3\CMS\Frontend\Utility\EidUtility::initFeUser();
+               $GLOBALS['TSFE'] = GeneralUtility::makeInstance(
+                       '\TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController',
+                       $TYPO3_CONF_VARS,
+                       32,
+                       0,
+                       TRUE
+               );
+               $GLOBALS['TSFE']->connectToDB();
+               $GLOBALS['TSFE']->fe_user = $userObj;
+               $GLOBALS['TSFE']->id = GeneralUtility::_GET('id');
+               $GLOBALS['TSFE']->determineId();
+               $GLOBALS['TSFE']->getCompressedTCarray();
+               $GLOBALS['TSFE']->initTemplate();
+               $GLOBALS['TSFE']->getConfigArray();
+               $GLOBALS['TSFE']->includeTCA();
+
+               $this->div = GeneralUtility::makeInstance('\In2code\PowermailCond\Utility\Div');
+       }
+}
+$eid = GeneralUtility::makeInstance('In2code\PowermailCond\Utility\Eid\ClearSessionEid', $GLOBALS['TYPO3_CONF_VARS']);
+echo $eid->main();
\ No newline at end of file
diff --git a/Classes/Utility/Eid/DeRequiredFieldEid.php b/Classes/Utility/Eid/DeRequiredFieldEid.php
new file mode 100644 (file)
index 0000000..deebcc6
--- /dev/null
@@ -0,0 +1,100 @@
+<?php
+namespace In2code\PowermailCond\Utility\Eid;
+
+use \TYPO3\CMS\Core\Utility\GeneralUtility;
+
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2014 Alex Kellner <alexander.kellner@in2code.de>, in2code.de
+ *
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Store fields in session which should not be mandatory any more
+ *
+ * @author Alex Kellner <alexander.kellner@in2code.de>, in2code.de
+ * @package TYPO3
+ * @subpackage DeRequiredFieldEid
+ */
+class DeRequiredFieldEid {
+
+       /**
+        * Prefix Id
+        *
+        * @var string
+        */
+       public $prefixId = 'tx_powermailcond_pi1';
+
+       /**
+        * @var \In2code\PowermailCond\Utility\Div
+        */
+       protected $div;
+
+       /**
+        * save field in session to be stored for non-mandatory fields
+        *
+        * @return int Field Uid which was disabled
+        */
+       public function main() {
+               /** @var \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer $cObj */
+               $cObj = GeneralUtility::makeInstance('\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer');
+               $piVars = GeneralUtility::_GP($this->prefixId);
+               $formUid = intval($piVars['formUid']);
+               $fieldUid = intval($piVars['fieldUid']);
+               $conditions = $this->div->getConditionsFromForm($formUid, $cObj);
+
+               // only if this field was defined as targetField in conditions
+               if (array_key_exists($fieldUid, $conditions)) {
+                       // save single value in session
+                       $this->div->saveValueToSession('', $formUid, $fieldUid, 'deRequiredFields');
+                       return $fieldUid;
+               }
+
+               return 0;
+       }
+
+       /**
+        * Initialize eID
+        */
+       public function __construct($TYPO3_CONF_VARS) {
+               $userObj = \TYPO3\CMS\Frontend\Utility\EidUtility::initFeUser();
+               $GLOBALS['TSFE'] = GeneralUtility::makeInstance(
+                       '\TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController',
+                       $TYPO3_CONF_VARS,
+                       32,
+                       0,
+                       TRUE
+               );
+               $GLOBALS['TSFE']->connectToDB();
+               $GLOBALS['TSFE']->fe_user = $userObj;
+               $GLOBALS['TSFE']->id = GeneralUtility::_GET('id');
+               $GLOBALS['TSFE']->determineId();
+               $GLOBALS['TSFE']->getCompressedTCarray();
+               $GLOBALS['TSFE']->initTemplate();
+               $GLOBALS['TSFE']->getConfigArray();
+               $GLOBALS['TSFE']->includeTCA();
+
+               $this->div = GeneralUtility::makeInstance('\In2code\PowermailCond\Utility\Div');
+       }
+}
+
+$eid = GeneralUtility::makeInstance('In2code\PowermailCond\Utility\Eid\DeRequiredFieldEid', $GLOBALS['TYPO3_CONF_VARS']);
+echo $eid->main();
\ No newline at end of file
diff --git a/Classes/Utility/Eid/DeRequiredFieldsEid.php b/Classes/Utility/Eid/DeRequiredFieldsEid.php
new file mode 100644 (file)
index 0000000..cd95d04
--- /dev/null
@@ -0,0 +1,101 @@
+<?php
+namespace In2code\PowermailCond\Utility\Eid;
+
+use \TYPO3\CMS\Core\Utility\GeneralUtility;
+
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2014 Alex Kellner <alexander.kellner@in2code.de>, in2code.de
+ *
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Store fields in session which should not be mandatory any more
+ *
+ * @author Alex Kellner <alexander.kellner@in2code.de>, in2code.de
+ * @package TYPO3
+ * @subpackage DeRequiredFieldsEid
+ */
+class DeRequiredFieldsEid {
+
+       /**
+        * Prefix Id
+        *
+        * @var string
+        */
+       public $prefixId = 'tx_powermailcond_pi1';
+
+       /**
+        * @var \In2code\PowermailCond\Utility\Div
+        */
+       protected $div;
+
+       /**
+        * save field in session to be stored for non-mandatory fields
+        *
+        * @return int Field Uid which was disabled
+        */
+       public function main() {
+               /** @var \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer $cObj */
+               $cObj = GeneralUtility::makeInstance('\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer');
+               $piVars = GeneralUtility::_GP($this->prefixId);
+               $formUid = intval($piVars['formUid']);
+               $fieldUids = explode(',', $piVars['fieldUids']);
+               $conditions = $this->div->getConditionsFromForm($formUid, $cObj);
+
+               foreach ($fieldUids as $fieldUid) {
+                       // only if this field was defined as targetField in conditions
+                       if (array_key_exists($fieldUid, $conditions)) {
+                               // save single value in session
+                               $this->div->saveValueToSession('', $formUid, $fieldUid, 'deRequiredFields');
+                       }
+               }
+
+               return htmlspecialchars($piVars['fieldUids']);
+       }
+
+       /**
+        * Initialize eID
+        */
+       public function __construct($TYPO3_CONF_VARS) {
+               $userObj = \TYPO3\CMS\Frontend\Utility\EidUtility::initFeUser();
+               $GLOBALS['TSFE'] = GeneralUtility::makeInstance(
+                       '\TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController',
+                       $TYPO3_CONF_VARS,
+                       32,
+                       0,
+                       TRUE
+               );
+               $GLOBALS['TSFE']->connectToDB();
+               $GLOBALS['TSFE']->fe_user = $userObj;
+               $GLOBALS['TSFE']->id = GeneralUtility::_GET('id');
+               $GLOBALS['TSFE']->determineId();
+               $GLOBALS['TSFE']->getCompressedTCarray();
+               $GLOBALS['TSFE']->initTemplate();
+               $GLOBALS['TSFE']->getConfigArray();
+               $GLOBALS['TSFE']->includeTCA();
+
+               $this->div = GeneralUtility::makeInstance('\In2code\PowermailCond\Utility\Div');
+       }
+}
+
+$eid = GeneralUtility::makeInstance('In2code\PowermailCond\Utility\Eid\DeRequiredFieldsEid', $GLOBALS['TYPO3_CONF_VARS']);
+echo $eid->main();
\ No newline at end of file
diff --git a/Classes/Utility/Eid/DebugSessionEid.php b/Classes/Utility/Eid/DebugSessionEid.php
new file mode 100644 (file)
index 0000000..fe05dd7
--- /dev/null
@@ -0,0 +1,91 @@
+<?php
+namespace In2code\PowermailCond\Utility\Eid;
+
+use \TYPO3\CMS\Core\Utility\GeneralUtility;
+
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2014 Alex Kellner <alexander.kellner@in2code.de>, in2code.de
+ *
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Debug Session values
+ *
+ * @author Alex Kellner <alexander.kellner@in2code.de>, in2code.de
+ * @package TYPO3
+ * @subpackage DebugSessionEid
+ */
+class DebugSessionEid {
+
+       /**
+        * Read values from session - example: 18:braun;17:rot;12:xd;11:fc;
+        *
+        * @return string
+        */
+       public function main() {
+               if (empty($GLOBALS['BE_USER']->user['uid'])) {
+                       return 'Please login into backend';
+               }
+
+               /* @var $div \In2code\PowermailCond\Utility\Div */
+               $div = GeneralUtility::makeInstance('\In2code\PowermailCond\Utility\Div');
+               $piVars = GeneralUtility::_GP('tx_powermailcond_pi1');
+               if (empty($piVars['formUid'])) {
+                       return 'tx_powermailcond_pi1[formUid] is missing';
+               }
+
+               $sessionForm = $div->getAllSessionValuesFromForm($piVars['formUid']);
+               $sessionDeRequiredFields = $div->getAllSessionValuesFromForm($piVars['formUid'], 'deRequiredFields');
+
+               \TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump($sessionForm, 'Values in Session');
+               \TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump($sessionDeRequiredFields, 'Disabled Required Fields');
+               return '';
+       }
+
+       /**
+        * Initialize eID
+        */
+       public function __construct($TYPO3_CONF_VARS) {
+               $userObj = \TYPO3\CMS\Frontend\Utility\EidUtility::initFeUser();
+               $GLOBALS['TSFE'] = GeneralUtility::makeInstance(
+                       '\TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController',
+                       $TYPO3_CONF_VARS,
+                       32,
+                       0,
+                       TRUE
+               );
+               $GLOBALS['TSFE']->connectToDB();
+               $GLOBALS['TSFE']->fe_user = $userObj;
+               $GLOBALS['TSFE']->id = GeneralUtility::_GET('id');
+               $GLOBALS['TSFE']->determineId();
+               $GLOBALS['TSFE']->getCompressedTCarray();
+               $GLOBALS['TSFE']->initTemplate();
+               $GLOBALS['TSFE']->getConfigArray();
+               $GLOBALS['TSFE']->includeTCA();
+               $GLOBALS['BE_USER'] = GeneralUtility::makeInstance('\TYPO3\CMS\Core\Authentication\BackendUserAuthentication');
+               $GLOBALS['BE_USER']->start();
+               $GLOBALS['BE_USER']->backendCheckLogin();
+       }
+}
+
+$eid = GeneralUtility::makeInstance('In2code\PowermailCond\Utility\Eid\DebugSessionEid', $GLOBALS['TYPO3_CONF_VARS']);
+echo $eid->main();
\ No newline at end of file
diff --git a/Classes/Utility/Eid/GetFieldlistEid.php b/Classes/Utility/Eid/GetFieldlistEid.php
new file mode 100644 (file)
index 0000000..5c2c2bf
--- /dev/null
@@ -0,0 +1,319 @@
+<?php
+namespace In2code\PowermailCond\Utility\Eid;
+
+use \TYPO3\CMS\Core\Utility\GeneralUtility;
+
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2014 Alex Kellner <alexander.kellner@in2code.de>, in2code.de
+ *
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * This class tells jQuery which field are allowed in which are not allowed
+ *
+ * @author Alex Kellner <alexander.kellner@in2code.de>, in2code.de
+ * @package TYPO3
+ * @subpackage GetFieldlistEid
+ */
+class GetFieldlistEid {
+
+       /**
+        * Prefix ID for Plugin Vars
+        *
+        * @var string
+        */
+       public $prefixId = 'tx_powermailcond_pi1';
+
+       /**
+        * @var \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer
+        */
+       protected $cObj;
+
+       /**
+        * @var \In2code\PowermailCond\Utility\Div
+        */
+       protected $div;
+
+       /**
+        * Generates the output
+        *
+        * @return string
+        */
+       public function main() {
+               $this->cObj = GeneralUtility::makeInstance('\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer');
+               $conditions = $this->div->getConditionsFromForm($this->piVars['formUid'], $this->cObj);
+               $targetFields = $this->div->getStartFields($conditions);
+               if ($this->piVars['uid'] > 0 && !in_array($this->piVars['uid'], $targetFields)) {
+                       return 'nochange';
+               }
+
+               $content = '';
+               foreach ((array) $conditions as $conf) {
+                       $content .= $this->checkRules($conf) . ',';
+               }
+
+               // remove last ,
+               $content = rtrim($content, ',');
+               // remove double values
+               $content = GeneralUtility::uniqueList($content);
+
+               return $content;
+       }
+
+       /**
+        * Preflight function checks the rules
+        *              if there should be an action (show/hide) or not
+        *
+        * @param array $conf Configuration of current field
+        * @return boolean true:hide false:show(nothing)
+        */
+       protected function checkRules($conf) {
+               // start with 0
+               $do = 0;
+               $content = '';
+               $tmpConf = array();
+               if ($conf[0]['conjunction'] == 'AND') {
+                       // start with 1
+                       $do = 1;
+               }
+
+               // one loop for every rule of current target field
+               foreach ((array) $conf as $key => $subconf) {
+                       $subconf = NULL;
+
+                       // special case: hide a field from the beginning
+                       if ($conf[$key]['actions'] == 1) {
+                               // show
+                               $content .= $this->div->getFieldsFromFieldset($conf[$key]['targetField'], $this->piVars['formUid']) . ',';
+                       }
+
+                       // operations
+                       $act = 0;
+                       $startFieldSession = $this->session['field_' . $conf[$key]['startField']];
+                       // if second level
+                       if (is_array($startFieldSession)) {
+                               // get all values in a commaseparated list
+                               $startFieldSession = implode(',', $startFieldSession);
+                       }
+                       switch ($conf[$key]['ops']) {
+                               // "not empty"
+                               case 0:
+                                       // if start field value in session is not empty
+                                       if ($startFieldSession != '') {
+                                               $act = 1;
+                                               $tmpConf = $conf[$key];
+                                       }
+                                       break;
+
+                               // "empty"
+                               case 1:
+                                       // if start field value in session is empty
+                                       if ($startFieldSession == '') {
+                                               $act = 1;
+                                               $tmpConf = $conf[$key];
+                                       }
+                                       break;
+
+                               // "contains"
+                               case 2:
+                                       // if start field value in session contains condstring
+                                       if (stristr($startFieldSession, $conf[$key]['condstring'])) {
+                                               $act = 1;
+                                               $tmpConf = $conf[$key];
+                                       }
+                                       break;
+
+                               // "not contains"
+                               case 3:
+                                       // if start field value in session contains not condstring
+                                       if (!stristr($startFieldSession, $conf[$key]['condstring'])) {
+                                               $act = 1;
+                                               $tmpConf = $conf[$key];
+                                       }
+                                       break;
+
+                               // "is"
+                               case 4:
+                                       // if start field value in session === condstring
+                                       if ($startFieldSession === $conf[$key]['condstring']) {
+                                               $act = 1;
+                                               $tmpConf = $conf[$key];
+                                       }
+                                       break;
+
+                               // "is not"
+                               case 5:
+                                       // if start field value in session is not condstring
+                                       if ($startFieldSession !== $conf[$key]['condstring']) {
+                                               $act = 1;
+                                               $tmpConf = $conf[$key];
+                                       }
+                                       break;
+
+                               // "is greater than"
+                               case 6:
+                                       // if start field value in session is greater than condstring
+                                       if (intval($startFieldSession) > intval($conf[$key]['condstring'])) {
+                                               $act = 1;
+                                               $tmpConf = $conf[$key];
+                                       }
+                                       break;
+
+                               // "is less than"
+                               case 7:
+                                       // if start field value in session is greater than condstring
+                                       if (intval($startFieldSession) < intval($conf[$key]['condstring'])) {
+                                               $act = 1;
+                                               $tmpConf = $conf[$key];
+                                       }
+                                       break;
+
+                               // "contains value from field"
+                               case 8:
+                                       // get comparisonfield value from session
+                                       $comparisonFieldSession = $this->session['field_' . $conf[$key]['equalField']];
+                                       if (stristr($comparisonFieldSession, $startFieldSession)) {
+                                               $act = 1;
+                                               $tmpConf = $conf[$key];
+                                       }
+                                       break;
+
+                               // "contains not value from field"
+                               case 9:
+                                       // get comparisonfield value from session
+                                       $comparisonFieldSession = $this->session['field_' . $conf[$key]['equalField']];
+                                       if (!stristr($comparisonFieldSession, $startFieldSession)) {
+                                               $act = 1;
+                                               $tmpConf = $conf[$key];
+                                       }
+                                       break;
+
+                               default:
+                       }
+
+                       // $do = 1;
+                       $do = $this->setDo(($act ? TRUE : FALSE), $do, $conf[$key]['conjunction']);
+               }
+
+               // add new field if needed
+               $content = $this->doAction($do, $content, $tmpConf);
+               // return commaseparated list
+               return rtrim($content, ',');
+       }
+
+       /**
+        * Set a value to 0 or 1 depending on previous value and on conjunction (AND/OR)
+        *
+        * @param boolean $newStatus: New status
+        * @param boolean $oldStatus: Old status
+        * @param string $conjunction: AND or OR
+        * @return boolean
+        */
+       protected function setDo($newStatus, $oldStatus = FALSE, $conjunction = 'OR') {
+               if ($conjunction == 'OR') {
+                       if ($newStatus || $oldStatus) {
+                               return TRUE;
+                       } else {
+                               return FALSE;
+                       }
+               } elseif ($conjunction == 'AND') {
+                       if ($newStatus && $oldStatus) {
+                               return TRUE;
+                       } else {
+                               return FALSE;
+                       }
+               }
+               return FALSE;
+       }
+
+       /**
+        * This function return current field uid
+        *              if this field should be hidden (and removes value from session)
+        *
+        * @param boolean $do: If something should be done or not
+        * @param string $content: List with all fields which should be hidden
+        * @param array $conf: Configuration of current field
+        * @return string list
+        */
+       protected function doAction($do, $content, $conf) {
+               if (!$do) {
+                       return $content;
+               }
+
+               switch ($conf['actions']) {
+                       // hide
+                       case 0:
+                               // remove value from session of this field
+                               $this->div->saveValueToSession('', $this->piVars['formUid'], $conf['targetField']);
+                               // hide this field
+                               $content .= $this->div->getFieldsFromFieldset($conf['targetField'], $this->piVars['formUid']) . ',';
+                               break;
+
+                       // show
+                       case 1:
+                               // remove from hidelist (show this field)
+                               $content = GeneralUtility::rmFromList(
+                                       $this->div->getFieldsFromFieldset($conf['targetField'], $this->piVars['formUid']),
+                                       $content
+                               );
+                               break;
+
+                       // filter from selectbox
+                       case 2:
+                               $content .= 'filter:' . $conf['targetField'] . ':' . str_replace(',', ';', $conf['filterSelectField']);
+                               break;
+
+                       default:
+               }
+
+               return $content;
+       }
+
+       /**
+        * Initialize eID
+        */
+       public function __construct($TYPO3_CONF_VARS) {
+               $userObj = \TYPO3\CMS\Frontend\Utility\EidUtility::initFeUser();
+               $GLOBALS['TSFE'] = GeneralUtility::makeInstance(
+                       '\TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController',
+                       $TYPO3_CONF_VARS,
+                       32,
+                       0,
+                       TRUE
+               );
+               $GLOBALS['TSFE']->connectToDB();
+               $GLOBALS['TSFE']->fe_user = $userObj;
+               $GLOBALS['TSFE']->id = GeneralUtility::_GET('id');
+               $GLOBALS['TSFE']->determineId();
+               $GLOBALS['TSFE']->getCompressedTCarray();
+               $GLOBALS['TSFE']->initTemplate();
+               $GLOBALS['TSFE']->getConfigArray();
+               $GLOBALS['TSFE']->includeTCA();
+
+               $this->piVars = GeneralUtility::_GET($this->prefixId);
+               $this->div = GeneralUtility::makeInstance('In2code\PowermailCond\Utility\Div');
+               $this->session = $this->div->getAllSessionValuesFromForm($this->piVars['formUid']);
+       }
+}
+
+$eid = GeneralUtility::makeInstance('In2code\PowermailCond\Utility\Eid\GetFieldlistEid', $GLOBALS['TYPO3_CONF_VARS']);
+echo $eid->main();
\ No newline at end of file
diff --git a/Classes/Utility/Eid/ReadSessionEid.php b/Classes/Utility/Eid/ReadSessionEid.php
new file mode 100644 (file)
index 0000000..8a7eeb1
--- /dev/null
@@ -0,0 +1,100 @@
+<?php
+namespace In2code\PowermailCond\Utility\Eid;
+
+use \TYPO3\CMS\Core\Utility\GeneralUtility;
+
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2014 Alex Kellner <alexander.kellner@in2code.de>, in2code.de
+ *
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * This class is for reading values from session
+ *
+ * @author Alex Kellner <alexander.kellner@in2code.de>, in2code.de
+ * @package TYPO3
+ * @subpackage ReadSessionEid
+ */
+class ReadSessionEid {
+
+       /**
+        * The extension key
+        *
+        * @var string
+        */
+       public $extKey = 'powermail_cond';
+
+       /**
+        * Prefix Id
+        *
+        * @var string
+        */
+       public $prefixId = 'tx_powermailcond_pi1';
+
+       /**
+        * @var \In2code\PowermailCond\Utility\Div
+        */
+       protected $div;
+
+       /**
+        * Read values from session - example: 18:braun;17:rot;12:xd;11:fc;
+        *
+        * @return string
+        */
+       public function main() {
+               $piVars = GeneralUtility::_GP($this->prefixId);
+               $array = $this->div->getAllSessionValuesFromForm($piVars['form']);
+
+               $content = '';
+               foreach ((array) $array as $key => $value) {
+                       $content .= str_replace('field_', '', $key) . ':' . $value . ';';
+               }
+               return $content;
+       }
+
+       /**
+        * Initialize eID
+        */
+       public function __construct($TYPO3_CONF_VARS) {
+               $userObj = \TYPO3\CMS\Frontend\Utility\EidUtility::initFeUser();
+               $GLOBALS['TSFE'] = GeneralUtility::makeInstance(
+                       '\TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController',
+                       $TYPO3_CONF_VARS,
+                       32,
+                       0,
+                       TRUE
+               );
+               $GLOBALS['TSFE']->connectToDB();
+               $GLOBALS['TSFE']->fe_user = $userObj;
+               $GLOBALS['TSFE']->id = GeneralUtility::_GET('id');
+               $GLOBALS['TSFE']->determineId();
+               $GLOBALS['TSFE']->getCompressedTCarray();
+               $GLOBALS['TSFE']->initTemplate();
+               $GLOBALS['TSFE']->getConfigArray();
+               $GLOBALS['TSFE']->includeTCA();
+
+               $this->div = GeneralUtility::makeInstance('\In2code\PowermailCond\Utility\Div');
+       }
+}
+
+$eid = GeneralUtility::makeInstance('In2code\PowermailCond\Utility\Eid\ReadSessionEid', $GLOBALS['TYPO3_CONF_VARS']);
+echo $eid->main();
\ No newline at end of file
diff --git a/Classes/Utility/Eid/RequiredFieldEid.php b/Classes/Utility/Eid/RequiredFieldEid.php
new file mode 100644 (file)
index 0000000..a1e34a2
--- /dev/null
@@ -0,0 +1,97 @@
+<?php
+namespace In2code\PowermailCond\Utility\Eid;
+
+use \TYPO3\CMS\Core\Utility\GeneralUtility;
+
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2014 Alex Kellner <alexander.kellner@in2code.de>, in2code.de
+ *
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Remove fields from session which should be mandatory again
+ *
+ * @author Alex Kellner <alexander.kellner@in2code.de>, in2code.de
+ * @package TYPO3
+ * @subpackage RequiredFieldEid
+ */
+class RequiredFieldEid {
+
+       /**
+        * Prefix Id
+        *
+        * @var string
+        */
+       public $prefixId = 'tx_powermailcond_pi1';
+
+       /**
+        * @var \In2code\PowermailCond\Utility\Div
+        */
+       protected $div;
+
+       /**
+        * save field in session to be stored for non-mandatory fields
+        *
+        * @return int Field Uid which was disabled
+        */
+       public function main() {
+               $piVars = GeneralUtility::_GP($this->prefixId);
+               $formUid = intval($piVars['formUid']);
+               $fieldUid = intval($piVars['fieldUid']);
+
+               // start
+               if ($formUid === 0 || $fieldUid === 0) {
+                       return 0;
+               }
+
+               // removee single value from session
+               $this->div->removeValueFromSession($formUid, $fieldUid, 'deRequiredFields');
+               return $fieldUid;
+       }
+
+       /**
+        * Initialize eID
+        */
+       public function __construct($TYPO3_CONF_VARS) {
+               $userObj = \TYPO3\CMS\Frontend\Utility\EidUtility::initFeUser();
+               $GLOBALS['TSFE'] = GeneralUtility::makeInstance(
+                       '\TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController',
+                       $TYPO3_CONF_VARS,
+                       32,
+                       0,
+                       TRUE
+               );
+               $GLOBALS['TSFE']->connectToDB();
+               $GLOBALS['TSFE']->fe_user = $userObj;
+               $GLOBALS['TSFE']->id = GeneralUtility::_GET('id');
+               $GLOBALS['TSFE']->determineId();
+               $GLOBALS['TSFE']->getCompressedTCarray();
+               $GLOBALS['TSFE']->initTemplate();
+               $GLOBALS['TSFE']->getConfigArray();
+               $GLOBALS['TSFE']->includeTCA();
+
+               $this->div = GeneralUtility::makeInstance('\In2code\PowermailCond\Utility\Div');
+       }
+}
+
+$eid = GeneralUtility::makeInstance('In2code\PowermailCond\Utility\Eid\RequiredFieldEid', $GLOBALS['TYPO3_CONF_VARS']);
+echo $eid->main();
\ No newline at end of file
diff --git a/Classes/Utility/Eid/SaveInSessionEid.php b/Classes/Utility/Eid/SaveInSessionEid.php
new file mode 100644 (file)
index 0000000..84d28a1
--- /dev/null
@@ -0,0 +1,107 @@
+<?php
+namespace In2code\PowermailCond\Utility\Eid;
+
+use \TYPO3\CMS\Core\Utility\GeneralUtility;
+
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2014 Alex Kellner <alexander.kellner@in2code.de>, in2code.de
+ *
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * This class is for storing values to session on every fieldchange (via AJAX)
+ *
+ * @author Alex Kellner <alexander.kellner@in2code.de>, in2code.de
+ * @package TYPO3
+ * @subpackage SaveInSessionEid
+ */
+class SaveInSessionEid {
+
+       /**
+        * The extension key
+        *
+        * @var string
+        */
+       public $extKey = 'powermail_cond';
+
+       /**
+        * Prefix Id
+        *
+        * @var string
+        */
+       public $prefixId = 'tx_powermailcond_pi1';
+
+       /**
+        * @var \In2code\PowermailCond\Utility\Div
+        */
+       protected $div;
+
+       /**
+        * Read values from session - example: 18:braun;17:rot;12:xd;11:fc;
+        *
+        * @return bool
+        */
+       public function main() {
+               $GLOBALS['TSFE']->sesData = \TYPO3\CMS\Frontend\Utility\EidUtility::initFeUser();
+               $piVars = GeneralUtility::_GP($this->prefixId);
+
+               $uid = intval($piVars['uid']);
+               $form = intval($piVars['form']);
+               $value = htmlspecialchars($piVars['value']);
+
+               // start
+               if ($uid === 0 || $form === 0) {
+                       return FALSE;
+               }
+               // save single value in session
+               $this->div->saveValueToSession($value, $form, $uid);
+
+               return FALSE;
+       }
+
+       /**
+        * Initialize eID
+        */
+       public function __construct($TYPO3_CONF_VARS) {
+               $userObj = \TYPO3\CMS\Frontend\Utility\EidUtility::initFeUser();
+               $GLOBALS['TSFE'] = GeneralUtility::makeInstance(
+                       '\TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController',
+                       $TYPO3_CONF_VARS,
+                       32,
+                       0,
+                       TRUE
+               );
+               $GLOBALS['TSFE']->connectToDB();
+               $GLOBALS['TSFE']->fe_user = $userObj;
+               $GLOBALS['TSFE']->id = GeneralUtility::_GET('id');
+               $GLOBALS['TSFE']->determineId();
+               $GLOBALS['TSFE']->getCompressedTCarray();
+               $GLOBALS['TSFE']->initTemplate();
+               $GLOBALS['TSFE']->getConfigArray();
+               $GLOBALS['TSFE']->includeTCA();
+
+               $this->div = GeneralUtility::makeInstance('\In2code\PowermailCond\Utility\Div');
+       }
+}
+
+$eid = GeneralUtility::makeInstance('In2code\PowermailCond\Utility\Eid\SaveInSessionEid', $GLOBALS['TYPO3_CONF_VARS']);
+echo $eid->main();
\ No newline at end of file
diff --git a/Classes/Utility/EidClearSession.php b/Classes/Utility/EidClearSession.php
deleted file mode 100644 (file)
index ed12bd8..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-<?php
-/***************************************************************
- *  Copyright notice
- *
- *  (c) 2014 Alex Kellner <alexander.kellner@in2code.de>, in2code.de
- *
- *  All rights reserved
- *
- *  This script is part of the TYPO3 project. The TYPO3 project is
- *  free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 3 of the License, or
- *  (at your option) any later version.
- *
- *  The GNU General Public License can be found at
- *  http://www.gnu.org/copyleft/gpl.html.
- *
- *  This script is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  This copyright notice MUST APPEAR in all copies of the script!
- ***************************************************************/
-
-/**
- * This class is for reading values from session
- *
- * @author     Alex Kellner <alexander.kellner@in2code.de>, in2code.
- * @package    TYPO3
- * @subpackage Tx_PowermailCond_Utility_EidReadSession
- */
-class Tx_PowermailCond_Utility_EidClearSession {
-
-       /**
-        * The extension key
-        *
-        * @var string
-        */
-       public $extKey = 'powermail_cond';
-
-       /**
-        * Prefix Id
-        *
-        * @var string
-        */
-       public $prefixId = 'tx_powermailcond_pi1';
-
-       /**
-        * @var Tx_PowermailCond_Utility_Div
-        */
-       protected $div;
-
-       /**
-        * Read values from session - example: 18:braun;17:rot;12:xd;11:fc;
-        *
-        * @return void
-        */
-       public function main() {
-               $GLOBALS['TSFE']->sesData = tslib_eidtools::initFeUser();
-               $piVars = t3lib_div::_GP($this->prefixId);
-               $form = intval($piVars['form']);
-               $this->div->cleanfullSession($form, 'fieldSession');
-               $this->div->cleanfullSession($form, 'deRequiredFields');
-       }
-
-       /**
-        * Initialize eID
-        */
-       public function __construct($TYPO3_CONF_VARS) {
-               $userObj = tslib_eidtools::initFeUser();
-               $GLOBALS['TSFE'] = t3lib_div::makeInstance('tslib_fe', $TYPO3_CONF_VARS, 32, 0, TRUE);
-               $GLOBALS['TSFE']->connectToDB();
-               $GLOBALS['TSFE']->fe_user = $userObj;
-               $GLOBALS['TSFE']->id = t3lib_div::_GET('id');
-               $GLOBALS['TSFE']->determineId();
-               $GLOBALS['TSFE']->getCompressedTCarray();
-               $GLOBALS['TSFE']->initTemplate();
-               $GLOBALS['TSFE']->getConfigArray();
-               $GLOBALS['TSFE']->includeTCA();
-
-               $this->div = t3lib_div::makeInstance('Tx_PowermailCond_Utility_Div');
-       }
-}
-
-$eid = t3lib_div::makeInstance('Tx_PowermailCond_Utility_EidClearSession', $GLOBALS['TYPO3_CONF_VARS']);
-echo $eid->main();
\ No newline at end of file
diff --git a/Classes/Utility/EidDeRequiredField.php b/Classes/Utility/EidDeRequiredField.php
deleted file mode 100644 (file)
index 8a8cdda..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-<?php
-/***************************************************************
- *  Copyright notice
- *
- *  (c) 2014 Alex Kellner <alexander.kellner@in2code.de>, in2code.de
- *
- *  All rights reserved
- *
- *  This script is part of the TYPO3 project. The TYPO3 project is
- *  free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 3 of the License, or
- *  (at your option) any later version.
- *
- *  The GNU General Public License can be found at
- *  http://www.gnu.org/copyleft/gpl.html.
- *
- *  This script is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  This copyright notice MUST APPEAR in all copies of the script!
- ***************************************************************/
-
-/**
- * Store fields in session which should not be mandatory any more
- *
- * @author     Alex Kellner <alexander.kellner@in2code.de>, in2code.
- * @package    TYPO3
- * @subpackage Tx_PowermailCond_Utility_EidDeRequiredField
- */
-class Tx_PowermailCond_Utility_EidDeRequiredField {
-
-       /**
-        * Prefix Id
-        *
-        * @var string
-        */
-       public $prefixId = 'tx_powermailcond_pi1';
-
-       /**
-        * @var Tx_PowermailCond_Utility_Div
-        */
-       protected $div;
-
-       /**
-        * save field in session to be stored for non-mandatory fields
-        *
-        * @return int Field Uid which was disabled
-        */
-       public function main() {
-               $cObj = t3lib_div::makeInstance('tslib_cObj');
-               $piVars = t3lib_div::_GP($this->prefixId);
-               $formUid = intval($piVars['formUid']);
-               $fieldUid = intval($piVars['fieldUid']);
-               $conditions = $this->div->getConditionsFromForm($this->piVars['formUid'], $cObj);
-
-               // only if this field was defined as targetField in conditions
-               if (array_key_exists($fieldUid, $conditions)) {
-                       // save single value in session
-                       $this->div->saveValueToSession('', $formUid, $fieldUid, 'deRequiredFields');
-                       return $fieldUid;
-               }
-
-               return 0;
-       }
-
-       /**
-        * Initialize eID
-        */
-       public function __construct($TYPO3_CONF_VARS) {
-               $userObj = tslib_eidtools::initFeUser();
-               $GLOBALS['TSFE'] = t3lib_div::makeInstance('tslib_fe', $TYPO3_CONF_VARS, 32, 0, TRUE);
-               $GLOBALS['TSFE']->connectToDB();
-               $GLOBALS['TSFE']->fe_user = $userObj;
-               $GLOBALS['TSFE']->id = t3lib_div::_GET('id');
-               $GLOBALS['TSFE']->determineId();
-               $GLOBALS['TSFE']->getCompressedTCarray();
-               $GLOBALS['TSFE']->initTemplate();
-               $GLOBALS['TSFE']->getConfigArray();
-               $GLOBALS['TSFE']->includeTCA();
-
-               $this->div = t3lib_div::makeInstance('Tx_PowermailCond_Utility_Div');
-       }
-}
-
-$eid = t3lib_div::makeInstance('Tx_PowermailCond_Utility_EidDeRequiredField', $GLOBALS['TYPO3_CONF_VARS']);
-echo $eid->main();
\ No newline at end of file
diff --git a/Classes/Utility/EidDeRequiredFields.php b/Classes/Utility/EidDeRequiredFields.php
deleted file mode 100644 (file)
index db441e1..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-<?php
-/***************************************************************
- *  Copyright notice
- *
- *  (c) 2014 Alex Kellner <alexander.kellner@in2code.de>, in2code.de
- *
- *  All rights reserved
- *
- *  This script is part of the TYPO3 project. The TYPO3 project is
- *  free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 3 of the License, or
- *  (at your option) any later version.
- *
- *  The GNU General Public License can be found at
- *  http://www.gnu.org/copyleft/gpl.html.
- *
- *  This script is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  This copyright notice MUST APPEAR in all copies of the script!
- ***************************************************************/
-
-/**
- * Store fields in session which should not be mandatory any more
- *
- * @author     Alex Kellner <alexander.kellner@in2code.de>, in2code.
- * @package    TYPO3
- * @subpackage Tx_PowermailCond_Utility_EidDeRequiredField
- */
-class Tx_PowermailCond_Utility_EidDeRequiredFields {
-
-       /**
-        * Prefix Id
-        *
-        * @var string
-        */
-       public $prefixId = 'tx_powermailcond_pi1';
-
-       /**
-        * @var Tx_PowermailCond_Utility_Div
-        */
-       protected $div;
-
-       /**
-        * save field in session to be stored for non-mandatory fields
-        *
-        * @return int Field Uid which was disabled
-        */
-       public function main() {
-               $cObj = t3lib_div::makeInstance('tslib_cObj');
-               $piVars = t3lib_div::_GP($this->prefixId);
-               $formUid = intval($piVars['formUid']);
-               $fieldUids = explode(',', $piVars['fieldUids']);
-               $conditions = $this->div->getConditionsFromForm($this->piVars['formUid'], $cObj);
-
-               foreach ($fieldUids as $fieldUid) {
-                       // only if this field was defined as targetField in conditions
-                       if (array_key_exists($fieldUid, $conditions)) {
-                               // save single value in session
-                               $this->div->saveValueToSession('', $formUid, $fieldUid, 'deRequiredFields');
-                       }
-               }
-
-               return htmlspecialchars($piVars['fieldUids']);
-       }
-
-       /**
-        * Initialize eID
-        */
-       public function __construct($TYPO3_CONF_VARS) {
-               $userObj = tslib_eidtools::initFeUser();
-               $GLOBALS['TSFE'] = t3lib_div::makeInstance('tslib_fe', $TYPO3_CONF_VARS, 32, 0, TRUE);
-               $GLOBALS['TSFE']->connectToDB();
-               $GLOBALS['TSFE']->fe_user = $userObj;
-               $GLOBALS['TSFE']->id = t3lib_div::_GET('id');
-               $GLOBALS['TSFE']->determineId();
-               $GLOBALS['TSFE']->getCompressedTCarray();
-               $GLOBALS['TSFE']->initTemplate();
-               $GLOBALS['TSFE']->getConfigArray();
-               $GLOBALS['TSFE']->includeTCA();
-
-               $this->div = t3lib_div::makeInstance('Tx_PowermailCond_Utility_Div');
-       }
-}
-
-$eid = t3lib_div::makeInstance('Tx_PowermailCond_Utility_EidDeRequiredFields', $GLOBALS['TYPO3_CONF_VARS']);
-echo $eid->main();
\ No newline at end of file
diff --git a/Classes/Utility/EidDebugSession.php b/Classes/Utility/EidDebugSession.php
deleted file mode 100644 (file)
index 494466a..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-<?php
-/***************************************************************
- *  Copyright notice
- *
- *  (c) 2014 Alex Kellner <alexander.kellner@in2code.de>, in2code.de
- *
- *  All rights reserved
- *
- *  This script is part of the TYPO3 project. The TYPO3 project is
- *  free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 3 of the License, or
- *  (at your option) any later version.
- *
- *  The GNU General Public License can be found at
- *  http://www.gnu.org/copyleft/gpl.html.
- *
- *  This script is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  This copyright notice MUST APPEAR in all copies of the script!
- ***************************************************************/
-
-/**
- * Debug Session values
- *
- * @author     Alex Kellner <alexander.kellner@in2code.de>, in2code.
- * @package    TYPO3
- * @subpackage Tx_PowermailCond_Utility_EidDebugSession
- */
-class Tx_PowermailCond_Utility_EidDebugSession {
-
-       /**
-        * Read values from session - example: 18:braun;17:rot;12:xd;11:fc;
-        *
-        * @return bool
-        */
-       public function main() {
-               if (empty($GLOBALS['BE_USER']->user['uid'])) {
-                       return 'Please login into backend';
-               }
-
-               /* @var $div Tx_PowermailCond_Utility_Div */
-               $div = t3lib_div::makeInstance('Tx_PowermailCond_Utility_Div');
-               $piVars = t3lib_div::_GP('tx_powermailcond_pi1');
-               if (empty($piVars['formUid'])) {
-                       return 'tx_powermailcond_pi1[formUid] is missing';
-               }
-
-               $sessionForm = $div->getAllSessionValuesFromForm($piVars['formUid']);
-               $sessionDeRequiredFields = $div->getAllSessionValuesFromForm($piVars['formUid'], 'deRequiredFields');
-
-               t3lib_utility_Debug::debug($sessionForm, 'Values in Session');
-               t3lib_utility_Debug::debug($sessionDeRequiredFields, 'Disabled Required Fields');
-       }
-
-       /**
-        * Initialize eID
-        */
-       public function __construct($TYPO3_CONF_VARS) {
-               $userObj = tslib_eidtools::initFeUser();
-               $GLOBALS['TSFE'] = t3lib_div::makeInstance('tslib_fe', $TYPO3_CONF_VARS, 32, 0, TRUE);
-               $GLOBALS['TSFE']->connectToDB();
-               $GLOBALS['TSFE']->fe_user = $userObj;
-               $GLOBALS['TSFE']->id = t3lib_div::_GET('id');
-               $GLOBALS['TSFE']->determineId();
-               $GLOBALS['TSFE']->getCompressedTCarray();
-               $GLOBALS['TSFE']->initTemplate();
-               $GLOBALS['TSFE']->getConfigArray();
-               $GLOBALS['TSFE']->includeTCA();
-               $GLOBALS['BE_USER'] = t3lib_div::makeInstance('t3lib_beUserAuth');
-               $GLOBALS['BE_USER']->start();
-               $GLOBALS['BE_USER']->backendCheckLogin();
-       }
-}
-
-$eid = t3lib_div::makeInstance('Tx_PowermailCond_Utility_EidDebugSession', $GLOBALS['TYPO3_CONF_VARS']);
-echo $eid->main();
\ No newline at end of file
diff --git a/Classes/Utility/EidGetFieldlist.php b/Classes/Utility/EidGetFieldlist.php
deleted file mode 100644 (file)
index 74ea6bc..0000000
+++ /dev/null
@@ -1,306 +0,0 @@
-<?php
-/***************************************************************
- *  Copyright notice
- *
- *  (c) 2014 Alex Kellner <alexander.kellner@in2code.de>, in2code.de
- *
- *  All rights reserved
- *
- *  This script is part of the TYPO3 project. The TYPO3 project is
- *  free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 3 of the License, or
- *  (at your option) any later version.
- *
- *  The GNU General Public License can be found at
- *  http://www.gnu.org/copyleft/gpl.html.
- *
- *  This script is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  This copyright notice MUST APPEAR in all copies of the script!
- ***************************************************************/
-
-/**
- * This class tells jQuery which field are allowed in which are not allowed
- *
- * @author     Alex Kellner <alexander.kellner@in2code.de>, in2code.
- * @package    TYPO3
- * @subpackage Tx_PowermailCond_Utility_EidGetFieldlist
- */
-class Tx_PowermailCond_Utility_EidGetFieldlist {
-
-       /**
-        * Prefix ID for Plugin Vars
-        *
-        * @var string
-        */
-       public $prefixId = 'tx_powermailcond_pi1';
-
-       /**
-        * @var tslib_cObj
-        */
-       protected $cObj;
-
-       /**
-        * @var Tx_PowermailCond_Utility_Div
-        */
-       protected $div;
-
-       /**
-        * Generates the output
-        *
-        * @return string               from action
-        */
-       public function main() {
-               $this->cObj = t3lib_div::makeInstance('tslib_cObj');
-               $conditions = $this->div->getConditionsFromForm($this->piVars['formUid'], $this->cObj);
-               $targetFields = $this->div->getStartFields($conditions);
-               if ($this->piVars['uid'] > 0 && !in_array($this->piVars['uid'], $targetFields)) {
-                       return 'nochange';
-               }
-
-               $content = '';
-               foreach ((array) $conditions as $conf) {
-                       $content .= $this->checkRules($conf) . ',';
-               }
-
-               // remove last ,
-               $content = rtrim($content, ',');
-               // remove double values
-               $content = t3lib_div::uniqueList($content);
-
-               return $content;
-       }
-
-       /**
-        * Preflight function checks the rules
-        *              if there should be an action (show/hide) or not
-        *
-        * @param       array   $conf: Configuration of current field
-        * @return      boolean true:hide false:show(nothing)
-        */
-       public function checkRules($conf) {
-               // start with 0
-               $do = 0;
-               $content = '';
-               $tmpConf = array();
-               if ($conf[0]['conjunction'] == 'AND') {
-                       // start with 1
-                       $do = 1;
-               }
-
-               // one loop for every rule of current target field
-               foreach ((array) $conf as $key => $subconf) {
-                       $subconf = NULL;
-
-                       // special case: hide a field from the beginning
-                       if ($conf[$key]['actions'] == 1) {
-                               // show
-                               $content .= $this->div->getFieldsFromFieldset($conf[$key]['targetField'], $this->piVars['formUid']) . ',';
-                       }
-
-                       // operations
-                       $act = 0;
-                       $startFieldSession = $this->session['field_' . $conf[$key]['startField']];
-                       // if second level
-                       if (is_array($startFieldSession)) {
-                               // get all values in a commaseparated list
-                               $startFieldSession = implode(',', $startFieldSession);
-                       }
-                       switch ($conf[$key]['ops']) {
-                               // "not empty"
-                               case 0:
-                                       // if start field value in session is not empty
-                                       if ($startFieldSession != '') {
-                                               $act = 1;
-                                               $tmpConf = $conf[$key];
-                                       }
-                                       break;
-
-                               // "empty"
-                               case 1:
-                                       // if start field value in session is empty
-                                       if ($startFieldSession == '') {
-                                               $act = 1;
-                                               $tmpConf = $conf[$key];
-                                       }
-                                       break;
-
-                               // "contains"
-                               case 2:
-                                       // if start field value in session contains condstring
-                                       if (stristr($startFieldSession, $conf[$key]['condstring'])) {
-                                               $act = 1;
-                                               $tmpConf = $conf[$key];
-                                       }
-                                       break;
-
-                               // "not contains"
-                               case 3:
-                                       // if start field value in session contains not condstring
-                                       if (!stristr($startFieldSession, $conf[$key]['condstring'])) {
-                                               $act = 1;
-                                               $tmpConf = $conf[$key];
-                                       }
-                                       break;
-
-                               // "is"
-                               case 4:
-                                       // if start field value in session === condstring
-                                       if ($startFieldSession === $conf[$key]['condstring']) {
-                                               $act = 1;
-                                               $tmpConf = $conf[$key];
-                                       }
-                                       break;
-
-                               // "is not"
-                               case 5:
-                                       // if start field value in session is not condstring
-                                       if ($startFieldSession !== $conf[$key]['condstring']) {
-                                               $act = 1;
-                                               $tmpConf = $conf[$key];
-                                       }
-                                       break;
-
-                               // "is greater than"
-                               case 6:
-                                       // if start field value in session is greater than condstring
-                                       if (intval($startFieldSession) > intval($conf[$key]['condstring'])) {
-                                               $act = 1;
-                                               $tmpConf = $conf[$key];
-                                       }
-                                       break;
-
-                               // "is less than"
-                               case 7:
-                                       // if start field value in session is greater than condstring
-                                       if (intval($startFieldSession) < intval($conf[$key]['condstring'])) {
-                                               $act = 1;
-                                               $tmpConf = $conf[$key];
-                                       }
-                                       break;
-
-                               // "contains value from field"
-                               case 8:
-                                       // get comparisonfield value from session
-                                       $comparisonFieldSession = $this->session['field_' . $conf[$key]['equalField']];
-                                       if (stristr($comparisonFieldSession, $startFieldSession)) {
-                                               $act = 1;
-                                               $tmpConf = $conf[$key];
-                                       }
-                                       break;
-
-                               // "contains not value from field"
-                               case 9:
-                                       // get comparisonfield value from session
-                                       $comparisonFieldSession = $this->session['field_' . $conf[$key]['equalField']];
-                                       if (!stristr($comparisonFieldSession, $startFieldSession)) {
-                                               $act = 1;
-                                               $tmpConf = $conf[$key];
-                                       }
-                                       break;
-
-                               default:
-                       }
-
-                       // $do = 1;
-                       $do = $this->setDo(($act ? TRUE : FALSE), $do, $conf[$key]['conjunction']);
-               }
-
-               // add new field if needed
-               $content = $this->doAction($do, $content, $tmpConf);
-               // return commaseparated list
-               return rtrim($content, ',');
-       }
-
-       /**
-        * Set a value to 0 or 1 depending on previous value and on conjunction (AND/OR)
-        *
-        * @param boolean $newStatus: New status
-        * @param boolean $oldStatus: Old status
-        * @param string $conjunction: AND or OR
-        * @return boolean
-        */
-       private function setDo($newStatus, $oldStatus = FALSE, $conjunction = 'OR') {
-               if ($conjunction == 'OR') {
-                       if ($newStatus || $oldStatus) {
-                               return TRUE;
-                       } else {
-                               return FALSE;
-                       }
-               } elseif ($conjunction == 'AND') {
-                       if ($newStatus && $oldStatus) {
-                               return TRUE;
-                       } else {
-                               return FALSE;
-                       }
-               }
-               return FALSE;
-       }
-
-       /**
-        * This function return current field uid
-        *              if this field should be hidden (and removes value from session)
-        *
-        * @param boolean $do: If something should be done or not
-        * @param string $content: List with all fields which should be hidden
-        * @param array $conf: Configuration of current field
-        * @return string list
-        */
-       public function doAction($do, $content, $conf) {
-               if (!$do) {
-                       return $content;
-               }
-
-               switch ($conf['actions']) {
-                       // hide
-                       case 0:
-                               // remove value from session of this field
-                               $this->div->saveValueToSession('', $this->piVars['formUid'], $conf['targetField']);
-                               // hide this field
-                               $content .= $this->div->getFieldsFromFieldset($conf['targetField'], $this->piVars['formUid']) . ',';
-                               break;
-
-                       // show
-                       case 1:
-                               // remove from hidelist (show this field)
-                               $content = t3lib_div::rmFromList($this->div->getFieldsFromFieldset($conf['targetField'], $this->piVars['formUid']), $content);
-                               break;
-
-                       // filter from selectbox
-                       case 2:
-                               $content .= 'filter:' . $conf['targetField'] . ':' . str_replace(',', ';', $conf['filterSelectField']);
-                               break;
-
-                       default:
-               }
-
-               return $content;
-       }
-
-       /**
-        * Initialize eID
-        */
-       public function __construct($TYPO3_CONF_VARS) {
-               $userObj = tslib_eidtools::initFeUser();
-               $GLOBALS['TSFE'] = t3lib_div::makeInstance('tslib_fe', $TYPO3_CONF_VARS, 32, 0, TRUE);
-               $GLOBALS['TSFE']->connectToDB();
-               $GLOBALS['TSFE']->fe_user = $userObj;
-               $GLOBALS['TSFE']->id = t3lib_div::_GET('id');
-               $GLOBALS['TSFE']->determineId();
-               $GLOBALS['TSFE']->getCompressedTCarray();
-               $GLOBALS['TSFE']->initTemplate();
-               $GLOBALS['TSFE']->getConfigArray();
-               $GLOBALS['TSFE']->includeTCA();
-
-               $this->piVars = t3lib_div::_GET($this->prefixId);
-               $this->div = t3lib_div::makeInstance('Tx_PowermailCond_Utility_Div');
-               $this->session = $this->div->getAllSessionValuesFromForm($this->piVars['formUid']);
-       }
-}
-
-$eid = t3lib_div::makeInstance('Tx_PowermailCond_Utility_EidGetFieldlist', $GLOBALS['TYPO3_CONF_VARS']);
-echo $eid->main();
\ No newline at end of file
diff --git a/Classes/Utility/EidReadSession.php b/Classes/Utility/EidReadSession.php
deleted file mode 100644 (file)
index 8645c24..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-<?php
-/***************************************************************
- *  Copyright notice
- *
- *  (c) 2014 Alex Kellner <alexander.kellner@in2code.de>, in2code.de
- *
- *  All rights reserved
- *
- *  This script is part of the TYPO3 project. The TYPO3 project is
- *  free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 3 of the License, or
- *  (at your option) any later version.
- *
- *  The GNU General Public License can be found at
- *  http://www.gnu.org/copyleft/gpl.html.
- *
- *  This script is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  This copyright notice MUST APPEAR in all copies of the script!
- ***************************************************************/
-
-/**
- * This class is for reading values from session
- *
- * @author     Alex Kellner <alexander.kellner@in2code.de>, in2code.
- * @package    TYPO3
- * @subpackage Tx_PowermailCond_Utility_EidReadSession
- */
-class Tx_PowermailCond_Utility_EidReadSession {
-
-       /**
-        * The extension key
-        *
-        * @var string
-        */
-       public $extKey = 'powermail_cond';
-
-       /**
-        * Prefix Id
-        *
-        * @var string
-        */
-       public $prefixId = 'tx_powermailcond_pi1';
-
-       /**
-        * @var Tx_PowermailCond_Utility_Div
-        */
-       protected $div;
-
-       /**
-        * Read values from session - example: 18:braun;17:rot;12:xd;11:fc;
-        *
-        * @return string
-        */
-       public function main() {
-               $piVars = t3lib_div::_GP($this->prefixId);
-               $array = $this->div->getAllSessionValuesFromForm($piVars['form']);
-
-               $content = '';
-               foreach ((array) $array as $key => $value) {
-                       $content .= str_replace('field_', '', $key) . ':' . $value . ';';
-               }
-               return $content;
-       }
-
-       /**
-        * Initialize eID
-        */
-       public function __construct($TYPO3_CONF_VARS) {
-               $userObj = tslib_eidtools::initFeUser();
-               $GLOBALS['TSFE'] = t3lib_div::makeInstance('tslib_fe', $TYPO3_CONF_VARS, 32, 0, TRUE);
-               $GLOBALS['TSFE']->connectToDB();
-               $GLOBALS['TSFE']->fe_user = $userObj;
-               $GLOBALS['TSFE']->id = t3lib_div::_GET('id');
-               $GLOBALS['TSFE']->determineId();
-               $GLOBALS['TSFE']->getCompressedTCarray();
-               $GLOBALS['TSFE']->initTemplate();
-               $GLOBALS['TSFE']->getConfigArray();
-               $GLOBALS['TSFE']->includeTCA();
-
-               $this->div = t3lib_div::makeInstance('Tx_PowermailCond_Utility_Div');
-       }
-}
-
-$eid = t3lib_div::makeInstance('Tx_PowermailCond_Utility_EidReadSession', $GLOBALS['TYPO3_CONF_VARS']);
-echo $eid->main();
\ No newline at end of file
diff --git a/Classes/Utility/EidRequiredField.php b/Classes/Utility/EidRequiredField.php
deleted file mode 100644 (file)
index 1346ea6..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-<?php
-/***************************************************************
- *  Copyright notice
- *
- *  (c) 2014 Alex Kellner <alexander.kellner@in2code.de>, in2code.de
- *
- *  All rights reserved
- *
- *  This script is part of the TYPO3 project. The TYPO3 project is
- *  free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 3 of the License, or
- *  (at your option) any later version.
- *
- *  The GNU General Public License can be found at
- *  http://www.gnu.org/copyleft/gpl.html.
- *
- *  This script is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  This copyright notice MUST APPEAR in all copies of the script!
- ***************************************************************/
-
-/**
- * Remove fields from session which should be mandatory again
- *
- * @author     Alex Kellner <alexander.kellner@in2code.de>, in2code.
- * @package    TYPO3
- * @subpackage Tx_PowermailCond_Utility_EidRequiredField
- */
-class Tx_PowermailCond_Utility_EidRequiredField {
-
-       /**
-        * Prefix Id
-        *
-        * @var string
-        */
-       public $prefixId = 'tx_powermailcond_pi1';
-
-       /**
-        * @var Tx_PowermailCond_Utility_Div
-        */
-       protected $div;
-
-       /**
-        * save field in session to be stored for non-mandatory fields
-        *
-        * @return int Field Uid which was disabled
-        */
-       public function main() {
-               $piVars = t3lib_div::_GP($this->prefixId);
-               $formUid = intval($piVars['formUid']);
-               $fieldUid = intval($piVars['fieldUid']);
-
-               // start
-               if ($formUid === 0 || $fieldUid === 0) {
-                       return 0;
-               }
-
-               // removee single value from session
-               $this->div->removeValueFromSession($formUid, $fieldUid, 'deRequiredFields');
-               return $fieldUid;
-       }
-
-       /**
-        * Initialize eID
-        */
-       public function __construct($TYPO3_CONF_VARS) {
-               $userObj = tslib_eidtools::initFeUser();
-               $GLOBALS['TSFE'] = t3lib_div::makeInstance('tslib_fe', $TYPO3_CONF_VARS, 32, 0, TRUE);
-               $GLOBALS['TSFE']->connectToDB();
-               $GLOBALS['TSFE']->fe_user = $userObj;
-               $GLOBALS['TSFE']->id = t3lib_div::_GET('id');
-               $GLOBALS['TSFE']->determineId();
-               $GLOBALS['TSFE']->getCompressedTCarray();
-               $GLOBALS['TSFE']->initTemplate();
-               $GLOBALS['TSFE']->getConfigArray();
-               $GLOBALS['TSFE']->includeTCA();
-
-               $this->div = t3lib_div::makeInstance('Tx_PowermailCond_Utility_Div');
-       }
-}
-
-$eid = t3lib_div::makeInstance('Tx_PowermailCond_Utility_EidRequiredField', $GLOBALS['TYPO3_CONF_VARS']);
-echo $eid->main();
\ No newline at end of file
diff --git a/Classes/Utility/EidSaveInSession.php b/Classes/Utility/EidSaveInSession.php
deleted file mode 100644 (file)
index 5a2715b..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-<?php
-/***************************************************************
- *  Copyright notice
- *
- *  (c) 2014 Alex Kellner <alexander.kellner@in2code.de>, in2code.de
- *
- *  All rights reserved
- *
- *  This script is part of the TYPO3 project. The TYPO3 project is
- *  free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 3 of the License, or
- *  (at your option) any later version.
- *
- *  The GNU General Public License can be found at
- *  http://www.gnu.org/copyleft/gpl.html.
- *
- *  This script is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  This copyright notice MUST APPEAR in all copies of the script!
- ***************************************************************/
-
-/**
- * This class is for storing values to session on every fieldchange (via AJAX)
- *
- * @author     Alex Kellner <alexander.kellner@in2code.de>, in2code.
- * @package    TYPO3
- * @subpackage Tx_PowermailCond_Utility_EidReadSession
- */
-class Tx_PowermailCond_Utility_EidSaveInSession {
-
-       /**
-        * The extension key
-        *
-        * @var string
-        */
-       public $extKey = 'powermail_cond';
-
-       /**
-        * Prefix Id
-        *
-        * @var string
-        */
-       public $prefixId = 'tx_powermailcond_pi1';
-
-       /**
-        * @var Tx_PowermailCond_Utility_Div
-        */
-       protected $div;
-
-       /**
-        * Read values from session - example: 18:braun;17:rot;12:xd;11:fc;
-        *
-        * @return bool
-        */
-       public function main() {
-               $GLOBALS['TSFE']->sesData = tslib_eidtools::initFeUser();
-               $piVars = t3lib_div::_GP($this->prefixId);
-
-               $uid = intval($piVars['uid']);
-               $form = intval($piVars['form']);
-               $value = htmlspecialchars($piVars['value']);
-
-               // start
-               if ($uid === 0 || $form === 0) {
-                       return FALSE;
-               }
-               // save single value in session
-               $this->div->saveValueToSession($value, $form, $uid);
-
-               return FALSE;
-       }
-
-       /**
-        * Initialize eID
-        */
-       public function __construct($TYPO3_CONF_VARS) {
-               $userObj = tslib_eidtools::initFeUser();
-               $GLOBALS['TSFE'] = t3lib_div::makeInstance('tslib_fe', $TYPO3_CONF_VARS, 32, 0, TRUE);
-               $GLOBALS['TSFE']->connectToDB();
-               $GLOBALS['TSFE']->fe_user = $userObj;
-               $GLOBALS['TSFE']->id = t3lib_div::_GET('id');
-               $GLOBALS['TSFE']->determineId();
-               $GLOBALS['TSFE']->getCompressedTCarray();
-               $GLOBALS['TSFE']->initTemplate();
-               $GLOBALS['TSFE']->getConfigArray();
-               $GLOBALS['TSFE']->includeTCA();
-
-               $this->div = t3lib_div::makeInstance('Tx_PowermailCond_Utility_Div');
-       }
-}
-
-$eid = t3lib_div::makeInstance('Tx_PowermailCond_Utility_EidSaveInSession', $GLOBALS['TYPO3_CONF_VARS']);
-echo $eid->main();
\ No newline at end of file
diff --git a/Classes/Utility/FieldlistingBackend.php b/Classes/Utility/FieldlistingBackend.php
deleted file mode 100644 (file)
index c1366bd..0000000
+++ /dev/null
@@ -1,175 +0,0 @@
-<?php
-/***************************************************************
- *  Copyright notice
- *
- *  (c) 2012 Alex Kellner <alexander.kellner@in2code.de>, in2code.de
- *
- *  All rights reserved
- *
- *  This script is part of the TYPO3 project. The TYPO3 project is
- *  free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 3 of the License, or
- *  (at your option) any later version.
- *
- *  The GNU General Public License can be found at
- *  http://www.gnu.org/copyleft/gpl.html.
- *
- *  This script is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  This copyright notice MUST APPEAR in all copies of the script!
- ***************************************************************/
-
-
-/**
- * List powermail fields in Backend for powermail_cond rules
- *
- * @package powermail_cond
- * @license http://www.gnu.org/licenses/lgpl.html
- *                     GNU Lesser General Public License, version 3 or later
- */
-class Tx_PowermailCond_Utility_FieldlistingBackend {
-
-       /**
-        * show all fields in the backend
-        *
-        * @param       array   $params: Params
-        * @param       object  $pObj: Parent Object
-        * @return      void
-        */
-       public function getFieldname(&$params, $pObj) {
-               // settings
-               $formUid = intval($params['row']['form']);
-               if (!empty($params['row']['conditions'])) {
-                       $formUid = $this->getFormUidFromCondition($params['row']['conditions']);
-               }
-
-               // query
-               $select = 'tx_powermail_domain_model_fields.uid, tx_powermail_domain_model_fields.title,
-                       tx_powermail_domain_model_fields.marker';
-               $from = '
-                       tx_powermail_domain_model_fields
-                       left join tx_powermail_domain_model_pages on tx_powermail_domain_model_fields.pages = tx_powermail_domain_model_pages.uid
-                       left join tx_powermail_domain_model_forms on tx_powermail_domain_model_pages.forms = tx_powermail_domain_model_forms.uid
-               ';
-               $where = 'tx_powermail_domain_model_fields.hidden = 0 AND tx_powermail_domain_model_fields.deleted = 0';
-               // we want only some fields for starting fields
-               if (isset($params['config']['itemsProcFuncValue'])) {
-                       $where .= ' and tx_powermail_domain_model_fields.type in ("input", "textarea", "select", "radio", "check")';
-               }
-               if ($formUid > 0) {
-                       $where .= ' AND tx_powermail_domain_model_forms.uid = ' . $formUid;
-               }
-               $groupBy = '';
-               $orderBy = 'tx_powermail_domain_model_fields.sorting';
-               $limit = 10000;
-               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($select, $from, $where, $groupBy, $orderBy, $limit);
-               if ($res) {
-                       // Title for optgroup
-                       $params['items'][] = array('powermail Fields', '--div--');
-
-                       while (($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))) {
-                               $params['items'][] = array(
-                                       $pObj->sL($row['title']) . ', {' . $row['marker'] . '}, uid' . $row['uid'],
-                                       $row['uid']
-                               );
-                       }
-               }
-
-               // add fieldsets to selection
-               if (isset($params['config']['itemsProcFunc_addFieldsets'])) {
-                       // add some fieldsets
-                       $params['items'] = array_merge((array) $params['items'], $this->getFieldsets($formUid));
-               }
-       }
-
-       /**
-        * give me all fieldsets in an array
-        *
-        * @param int $formUid                  Form Uid
-        * @return      array   $arr: all fieldsets with its name and the fieldset uid
-        */
-       private function getFieldsets($formUid) {
-               $arr = array();
-               $select = 'uid, title';
-               $from = 'tx_powermail_domain_model_pages';
-               $where = 'forms = ' . intval($formUid) . ' AND hidden = 0 AND deleted = 0';
-               $groupBy = '';
-               $orderBy = 'sorting';
-               $limit = '';
-               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($select, $from, $where, $groupBy, $orderBy, $limit);
-               if ($res) {
-                       $arr[] = array('powermail Fieldsets', '--div--');
-                       while (($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))) {
-                               $arr[] = array($row['title'] . ' (' . $row['uid'] . ')', 'fieldset:' . $row['uid']);
-                       }
-               }
-               return $arr;
-       }
-
-       /**
-        * Get Form Uid from Rule
-        *
-        * @param int $conditionUid
-        * @return int formUid
-        */
-       private function getFormUidFromCondition($conditionUid) {
-               $select = 'form';
-               $from = 'tx_powermailcond_domain_model_condition';
-               $where = 'uid = ' . intval($conditionUid) . ' AND hidden = 0 AND deleted = 0';
-               $groupBy = '';
-               $orderBy = '';
-               $limit = 1;
-               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($select, $from, $where, $groupBy, $orderBy, $limit);
-               if ($res) {
-                       $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
-                       return $row['form'];
-               }
-               return 0;
-       }
-
-       /**
-        * List values of a powermail selectorbox
-        *
-        * @param       array   $params: Params
-        * @param       object  $pObj: Parent Object
-        * @return      void
-        */
-       public function valuesFromPowermailSelectbox(&$params, $pObj) {
-               // Get targetField UID
-               $gParams = t3lib_div::_GET('edit');
-               $gParams2 = $gParams['tx_powermailcond_domain_model_condition'];
-               $thisConditionsUid = 0;
-               foreach ((array) $gParams2 as $uid => $actions) {
-                       unset($actions);
-                       $thisConditionsUid = $uid;
-               }
-               $key = 'tx_powermailcond_domain_model_condition:' . $thisConditionsUid;
-               $targetField = $pObj->cachedTSconfig[$key]['_THIS_ROW']['targetField'];
-
-               // Read values from powermail
-               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
-                       $select = 'settings',
-                       $from = 'tx_powermail_domain_model_fields',
-                       $where = 'uid = ' . intval($targetField),
-                       $groupBy = '',
-                       $orderBy = '',
-                       $limit = '1'
-               );
-               if ($res) {
-                       $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
-               }
-               $options = t3lib_div::trimExplode("\n", $row['settings'], 1);
-
-               // write params
-               foreach ((array) $options as $option) {
-                       $params['items'][] = array(
-                               htmlspecialchars($option),
-                               htmlspecialchars($option)
-                       );
-               }
-       }
-}
\ No newline at end of file
diff --git a/Classes/Utility/Tca/FieldlistingBackend.php b/Classes/Utility/Tca/FieldlistingBackend.php
new file mode 100644 (file)
index 0000000..7c20990
--- /dev/null
@@ -0,0 +1,177 @@
+<?php
+namespace In2code\PowermailCond\Utility\Tca;
+
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2012 Alex Kellner <alexander.kellner@in2code.de>, in2code.de
+ *
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+
+/**
+ * List powermail fields in Backend for powermail_cond rules
+ *
+ * @package powermail_cond
+ * @license http://www.gnu.org/licenses/lgpl.html
+ *                     GNU Lesser General Public License, version 3 or later
+ */
+class FieldlistingBackend {
+
+       /**
+        * show all fields in the backend
+        *
+        * @param       array   $params: Params
+        * @param       object  $pObj: Parent Object
+        * @return      void
+        */
+       public function getFieldname(&$params, $pObj) {
+               // settings
+               $formUid = intval($params['row']['form']);
+               if (!empty($params['row']['conditions'])) {
+                       $formUid = $this->getFormUidFromCondition($params['row']['conditions']);
+               }
+
+               // query
+               $select = 'tx_powermail_domain_model_fields.uid, tx_powermail_domain_model_fields.title,
+                       tx_powermail_domain_model_fields.marker';
+               $from = '
+                       tx_powermail_domain_model_fields
+                       left join tx_powermail_domain_model_pages on tx_powermail_domain_model_fields.pages = tx_powermail_domain_model_pages.uid
+                       left join tx_powermail_domain_model_forms on tx_powermail_domain_model_pages.forms = tx_powermail_domain_model_forms.uid
+               ';
+               $where = 'tx_powermail_domain_model_fields.hidden = 0 AND tx_powermail_domain_model_fields.deleted = 0';
+               // we want only some fields for starting fields
+               if (isset($params['config']['itemsProcFuncValue'])) {
+                       $where .= ' and tx_powermail_domain_model_fields.type in ("input", "textarea", "select", "radio", "check")';
+               }
+               if ($formUid > 0) {
+                       $where .= ' AND tx_powermail_domain_model_forms.uid = ' . $formUid;
+               }
+               $groupBy = '';
+               $orderBy = 'tx_powermail_domain_model_fields.sorting';
+               $limit = 10000;
+               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($select, $from, $where, $groupBy, $orderBy, $limit);
+               if ($res) {
+                       // Title for optgroup
+                       $params['items'][] = array('powermail Fields', '--div--');
+
+                       while (($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))) {
+                               $params['items'][] = array(
+                                       $pObj->sL($row['title']) . ', {' . $row['marker'] . '}, uid' . $row['uid'],
+                                       $row['uid']
+                               );
+                       }
+               }
+
+               // add fieldsets to selection
+               if (isset($params['config']['itemsProcFunc_addFieldsets'])) {
+                       // add some fieldsets
+                       $params['items'] = array_merge((array) $params['items'], $this->getFieldsets($formUid));
+               }
+       }
+
+       /**
+        * give me all fieldsets in an array
+        *
+        * @param int $formUid                  Form Uid
+        * @return      array   $arr: all fieldsets with its name and the fieldset uid
+        */
+       protected function getFieldsets($formUid) {
+               $arr = array();
+               $select = 'uid, title';
+               $from = 'tx_powermail_domain_model_pages';
+               $where = 'forms = ' . intval($formUid) . ' AND hidden = 0 AND deleted = 0';
+               $groupBy = '';
+               $orderBy = 'sorting';
+               $limit = '';
+               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($select, $from, $where, $groupBy, $orderBy, $limit);
+               if ($res) {
+                       $arr[] = array('powermail Fieldsets', '--div--');
+                       while (($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))) {
+                               $arr[] = array($row['title'] . ' (' . $row['uid'] . ')', 'fieldset:' . $row['uid']);
+                       }
+               }
+               return $arr;
+       }
+
+       /**
+        * Get Form Uid from Rule
+        *
+        * @param int $conditionUid
+        * @return int formUid
+        */
+       protected function getFormUidFromCondition($conditionUid) {
+               $select = 'form';
+               $from = 'tx_powermailcond_domain_model_condition';
+               $where = 'uid = ' . intval($conditionUid) . ' AND hidden = 0 AND deleted = 0';
+               $groupBy = '';
+               $orderBy = '';
+               $limit = 1;
+               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($select, $from, $where, $groupBy, $orderBy, $limit);
+               if ($res) {
+                       $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
+                       return $row['form'];
+               }
+               return 0;
+       }
+
+       /**
+        * List values of a powermail selectorbox
+        *
+        * @param       array   $params: Params
+        * @param       object  $pObj: Parent Object
+        * @return      void
+        */
+       public function valuesFromPowermailSelectbox(&$params, $pObj) {
+               // Get targetField UID
+               $gParams = GeneralUtility::_GET('edit');
+               $gParams2 = $gParams['tx_powermailcond_domain_model_condition'];
+               $thisConditionsUid = 0;
+               foreach ((array) $gParams2 as $uid => $actions) {
+                       unset($actions);
+                       $thisConditionsUid = $uid;
+               }
+               $key = 'tx_powermailcond_domain_model_condition:' . $thisConditionsUid;
+               $targetField = $pObj->cachedTSconfig[$key]['_THIS_ROW']['targetField'];
+
+               // Read values from powermail
+               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
+                       $select = 'settings',
+                       $from = 'tx_powermail_domain_model_fields',
+                       $where = 'uid = ' . intval($targetField),
+                       $groupBy = '',
+                       $orderBy = '',
+                       $limit = '1'
+               );
+               if ($res) {
+                       $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
+               }
+               $options = GeneralUtility::trimExplode("\n", $row['settings'], 1);
+
+               // write params
+               foreach ((array) $options as $option) {
+                       $params['items'][] = array(
+                               htmlspecialchars($option),
+                               htmlspecialchars($option)
+                       );
+               }
+       }
+}
\ No newline at end of file
index f81a41b..c093875 100644 (file)
@@ -6,7 +6,9 @@ if (!defined ('TYPO3_MODE')) {
 $TCA['tx_powermailcond_domain_model_condition'] = array (
        'ctrl' => $TCA['tx_powermailcond_domain_model_condition']['ctrl'],
        'interface' => array (
-               'showRecordFieldList' => 'sys_language_uid,l18n_parent,l18n_diffsource,hidden,starttime,endtime,title,targetField,actions,filterSelectField,rules,conjunction,form'
+               'showRecordFieldList' =>
+                       'sys_language_uid,l18n_parent,l18n_diffsource,hidden,starttime,
+                       endtime,title,targetField,actions,filterSelectField,rules,conjunction,form'
        ),
        'types' => array (
                '1' => array('showitem' => '--palette--;x;1, form, targetField, --palette--;x;2, rules, conjunction')
@@ -40,7 +42,8 @@ $TCA['tx_powermailcond_domain_model_condition'] = array (
                                        array('', 0),
                                ),
                                'foreign_table'       => 'tx_powermailcond_conditions',
-                               'foreign_table_where' => 'AND tx_powermailcond_conditions.pid=###CURRENT_PID### AND tx_powermailcond_conditions.sys_language_uid IN (-1,0)',
+                               'foreign_table_where' =>
+                                       'AND tx_powermailcond_conditions.pid=###CURRENT_PID### AND tx_powermailcond_conditions.sys_language_uid IN (-1,0)',
                        )
                ),
                'l18n_diffsource' => array (
@@ -80,7 +83,7 @@ $TCA['tx_powermailcond_domain_model_condition'] = array (
                                'default'  => '0',
                                'range'    => array (
                                        'upper' => mktime(0, 0, 0, 12, 31, 2020),
-                                       'lower' => mktime(0, 0, 0, date('m')-1, date('d'), date('Y'))
+                                       'lower' => mktime(0, 0, 0, date('m') - 1, date('d'), date('Y'))
                                )
                        )
                ),
@@ -105,7 +108,12 @@ $TCA['tx_powermailcond_domain_model_condition'] = array (
                                'minitems' => 1,
                                'requestUpdate' => 1,
                                'foreign_table' => 'tx_powermail_domain_model_forms',
-                               'foreign_table_where' => 'AND tx_powermail_domain_model_forms.deleted = 0 AND tx_powermail_domain_model_forms.hidden = 0 AND tx_powermail_domain_model_forms.sys_language_uid = 0 order by tx_powermail_domain_model_forms.title'
+                               'foreign_table_where' => '
+                                       AND tx_powermail_domain_model_forms.deleted = 0
+                                       AND tx_powermail_domain_model_forms.hidden = 0
+                                       AND tx_powermail_domain_model_forms.sys_language_uid = 0
+                                       order by tx_powermail_domain_model_forms.title
+                               '
                        )
                ),
                'targetField' => Array (
@@ -116,8 +124,8 @@ $TCA['tx_powermailcond_domain_model_condition'] = array (
                                'items' => Array (
                                        Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.targetField.I.0', '0'),
                                ),
-                               'itemsProcFunc' => 'Tx_PowermailCond_Utility_FieldlistingBackend->getFieldname',
-                               'itemsProcFunc_addFieldsets' => 1, // add fieldsets
+                               'itemsProcFunc' => '\In2code\PowermailCond\Utility\Tca\FieldlistingBackend->getFieldname',
+                               'itemsProcFunc_addFieldsets' => 1,
                                'size' => 1,
                                'maxitems' => 1,
                                'eval' => 'required'
@@ -130,11 +138,35 @@ $TCA['tx_powermailcond_domain_model_condition'] = array (
                        'config' => Array (
                                'type' => 'select',
                                'items' => Array (
-                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.action.I.main', '--div--'), // title main
-                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.action.I.0', '0'), // hide
-                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.action.I.1', '1'), // unhide
-                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.action.I.additional', '--div--'), // title additional
-                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.action.I.2', '2'), // filter selectbox
+                                       // title main
+                                       Array(
+                                               'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.action.I.main',
+                                               '--div--'
+                                       ),
+
+                                       // hide
+                                       Array(
+                                               'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.action.I.0',
+                                               '0'
+                                       ),
+
+                                       // unhide
+                                       Array(
+                                               'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.action.I.1',
+                                               '1'
+                                       ),
+
+                                       // title additional
+                                       Array(
+                                               'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.action.I.additional',
+                                               '--div--'
+                                       ),
+
+                                       // filter selectbox
+                                       Array(
+                                               'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.action.I.2',
+                                               '2'
+                                       ),
                                ),
                                'size' => 1,
                                'maxitems' => 1,
@@ -148,12 +180,13 @@ $TCA['tx_powermailcond_domain_model_condition'] = array (
                                'type' => 'select',
                                'items' => Array (
                                ),
-                               'itemsProcFunc' => 'Tx_PowermailCond_Utility_FieldlistingBackend->valuesFromPowermailSelectbox',
+                               'itemsProcFunc' => '\In2code\PowermailCond\Utility\Tca\FieldlistingBackend->valuesFromPowermailSelectbox',
                                'size' => 4,
                                'maxitems' => 1000,
                                'allowNonIdValues' => 1
                        ),
-                       'displayCond' => 'FIELD:actions:IN:2,FIELD:form:>:0' // show only if ops value is greater than 1
+                       // show only if ops value is greater than 1
+                       'displayCond' => 'FIELD:actions:IN:2,FIELD:form:>:0'
                ),
                'rules' => Array (
                        'exclude' => 1,
@@ -161,7 +194,8 @@ $TCA['tx_powermailcond_domain_model_condition'] = array (
                        'config' => Array (
                                'type' => 'inline',
                                'foreign_table' => 'tx_powermailcond_domain_model_rule',
-                               'foreign_table_where' => 'AND tx_powermailcond_domain_model_rule.pid=###CURRENT_PID### ORDER BY tx_powermailcond_domain_model_rule.sorting',
+                               'foreign_table_where' =>
+                                       'AND tx_powermailcond_domain_model_rule.pid=###CURRENT_PID### ORDER BY tx_powermailcond_domain_model_rule.sorting',
                                'foreign_field' => 'conditions',
                                'maxitems' => 99,
                                'appearance' => array(
@@ -180,8 +214,17 @@ $TCA['tx_powermailcond_domain_model_condition'] = array (
                        'config' => Array (
                                'type' => 'select',
                                'items' => Array (
-                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.conjunction.I.1', 'OR'), // OR
-                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.conjunction.I.0', 'AND'), // AND
+                                       // OR
+                                       Array(
+                                               'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.conjunction.I.1',
+                                               'OR'
+                                       ),
+
+                                       // AND
+                                       Array(
+                                               'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions.conjunction.I.0',
+                                               'AND'
+                                       ),
                                ),
                                'size' => 1,
                                'maxitems' => 1,
index 74bcbb3..59d3a98 100644 (file)
@@ -40,8 +40,9 @@ $TCA['tx_powermailcond_domain_model_rule'] = array (
                                'items' => Array (
                                        Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.startField.I.0', '0'),
                                ),
-                               'itemsProcFunc' => 'Tx_PowermailCond_Utility_FieldlistingBackend->getFieldname',
-                               'itemsProcFuncValue' => '"text","textarea","select","radio","check"', // allow only this types of fields in selector
+                               'itemsProcFunc' => '\In2code\PowermailCond\Utility\Tca\FieldlistingBackend->getFieldname',
+                               // allow only this types of fields in selector
+                               'itemsProcFuncValue' => '"text","textarea","select","radio","check"',
                                'size' => 1,
                                'maxitems' => 1,
                                'eval' => 'required'
@@ -53,20 +54,83 @@ $TCA['tx_powermailcond_domain_model_rule'] = array (
                        'config' => Array (
                                'type' => 'select',
                                'items' => Array (
-                                       //Array('', ''), // empty
-                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.operators', '--div--'), // title operators
-                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.0', '0'), // is set
-                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.1', '1'), // is not set
-                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.operatorsComparisonValue', '--div--'), // title operatorsComparisonValue
-                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.2', '2'), // contains
-                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.3', '3'), // contains not
-                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.4', '4'), // is
-                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.5', '5'), // is not
-                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.6', '6'), // is greater than
-                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.7', '7'), // is less than
-                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.operatorsComparisonField', '--div--'), // title operatorsComparisonField
-                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.8', '8'), // contains value from field
-                                       Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.9', '9'), // contains not value from field
+                                       // title operators
+                                       Array(
+                                               'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.operators',
+                                               '--div--'
+                                       ),
+
+                                       // is set
+                                       Array(
+                                               'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.0',
+                                               '0'
+                                       ),
+
+                                       // is not set
+                                       Array(
+                                               'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.1',
+                                               '1'
+                                       ),
+
+                                       // title operatorsComparisonValue
+                                       Array(
+                                               'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.operatorsComparisonValue',
+                                               '--div--'
+                                       ),
+
+                                       // contains
+                                       Array(
+                                               'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.2',
+                                               '2'
+                                       ),
+
+                                       // contains not
+                                       Array(
+                                               'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.3',
+                                               '3'
+                                       ),
+
+                                       // is
+                                       Array(
+                                               'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.4',
+                                               '4'
+                                       ),
+
+                                       // is not
+                                       Array(
+                                               'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.5',
+                                               '5'
+                                       ),
+
+                                       // is greater than
+                                       Array(
+                                               'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.6',
+                                               '6'
+                                       ),
+
+                                       // is less than
+                                       Array(
+                                               'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.7',
+                                               '7'
+                                       ),
+
+                                       // title operatorsComparisonField
+                                       Array(
+                                               'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.operatorsComparisonField',
+                                               '--div--'
+                                       ),
+
+                                       // contains value from field
+                                       Array(
+                                               'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.8',
+                                               '8'
+                                       ),
+
+                                       // contains not value from field
+                                       Array(
+                                               'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.operator.I.9',
+                                               '9'
+                                       ),
                                ),
                                'size' => 1,
                                'maxitems' => 1
@@ -80,7 +144,8 @@ $TCA['tx_powermailcond_domain_model_rule'] = array (
                                'cols' => '30',
                                'rows' => '2',
                        ),
-                       'displayCond' => 'FIELD:ops:IN:2,3,4,5,6,7' // show only if ops value is greater than 1
+                       // show only if ops value is greater than 1
+                       'displayCond' => 'FIELD:ops:IN:2,3,4,5,6,7'
                ),
                'equalField' => Array (
                        'exclude' => 1,
@@ -91,11 +156,12 @@ $TCA['tx_powermailcond_domain_model_rule'] = array (
                                        Array('LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules.equalField.I.0', '0'),
                                ),
                                'itemsProcFunc' => 'tx_powermailcond_fields_be->fieldname',
-                               'itemsProcFuncValue' => '"text","textarea","select","radio"', // allow only this types of fields in selector
+                               // allow only this types of fields in selector
+                               'itemsProcFuncValue' => '"text","textarea","select","radio"',
                                'size' => 1,
                                'maxitems' => 1
                        ),
-                       'displayCond' => 'FIELD:ops:IN:8,9' // show only if ops value is greater than 1
+                       'displayCond' => 'FIELD:ops:IN:8,9'
                ),
        ),
 );
\ No newline at end of file
index 8f44aa1..c2134de 100644 (file)
@@ -1,8 +1,14 @@
-page.headerData.3131 = TEXT
-page.headerData.3131.value (
+page.headerData.313131 = TEXT
+page.headerData.313131.value (
        <meta http-equiv="expires" content="0" />
        <meta http-equiv="cache-control" content="no-cache" />
        <meta http-equiv="pragma" content="no-cache" />
 )
 page.includeJSFooter.powermail_cond = EXT:powermail_cond/Resources/Public/Js/PowermailCond.js
-page.includeCSS.powermail_cond = EXT:powermail_cond/Resources/Public/Css/PowermailCond.css
\ No newline at end of file
+page.includeCSS.powermail_cond = EXT:powermail_cond/Resources/Public/Css/PowermailCond.css
+
+config.tx_extbase{
+       objects {
+               In2code\Powermail\Domain\Validator\StringValidator.className = In2code\PowermailCond\Domain\Model\Validator\StringValidator
+       }
+}
\ No newline at end of file
index 0f7611d..6bfe514 100644 (file)
@@ -28,11 +28,11 @@ jQuery(document).ready(function() {
                var url = base + '/index.php';
                var timestamp = Number(new Date()); // timestamp is needed for a internet explorer workarround (always change a parameter)
                var value = $this.val(); // current value
-               if ($(this).hasClass('powermail_checkbox') && !$(this).is(':checked')) { // clean value if checkbox was dechecked
+               if ($this.hasClass('powermail_checkbox') && !$this.is(':checked')) { // clean value if checkbox was dechecked
                        value = '';
                }
                var uid = $this.closest('.powermail_fieldwrap').attr('id').substr(20); // current field uid (without "uid")
-               var name = $this.attr('name');
+               var name = $this.prop('name');
                var params = 'eID=' + 'powermailcond_saveToSession' + '&tx_powermailcond_pi1[form]=' + getFormUid() + '&tx_powermailcond_pi1[uid]=' + uid + '&tx_powermailcond_pi1[value]=' + value + '&ts=' + timestamp;
 
                $.ajax({
@@ -57,10 +57,11 @@ jQuery(document).ready(function() {
  * @param int fieldValue               Field Value
  */
 function fieldValue(fieldUid, fieldValue) {
-       $('.powermail_field[name="tx_powermail_pi1[field][' + fieldUid + ']"]').val(fieldValue); // select, input, textarea
-       $('.powermail_radio[name="tx_powermail_pi1[field][' + fieldUid + ']"], .powermail_checkbox_' + fieldUid).each(function() { // radio, check
-               if ($(this).attr('value') == fieldValue) {
-                       $(this).attr('checked', 'checked');
+       var fieldWrap = $('#powermail_fieldwrap_' + fieldUid);
+       fieldWrap.find('input').not('[type="checkbox"]').val(fieldValue);
+       fieldWrap.find('input[type="checkbox"]').each(function() {
+               if ($(this).prop('value') == fieldValue) {
+                       $(this).prop('checked', 'checked');
                }
        })
 }
@@ -85,7 +86,7 @@ function checkConditions(uid) {
                success: function(data) {
                        if (data != 'nochange') {
                                $('.powermail_fieldwrap select option').removeClass('hide'); // show all options at the beginning
-                               $('.powermail_fieldwrap select option').removeAttr('disabled'); // enable all options at the beginning
+                               $('.powermail_fieldwrap select option').removeProp('disabled'); // enable all options at the beginning
                                if (data != '') { // if there is a response
                                        if (data.length < 1000) { // stop if wrong result (maybe complete t3 page)
                                                doAction(data); // hide all given fields
@@ -179,10 +180,10 @@ function hideFieldset(string) {
 function filterSelection(string) {
        var params = string.split(':'); // filter / uid / values
        var values = params[2].split(';'); // value1 / value2 / value3
-       $('.powermail_fieldwrap_' + params[1] + ' .powermail_field > option').addClass('hide').attr('disabled', 'disabled'); // disable all options
+       $('.powermail_fieldwrap_' + params[1] + ' .powermail_field > option').addClass('hide').prop('disabled', 'disabled'); // disable all options
 
        for (var j=0; j < values.length; j++) { // one loop for every option in select field
-               $('.powermail_fieldwrap_' + params[1] + ' .powermail_field > option:contains(' + values[j] + ')').removeClass('hide').removeAttr('disabled'); // show this option
+               $('.powermail_fieldwrap_' + params[1] + ' .powermail_field > option:contains(' + values[j] + ')').removeClass('hide').removeProp('disabled'); // show this option
        }
 
        var valueSelected = $('.powermail_fieldwrap_' + params[1] + ' .powermail_field > option:selected').val(); // give me the value of the selected option
@@ -210,14 +211,14 @@ function showAll() {
  */
 function deRequiredField(uid, disableAjaxRequest) {
        var element = $('*[name="tx_powermail_pi1[field][' + uid +']"]');
-       var classValue = element.attr('class');
+       var classValue = element.prop('class');
        if (classValue && classValue.indexOf('required') !== -1) {
                // replace validate[required] with [_required_]
                classValue = classValue.replace('required', '_required_');
-               element.attr('class', classValue);
+               element.prop('class', classValue);
 
                // remove required="required"
-               element.attr('required', false);
+               element.prop('required', false);
 
                // save this field in session so it's no mandatory field any more
                if (disableAjaxRequest !== undefined && disableAjaxRequest === true) {
@@ -238,16 +239,16 @@ function deRequiredField(uid, disableAjaxRequest) {
 function reRequiredAll() {
        $('.powermail_field').each(function() {
                var element = $(this);
-               var uid = element.closest('.powermail_fieldwrap').attr('id').substr(20);
-               var classValue = $(this).attr('class');
+               var uid = element.closest('.powermail_fieldwrap').prop('id').substr(20);
+               var classValue = $(this).prop('class');
                if (classValue.indexOf('_required_') !== -1) {
                        // replace validate[_required_] with [required]
                        classValue = classValue.replace('_required_', 'required');
-                       element.attr('class', classValue);
+                       element.prop('class', classValue);
 
                        // add required="required"
-                       if (element.attr('type') == 'text') {
-                               element.attr('required', 'required');
+                       if (element.prop('type') == 'text') {
+                               element.prop('required', 'required');
                        }
 
                        $.ajax({
@@ -266,8 +267,8 @@ function reRequiredAll() {
  * @return     void
  */
 function clearValue(selection) {
-       if ($(selection).attr('type') == 'radio' || $(selection).attr('type') == 'checkbox') {
-               $(selection).attr('checked', false);
+       if ($(selection).prop('type') == 'radio' || $(selection).prop('type') == 'checkbox') {
+               $(selection).prop('checked', false);
        } else {
                $(selection).not(':submit').val('');
        }
@@ -279,7 +280,7 @@ function clearValue(selection) {
  * @return string      BaseUrl from Tag in DOM
  */
 function getBaseUrl() {
-       var base = $('base').attr('href');
+       var base = $('base').prop('href');
        if (!base || base == undefined) {
                base = '';
        }
@@ -332,16 +333,9 @@ function clearFullSession() {
  * @return int         Form uid
  */
 function getFormUid() {
-       if ($('.powermail_form').length === 0) {
+       var formField = $('input[name="tx_powermail_pi1[mail][form]"]');
+       if (formField.length === 0) {
                return 0;
        }
-       var classes = $('.powermail_form:first').attr('class').split(' ');
-       for (var i=0; i < classes.length; i++) {
-               if (classes[i].indexOf('powermail_form_') !== -1) {
-                       var currentClass = classes[i];
-               }
-       }
-
-       var formUid = currentClass.substr(15);
-       return formUid;
+       return formField.val();
 }
\ No newline at end of file
index 6d817e1..4fc9787 100644 (file)
@@ -15,7 +15,7 @@ $EM_CONF[$_EXTKEY] = array(
        'description' => 'Add conditions via AJAX to powermail 2.x forms (fields and fieldsets). This extension uses jQuery as JavaScript Library.',
        'category' => 'plugin',
        'shy' => 0,
-       'version' => '2.0.3',
+       'version' => '2.1.0alpha',
        'dependencies' => 'powermail',
        'conflicts' => '',
        'priority' => '',
@@ -34,7 +34,7 @@ $EM_CONF[$_EXTKEY] = array(
        'CGLcompliance_note' => '',
        'constraints' => array(
                'depends' => array(
-                       'powermail' => '2.0.4-2.0.99',
+                       'powermail' => '2.1.0-2.1.99',
                        'extbase' => '4.7.0-6.2.99',
                        'fluid' => '4.7.0-6.2.99',
                        'typo3' => '4.7.0-6.2.99',
index 46119c7..6b4f40e 100644 (file)
@@ -13,35 +13,34 @@ $TYPO3_CONF_VARS['EXTCONF']['cms']['db_layout']['addTables']['tx_powermailcond_d
 /**
  * eID Scripts
  */
-
 // eID for telling jQuery which values are allowed and which not (via AJAX)
 $GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['powermailcond_getFieldStatus'] =
-       'EXT:powermail_cond/Classes/Utility/EidGetFieldlist.php';
+       'EXT:powermail_cond/Classes/Utility/Eid/GetFieldlistEid.php';
 
 // eID for storing values in the session (via AJAX)
 $GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['powermailcond_saveToSession'] =
-       'EXT:powermail_cond/Classes/Utility/EidSaveInSession.php';
+       'EXT:powermail_cond/Classes/Utility/Eid/SaveInSessionEid.php';
 
 // eID for reading existing values from session (via AJAX)
 $GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['powermailcond_readSession'] =
-       'EXT:powermail_cond/Classes/Utility/EidReadSession.php';
+       'EXT:powermail_cond/Classes/Utility/Eid/ReadSessionEid.php';
 
 // eID to clean session to a form completely (via AJAX)
 $GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['powermailcond_clearSession'] =
-       'EXT:powermail_cond/Classes/Utility/EidClearSession.php';
+       'EXT:powermail_cond/Classes/Utility/Eid/ClearSessionEid.php';
 
-// eID to save a field in a separate session to select a field to be non-mandatory
+// eID to save a field in a separate session to set to be non-mandatory
 $GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['powermailcond_deRequiredField'] =
-       'EXT:powermail_cond/Classes/Utility/EidDeRequiredField.php';
+       'EXT:powermail_cond/Classes/Utility/Eid/DeRequiredFieldEid.php';
 
-// eID to save some fields in a separate session to select a field to be non-mandatory
+// eID to save some fields in a separate session to set to be non-mandatory
 $GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['powermailcond_deRequiredFields'] =
-       'EXT:powermail_cond/Classes/Utility/EidDeRequiredFields.php';
+       'EXT:powermail_cond/Classes/Utility/Eid/DeRequiredFieldsEid.php';
 
 // eID to remove a field from session to select a field to be mandatory again
 $GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['powermailcond_requiredField'] =
-       'EXT:powermail_cond/Classes/Utility/EidRequiredField.php';
+       'EXT:powermail_cond/Classes/Utility/Eid/RequiredFieldEid.php';
 
 // eID to read all session values for debugging (only if logged in into Backend)
 $GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['powermailcond_debugSession'] =
-       'EXT:powermail_cond/Classes/Utility/EidDebugSession.php';
\ No newline at end of file
+       'EXT:powermail_cond/Classes/Utility/Eid/DebugSessionEid.php';
\ No newline at end of file
index 2fb0cd1..9450523 100644 (file)
@@ -5,15 +5,20 @@ if (!defined ('TYPO3_MODE')) {
 
 // Fieldlisting in Backend
 if (TYPO3_MODE == 'BE') {
-       include_once(t3lib_extMgm::extPath('powermail_cond') . 'Classes/Utility/FieldlistingBackend.php');
+       require_once(
+               \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('powermail_cond') . 'Classes/Utility/Tca/FieldlistingBackend.php'
+       );
 }
 
 // Add TypoScript Static Template
-t3lib_extMgm::addStaticFile($_EXTKEY, 'Configuration/TypoScript/', 'Main TypoScript');
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile($_EXTKEY, 'Configuration/TypoScript/', 'Main TypoScript');
 
 // Configuration for Conditions
-t3lib_extMgm::addLLrefForTCAdescr('tx_powermailcond_domain_model_condition', 'EXT:powermail_cond/Resources/Private/Language/locallang_csh_tx_powermailcond_domain_model_condition.xml');
-t3lib_extMgm::allowTableOnStandardPages('tx_powermailcond_domain_model_condition');
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr(
+       'tx_powermailcond_domain_model_condition',
+       'EXT:powermail_cond/Resources/Private/Language/locallang_csh_tx_powermailcond_domain_model_condition.xml'
+);
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_powermailcond_domain_model_condition');
 $TCA['tx_powermailcond_domain_model_condition'] = array (
        'ctrl' => array (
                'title'     => 'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_conditions',
@@ -32,14 +37,20 @@ $TCA['tx_powermailcond_domain_model_condition'] = array (
                        'endtime' => 'endtime'
                ),
                'requestUpdate' => 'actions,form',
-               'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY) . 'Configuration/TCA/Condition.php',
-               'iconfile'          => t3lib_extMgm::extRelPath($_EXTKEY) . '/Resources/Public/Icons/icon_tx_powermailcond_conditions.gif',
+               'dynamicConfigFile' =>
+                       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'Configuration/TCA/Condition.php',
+               'iconfile' =>
+                       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath($_EXTKEY) .
+                       '/Resources/Public/Icons/icon_tx_powermailcond_conditions.gif'
        ),
 );
 
 // Configuration for Rules
-t3lib_extMgm::addLLrefForTCAdescr('tx_powermailcond_domain_model_rule', 'EXT:powermail_cond/Resources/Private/Language/locallang_csh_tx_powermailcond_domain_model_rule.xml');
-t3lib_extMgm::allowTableOnStandardPages('tx_powermailcond_domain_model_rule');
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr(
+       'tx_powermailcond_domain_model_rule',
+       'EXT:powermail_cond/Resources/Private/Language/locallang_csh_tx_powermailcond_domain_model_rule.xml'
+);
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_powermailcond_domain_model_rule');
 $TCA['tx_powermailcond_domain_model_rule'] = array (
        'ctrl' => array (
                'title'     => 'LLL:EXT:powermail_cond/Resources/Private/Language/locallang_db.xml:tx_powermailcond_rules',
@@ -53,7 +64,10 @@ $TCA['tx_powermailcond_domain_model_rule'] = array (
                        'disabled' => 'hidden'
                ),
                'requestUpdate' => 'ops',
-               'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY) . 'Configuration/TCA/Rule.php',
-               'iconfile'          => t3lib_extMgm::extRelPath($_EXTKEY) . '/Resources/Public/Icons/icon_tx_powermailcond_rules.gif'
+               'dynamicConfigFile' =>
+                       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'Configuration/TCA/Rule.php',
+               'iconfile' =>
+                       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath($_EXTKEY) .
+                       '/Resources/Public/Icons/icon_tx_powermailcond_rules.gif'
        ),
 );
\ No newline at end of file
diff --git a/ext_typoscript_setup.txt b/ext_typoscript_setup.txt
deleted file mode 100644 (file)
index a4d7f85..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-config.tx_extbase{
-       objects {
-               Tx_Powermail_Domain_Validator_MandatoryValidator.className = Tx_PowermailCond_Domain_Validator_MandatoryValidator
-       }
-}
\ No newline at end of file