issue32701.diff

Diff of the changes to implement Oliver's suggestions. - Franz Geiger, 2012-02-13 13:45

Download (3.46 KB)

View differences:

typo3/sysext/form/Classes/System/Postprocessor/Interface.php
1
<?php
2
/***************************************************************
3
*  Copyright notice
4
*
5
*  (c) 2012
6
*  All rights reserved
7
*
8
*  This script is part of the TYPO3 project. The TYPO3 project is
9
*  free software; you can redistribute it and/or modify
10
*  it under the terms of the GNU General Public License as published by
11
*  the Free Software Foundation; either version 2 of the License, or
12
*  (at your option) any later version.
13
*
14
*  The GNU General Public License can be found at
15
*  http://www.gnu.org/copyleft/gpl.html.
16
*
17
*  This script is distributed in the hope that it will be useful,
18
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
19
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
*  GNU General Public License for more details.
21
*
22
*  This copyright notice MUST APPEAR in all copies of the script!
23
***************************************************************/
24

  
25
/**
26
 * Interface for postprocessors
27
 *
28
 * @author Franz Geiger <mail@fx-g.de>
29
 * @package TYPO3
30
 * @subpackage form
31
 */
32
interface tx_form_System_Postprocessor_Interface {
33

  
34
	/**
35
	 * Constructor
36
	 *
37
	 * @param $form tx_form_Domain_Model_Form Form domain model
38
	 * @param $typoscript array Post processor TypoScript settings
39
	 * @return void
40
	 */
41
	public function __construct(tx_form_Domain_Model_Form $form, array $typoScript);
42

  
43
	/**
44
	 * The main method called by the post processor
45
	 *
46
	 * @param mixed $value
47
	 * @return mixed
48
	 */
49
	public function process();
50
}
51
?>
typo3/sysext/form/Classes/System/Postprocessor/Mail.php
29 29
 * @package TYPO3
30 30
 * @subpackage form
31 31
 */
32
class tx_form_System_Postprocessor_Mail {
32
class tx_form_System_Postprocessor_Mail implements tx_form_System_Postprocessor_Interface {
33 33
	/**
34 34
	 * @var tx_form_Domain_Model_Form
35 35
	 */
......
350 350
		}
351 351
	}
352 352
}
353
?>
353
?>
typo3/sysext/form/Classes/System/Postprocessor/Postprocessor.php
67 67
					$processorArguments = $this->typoScript[$key . '.'];
68 68
				}
69 69

  
70
				if (class_exists($className, TRUE)) {
71
					$processor = t3lib_div::makeInstance($className, $this->form, $processorArguments);
70
				if(class_exists($this->typoScript[$key], TRUE)) {
71
					$processor = t3lib_div::makeInstance($this->typoScript[$key], $this->form, $processorArguments);
72 72
					$html .= $processor->process();
73
				} else {
74
					if (class_exists($className, TRUE)) {
75
						$processor = t3lib_div::makeInstance($className, $this->form, $processorArguments);
76
						$html .= $processor->process();
77
					}
73 78
				}
74 79
			}
75 80
		}
......
77 82
		return $html;
78 83
	}
79 84
}
80
?>
85
?>