[!!!][TASK] remove tx_form postprocessor stuff 39/36639/3 master
authortritum_rz <ralf.zimmermann@tritum.de>
Tue, 3 Feb 2015 21:10:34 +0000 (22:10 +0100)
committerRalf Zimmermann <ralf.zimmermann@tritum.de>
Tue, 3 Feb 2015 21:11:47 +0000 (22:11 +0100)
Resolves: #61854
Releases: 6.2, 4.7, 4.5
Change-Id: Ied70c506c01e19196a2c306095ca901ed9f483f5
Reviewed-on: http://review.typo3.org/36639
Reviewed-by: Ralf Zimmermann <ralf.zimmermann@tritum.de>
Tested-by: Ralf Zimmermann <ralf.zimmermann@tritum.de>
Classes/Extensions/Form/PostProcess/WtspamshieldmailPostProcessor.php [deleted file]
Classes/Extensions/Form/PostProcess/WtspamshieldvalidatorPostProcessor.php [deleted file]
Classes/Extensions/Form/View/Mail/Html/HtmlView.php [deleted file]
Classes/Extensions/Form/View/Mail/Plain/PlainView.php [deleted file]
ext_autoload.php

diff --git a/Classes/Extensions/Form/PostProcess/WtspamshieldmailPostProcessor.php b/Classes/Extensions/Form/PostProcess/WtspamshieldmailPostProcessor.php
deleted file mode 100755 (executable)
index 305a88a..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-<?php
-namespace TYPO3\CMS\Form\PostProcess;
-
-/***************************************************************
- *
- *  Copyright notice
- *
- *  (c) 2015 Ralf Zimmermann <ralf.zimmermann@tritum.de>, TRITUM GmbH
- *
- *  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!
- ***************************************************************/
-
-/**
- * WtspamshieldmailPostProcessor
- */
-class WtspamshieldmailPostProcessor extends \TYPO3\CMS\Form\PostProcess\MailPostProcessor {
-
-       /**
-        * Constructor
-        *
-        * @param \TYPO3\CMS\Form\Domain\Model\Form $form Form domain model
-        * @param array $typoScript Post processor TypoScript settings
-        */
-       public function __construct(\TYPO3\CMS\Form\Domain\Model\Form $form, array $typoScript) {
-               parent::__construct($form, $typoScript);
-       }
-
-       /**
-        * Add the HTML content
-        *
-        * Add a MimePart of the type text/html to the message.
-        *
-        * @return void
-        */
-       public function setHtmlContent() {
-               /** @var $view \TYPO3\CMS\Form\View\Mail\Html\HtmlView */
-               $view = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TRITUM\\WtSpamshield\\Form\\View\\Mail\\Html\\HtmlView', $this->form, $this->typoScript);
-               $htmlContent = $view->get();
-               $this->mailMessage->setBody($htmlContent, 'text/html');
-       }
-
-       /**
-        * Add the plain content
-        *
-        * Add a MimePart of the type text/plain to the message.
-        *
-        * @return void
-        */
-       public function setPlainContent() {
-               /** @var $view \TYPO3\CMS\Form\View\Mail\Plain\PlainView */
-               $view = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TRITUM\\WtSpamshield\\Form\\View\\Mail\\Plain\\PlainView', $this->form, 0, $this->typoScript);
-               $plainContent = $view->render();
-               $this->mailMessage->addPart($plainContent, 'text/plain');
-       }
-}
diff --git a/Classes/Extensions/Form/PostProcess/WtspamshieldvalidatorPostProcessor.php b/Classes/Extensions/Form/PostProcess/WtspamshieldvalidatorPostProcessor.php
deleted file mode 100755 (executable)
index cf417e5..0000000
+++ /dev/null
@@ -1,160 +0,0 @@
-<?php
-namespace TYPO3\CMS\Form\PostProcess;
-
-/***************************************************************
- *
- *  Copyright notice
- *
- *  (c) 2015 Ralf Zimmermann <ralf.zimmermann@tritum.de>, TRITUM GmbH
- *
- *  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!
- ***************************************************************/
-
-/**
- * WtspamshieldvalidatorPostProcessor
- */
-class WtspamshieldvalidatorPostProcessor implements \TYPO3\CMS\Form\PostProcess\PostProcessorInterface {
-
-       /**
-        * @var tx_wtspamshield_div
-        */
-       protected $div;
-
-       /**
-        * @var mixed
-        */
-       public $additionalValues = array();
-
-       /**
-        * @var string
-        */
-       public $tsKey = 'standardMailform';
-
-       /**
-        * @var mixed
-        */
-       public $tsConf;
-
-       /**
-        * @var \TYPO3\CMS\Form\Domain\Model\Form
-        */
-       public $form;
-
-       /**
-        * @var array
-        */
-       public $typoScript;
-
-       /**
-        * @var \TYPO3\CMS\Form\Request
-        */
-       public $requestHandler;
-
-       /**
-        * Constructor
-        *
-        * @param \TYPO3\CMS\Form\Domain\Model\Form $form Form domain model
-        * @param array $typoScript Post processor TypoScript settings
-        */
-       public function __construct(\TYPO3\CMS\Form\Domain\Model\Form $form, array $typoScript) {
-               $this->form = $form;
-               $this->typoScript = $typoScript;
-               $this->requestHandler = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Form\\Request');
-
-               $this->tsConf = $this->getDiv()->getTsConf();
-               $honeypotInputName = $this->tsConf['honeypot.']['inputname.'][$this->tsKey];
-               $this->additionalValues['honeypotCheck']['prefixInputName'] = 'tx_form';
-               $this->additionalValues['honeypotCheck']['honeypotInputName'] = $honeypotInputName;
-
-       }
-
-       /**
-        *
-        * @return void
-        */
-       public function process() {
-               if ( $this->getDiv()->isActivated($this->tsKey) ) {
-                       $error = '';
-
-                       $this->requestHandler->setMethod('session');
-                       if ($this->requestHandler->hasRequest()) {
-                               $validateArray = $this->requestHandler->getSession();
-                               $error = $this->validate($validateArray);
-                       } else if ($this->requestHandler->getPost()) {
-                               $validateArray = $this->requestHandler->getPost();
-                               $error = $this->validate($validateArray);
-                       } else {
-                               $error = 'no form data';
-                       }
-
-                       $urlConf = array('parameter' => 0);
-
-                       if (strlen($error) > 0) {
-                               if ($this->typoScript['errorDestination']) {
-                                       $urlConf = array('parameter' => $this->typoScript['errorDestination']);
-                               }
-
-                               $this->requestHandler->destroySession();
-                               $destination = $GLOBALS['TSFE']->cObj->typoLink_URL($urlConf);
-                               \TYPO3\CMS\Core\Utility\HttpUtility::redirect($destination);
-                       }
-               }
-       }
-
-       /**
-        * getDiv
-        * 
-        * @return tx_wtspamshield_div
-        */
-       protected function getDiv() {
-               if (!isset($this->div)) {
-                       $this->div = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_wtspamshield_div');
-               }
-               return $this->div;
-       }
-
-       /**
-        * validate
-        * 
-        * @param array $fieldValues
-        * @return string
-        */
-       protected function validate(array $fieldValues) {
-
-               $availableValidators =
-                       array(
-                               'blacklistCheck',
-                               'httpCheck',
-                               'honeypotCheck',
-                               'akismetCheck'
-                       );
-
-               $tsValidators = $this->getDiv()->commaListToArray($this->tsConf['validators.'][$this->tsKey . '_new.']['enable']);
-
-               $processor = $this->getDiv()->getProcessor();
-               $processor->tsKey = $this->tsKey;
-               $processor->fieldValues = $fieldValues;
-               $processor->additionalValues = $this->additionalValues;
-               $processor->failureRate = intval($this->tsConf['validators.'][$this->tsKey . '_new.']['how_many_validators_can_fail']);
-               $processor->methodes = array_intersect($tsValidators, $availableValidators);
-
-               $error = $processor->validate();
-               return $error;
-       }
-}
diff --git a/Classes/Extensions/Form/View/Mail/Html/HtmlView.php b/Classes/Extensions/Form/View/Mail/Html/HtmlView.php
deleted file mode 100755 (executable)
index bfc0c68..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-<?php
-namespace TRITUM\WtSpamshield\Form\View\Mail\Html;
-
-/***************************************************************
- *
- *  Copyright notice
- *
- *  (c) 2015 Ralf Zimmermann <ralf.zimmermann@tritum.de>, TRITUM GmbH
- *
- *  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!
- ***************************************************************/
-
-/**
- * HtmlView
- */
-class HtmlView extends \TYPO3\CMS\Form\View\Mail\Html\HtmlView {
-
-       /**
-        * Constructor
-        */
-       public function __construct(\TYPO3\CMS\Form\Domain\Model\Form $model, array $typoscript) {
-               parent::__construct($model, $typoscript);
-       }
-
-       /**
-        * Start the main DOMdocument for the form
-        * Return it as a string using saveXML() to get a proper formatted output
-        * (when using formatOutput :-)
-        *
-        * @return string XHTML string containing the whole form
-        */
-       public function get() {
-               if (is_array($this->typoscript['excludeFieldsFromMail.'])) {
-                       $excludeFields = $this->typoscript['excludeFieldsFromMail.'];
-               } else {
-                       $excludeFields = array();
-               }
-
-               $elements = $this->model->getElements();
-               $newElements = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('\\TYPO3\\CMS\\Form\\Domain\\Model\\Form');
-
-               foreach ($elements as $element) {
-                       $_elements = $element->getElements();
-
-                       foreach ($_elements as $_element) {
-                               if (!in_array($_element->getName(), $excludeFields)) {
-                                       $newElements->addElement($_element);
-                               }
-                       }
-               }
-               $this->setData($newElements);
-
-               $node = $this->render('element', FALSE);
-               $content = chr(10) . html_entity_decode($node->saveXML($node->firstChild), ENT_QUOTES, 'UTF-8') . chr(10);
-               return $content;
-       }
-
-}
diff --git a/Classes/Extensions/Form/View/Mail/Plain/PlainView.php b/Classes/Extensions/Form/View/Mail/Plain/PlainView.php
deleted file mode 100755 (executable)
index 6093e71..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-<?php
-namespace TRITUM\WtSpamshield\Form\View\Mail\Plain;
-
-/***************************************************************
- *
- *  Copyright notice
- *
- *  (c) 2015 Ralf Zimmermann <ralf.zimmermann@tritum.de>, TRITUM GmbH
- *
- *  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!
- ***************************************************************/
-
-/**
- * PlainView
- */
-class PlainView extends \TYPO3\CMS\Form\View\Mail\Plain\PlainView {
-
-       /**
-        * The TypoScript settings for the confirmation
-        *
-        * @var array
-        */
-       protected $typoscript = array();
-
-       /**
-        * Constructor
-        *
-        * @param \TYPO3\CMS\Form\Domain\Model\Form $model
-        * @param integer $spaces
-        * @param array $typoscript
-        */
-       public function __construct(\TYPO3\CMS\Form\Domain\Model\Form $model, $spaces = 0, array $typoscript) {
-               $this->typoscript = $typoscript;
-               parent::__construct($model, $spaces);
-       }
-
-       /**
-        * @return string Plain content containing the submitted values
-        */
-       public function render() {
-               if (is_array($this->typoscript['excludeFieldsFromMail.'])) {
-                       $excludeFields = $this->typoscript['excludeFieldsFromMail.'];
-               } else {
-                       $excludeFields = array();
-               }
-
-               $elements = $this->model->getElements();
-               $newElements = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('\\TYPO3\\CMS\\Form\\Domain\\Model\\Form');
-
-               foreach ($elements as $element) {
-                       $_elements = $element->getElements();
-
-                       foreach ($_elements as $_element) {
-                               if (!in_array($_element->getName(), $excludeFields)) {
-                                       $newElements->addElement($_element);
-                               }
-                       }
-               }
-
-               $content = $this->renderChildren($newElements->getElements());
-               return $content;
-       }
-
-}
index 3ed1b61..f0195fb 100644 (file)
@@ -26,10 +26,6 @@ $return = array(
 'tx_wtspamshield_powermail2' => $extPath . 'Classes/Extensions/class.tx_wtspamshield_powermail2.php',
 'Tx_WtSpamshieldFormhandler_Interceptor_WtSpamshield' => $extPath . 'Classes/Extensions/Tx_WtSpamshieldFormhandler_Interceptor_WtSpamshield.php',
 
-'TYPO3\CMS\Form\PostProcess\WtspamshieldmailPostProcessor' => $extPath . 'Classes/Extensions/Form/PostProcess/WtspamshieldmailPostProcessor.php',
-'TYPO3\CMS\Form\PostProcess\WtspamshieldvalidatorPostProcessor' => $extPath . 'Classes/Extensions/Form/PostProcess/WtspamshieldvalidatorPostProcessor.php',
-'TRITUM\WtSpamshield\Form\View\Mail\Plain\PlainView' => $extPath . 'Classes/Extensions/Form/View/Mail/Plain/PlainView.php',
-'TRITUM\WtSpamshield\Form\View\Mail\Html\HtmlView' => $extPath . 'Classes/Extensions/Form/View/Mail/Html/HtmlView.php',
 );
 
 return $return;