27
27
* @author Tolleiv Nietsch <info@tolleiv.de>
28
28
*/
29
29
30
- require_once (t3lib_extMgm::extPath ('imagemap_wizard ' ). 'classes/model/class.tx_imagemapwizard_model_dataObject.php ' );
30
+ require_once (t3lib_extMgm::extPath ('imagemap_wizard ' ) . 'classes/model/class.tx_imagemapwizard_model_dataObject.php ' );
31
31
32
32
class tx_imagemapwizard_controller_wizard {
33
33
protected $ view ;
34
34
protected $ context = 'wizard ' ;
35
35
protected $ ajax = false ;
36
36
protected $ params ;
37
37
protected $ forceValue ;
38
+
38
39
/**
39
40
* Initialize Context and required View
40
41
*/
@@ -48,9 +49,9 @@ public function __construct() {
48
49
*/
49
50
protected function wizardAction () {
50
51
$ params = t3lib_div::_GP ('P ' );
51
- $ currentValue = $ GLOBALS ['BE_USER ' ]->getSessionData ('imagemap_wizard.value ' );
52
- //TODO: use-Flex-DataObject if needed
53
- $ this ->view ->setData ($ this ->makeDataObj ($ params ['table ' ],$ params ['field ' ],$ params ['uid ' ],$ currentValue ));
52
+ $ currentValue = $ GLOBALS ['BE_USER ' ]->getSessionData ('imagemap_wizard.value ' );
53
+ //TODO: use-Flex-DataObject if needed
54
+ $ this ->view ->setData ($ this ->makeDataObj ($ params ['table ' ], $ params ['field ' ], $ params ['uid ' ], $ currentValue ));
54
55
$ this ->view ->renderContent ();
55
56
}
56
57
@@ -60,11 +61,12 @@ protected function wizardAction() {
60
61
*/
61
62
protected function tceformAction () {
62
63
63
- $ data = $ this ->makeDataObj ($ this ->params ['table ' ],$ this ->params ['field ' ],$ this ->params ['uid ' ],$ this ->forceValue );
64
+ $ data = $ this ->makeDataObj ($ this ->params ['table ' ], $ this ->params ['field ' ], $ this ->params ['uid ' ], $ this ->forceValue );
64
65
$ data ->setFieldConf ($ this ->params ['fieldConf ' ]);
65
66
66
67
$ this ->view ->setData ($ data );
67
- $ this ->view ->setTCEForm ($ this ->params ['pObj ' ]);;
68
+ $ this ->view ->setTCEForm ($ this ->params ['pObj ' ]);
69
+
68
70
$ this ->view ->setFormName ($ this ->params ['itemFormElName ' ]);
69
71
$ this ->view ->setWizardConf ($ this ->params ['fieldConf ' ]['config ' ]['wizards ' ]);
70
72
t3lib_div::loadTCA ($ this ->params ['table ' ]);
@@ -80,38 +82,37 @@ protected function tceformAjaxAction() {
80
82
$ this ->params ['field ' ] = t3lib_div::_GP ('field ' );
81
83
$ this ->params ['uid ' ] = t3lib_div::_GP ('uid ' );
82
84
$ this ->params ['fieldConf ' ] = unserialize (stripslashes ((t3lib_div::_GP ('config ' ))));
83
- require_once (PATH_t3lib. "class.t3lib_tceforms.php " );
85
+ require_once (PATH_t3lib . "class.t3lib_tceforms.php " );
84
86
$ this ->params ['pObj ' ] = t3lib_div::makeInstance ('t3lib_TCEforms ' );
85
87
$ this ->params ['pObj ' ]->initDefaultBEMode ();
86
88
$ this ->params ['itemFormElName ' ] = t3lib_div::_GP ('formField ' );
87
89
88
90
$ this ->forceValue = t3lib_div::_GP ('value ' );
89
- $ GLOBALS ['BE_USER ' ]->setAndSaveSessionData ('imagemap_wizard.value ' ,$ this ->forceValue );
91
+ $ GLOBALS ['BE_USER ' ]->setAndSaveSessionData ('imagemap_wizard.value ' , $ this ->forceValue );
90
92
echo $ this ->tceformAction ();
91
93
}
92
94
93
95
94
-
95
96
/**
96
97
* Execute required action which is determined by the given context
97
98
*/
98
99
public function triggerAction () {
99
- $ action = $ this ->context . ($ this ->ajax ? 'Ajax ' : '' ). 'Action ' ;
100
- return call_user_func_array (array ($ this , $ action ),array ());
100
+ $ action = $ this ->context . ($ this ->ajax ? 'Ajax ' : '' ) . 'Action ' ;
101
+ return call_user_func_array (array ($ this , $ action ), array ());
101
102
}
102
103
103
104
/**
104
105
* Determine context
105
106
*/
106
- protected function initContext ($ forceContext= NULL ) {
107
+ protected function initContext ($ forceContext = NULL ) {
107
108
$ reqContext = $ forceContext ? $ forceContext : t3lib_div::_GP ('context ' );
108
109
$ this ->context = ($ reqContext == 'tceform ' ) ? 'tceform ' : 'wizard ' ;
109
- $ this ->ajax = (t3lib_div::_GP ('ajax ' ) == '1 ' );
110
+ $ this ->ajax = (t3lib_div::_GP ('ajax ' ) == '1 ' );
110
111
}
111
112
112
113
protected function initView () {
113
- require_once (t3lib_extMgm::extPath ('imagemap_wizard ' ). 'classes/view/class.tx_imagemapwizard_view_ ' . $ this ->context . '.php ' );
114
- $ this ->view = t3lib_div::makeInstance ('tx_imagemapwizard_view_ ' . $ this ->context );
114
+ require_once (t3lib_extMgm::extPath ('imagemap_wizard ' ) . 'classes/view/class.tx_imagemapwizard_view_ ' . $ this ->context . '.php ' );
115
+ $ this ->view = t3lib_div::makeInstance ('tx_imagemapwizard_view_ ' . $ this ->context );
115
116
$ this ->view ->init ($ this ->context );
116
117
}
117
118
@@ -124,12 +125,12 @@ protected function initView() {
124
125
* @return String HTMLCode with form-field
125
126
*/
126
127
public function renderForm ($ PA , t3lib_TCEforms $ fobj ) {
127
- $ GLOBALS ['BE_USER ' ]->setAndSaveSessionData ('imagemap_wizard.value ' ,NULL );
128
+ $ GLOBALS ['BE_USER ' ]->setAndSaveSessionData ('imagemap_wizard.value ' , NULL );
128
129
$ this ->params ['table ' ] = $ PA ['table ' ];
129
- if ($ GLOBALS ['TCA ' ][$ PA ['table ' ]]['columns ' ][$ PA ['field ' ]]['config ' ]['type ' ] == 'flex ' ) {
130
- $ parts = array_slice (explode ('][ ' ,$ PA ['itemFormElName ' ]),3 );
131
- $ field = substr (implode ('/ ' ,$ parts ),0 , -1 );
132
- $ this ->params ['field ' ] = sprintf ('%s:%d:%s:%s ' ,$ PA ['table ' ],$ PA ['row ' ]['uid ' ],$ PA ['field ' ],$ field );
130
+ if ($ GLOBALS ['TCA ' ][$ PA ['table ' ]]['columns ' ][$ PA ['field ' ]]['config ' ]['type ' ] == 'flex ' ) {
131
+ $ parts = array_slice (explode ('][ ' , $ PA ['itemFormElName ' ]), 3 );
132
+ $ field = substr (implode ('/ ' , $ parts ), 0 , -1 );
133
+ $ this ->params ['field ' ] = sprintf ('%s:%d:%s:%s ' , $ PA ['table ' ], $ PA ['row ' ]['uid ' ], $ PA ['field ' ], $ field );
133
134
} else {
134
135
$ this ->params ['field ' ] = $ PA ['field ' ];
135
136
}
@@ -154,7 +155,7 @@ public function renderForm($PA, t3lib_TCEforms $fobj) {
154
155
* @return tx_imagemapwizard_model_dataObject
155
156
*/
156
157
protected function makeDataObj ($ table , $ field , $ uid , $ value ) {
157
- if (version_compare (TYPO3_version,'4.3.0 ' ,'< ' )) {
158
+ if (version_compare (TYPO3_version, '4.3.0 ' , '< ' )) {
158
159
$ dataClass = t3lib_div::makeInstanceClassName ('tx_imagemapwizard_model_dataObject ' );
159
160
$ data = new $ dataClass ($ table , $ field , $ uid , $ value );
160
161
} else {
@@ -164,7 +165,7 @@ protected function makeDataObj($table, $field, $uid, $value) {
164
165
}
165
166
}
166
167
167
- if (defined ('TYPO3_MODE ' ) && $ TYPO3_CONF_VARS [TYPO3_MODE ]['XCLASS ' ]['ext/imagemap_wizard/classes/controller/class.tx_imagemapwizard_controller_wizard.php ' ]) {
168
+ if (defined ('TYPO3_MODE ' ) && $ TYPO3_CONF_VARS [TYPO3_MODE ]['XCLASS ' ]['ext/imagemap_wizard/classes/controller/class.tx_imagemapwizard_controller_wizard.php ' ]) {
168
169
include_once ($ TYPO3_CONF_VARS [TYPO3_MODE ]['XCLASS ' ]['ext/imagemap_wizard/classes/controller/class.tx_imagemapwizard_controller_wizard.php ' ]);
169
170
}
170
171
0 commit comments