@@ -28,18 +28,18 @@ discard block |
||
28 | 28 | * @param array $local List of local translation entries overwriting the standard ones |
29 | 29 | * @return array List of translation objects implementing \Aimeos\Base\Translation\Iface |
30 | 30 | */ |
31 | - public static function get(array $i18nPaths, array $languageIds, array $local = []) : array |
|
31 | + public static function get( array $i18nPaths, array $languageIds, array $local = [] ) : array |
|
32 | 32 | { |
33 | 33 | $i18nList = []; |
34 | 34 | |
35 | - foreach ($languageIds as $langid) { |
|
36 | - if (in_array($langid, ['', 'default'])) { continue; } |
|
35 | + foreach( $languageIds as $langid ) { |
|
36 | + if( in_array( $langid, ['', 'default'] ) ) { continue; } |
|
37 | 37 | |
38 | - if (!isset(self::$i18n[$langid])) { |
|
39 | - $i18n = new \Aimeos\Base\Translation\Gettext($i18nPaths, $langid); |
|
38 | + if( !isset( self::$i18n[$langid] ) ) { |
|
39 | + $i18n = new \Aimeos\Base\Translation\Gettext( $i18nPaths, $langid ); |
|
40 | 40 | |
41 | - if ((bool) \Aimeos\Aimeos\Base::getExtConfig('useAPC', false) === true) { |
|
42 | - $i18n = new \Aimeos\Base\Translation\Decorator\APC($i18n, \Aimeos\Aimeos\Base::getExtConfig('apcPrefix', 't3:')); |
|
41 | + if( (bool) \Aimeos\Aimeos\Base::getExtConfig( 'useAPC', false ) === true ) { |
|
42 | + $i18n = new \Aimeos\Base\Translation\Decorator\APC( $i18n, \Aimeos\Aimeos\Base::getExtConfig( 'apcPrefix', 't3:' ) ); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | self::$i18n[$langid] = $i18n; |
@@ -47,9 +47,9 @@ discard block |
||
47 | 47 | |
48 | 48 | $i18nList[$langid] = self::$i18n[$langid]; |
49 | 49 | |
50 | - if (isset($local[$langid])) { |
|
51 | - $translations = self::parseTranslations((array) $local[$langid]); |
|
52 | - $i18nList[$langid] = new \Aimeos\Base\Translation\Decorator\Memory($i18nList[$langid], $translations); |
|
50 | + if( isset( $local[$langid] ) ) { |
|
51 | + $translations = self::parseTranslations( (array) $local[$langid] ); |
|
52 | + $i18nList[$langid] = new \Aimeos\Base\Translation\Decorator\Memory( $i18nList[$langid], $translations ); |
|
53 | 53 | } |
54 | 54 | } |
55 | 55 | |
@@ -63,17 +63,17 @@ discard block |
||
63 | 63 | * @param array $entries User-defined translation entries via TypoScript |
64 | 64 | * @return array Associative list of translation domain and original string / list of tranlations |
65 | 65 | */ |
66 | - protected static function parseTranslations(array $entries) : array |
|
66 | + protected static function parseTranslations( array $entries ) : array |
|
67 | 67 | { |
68 | 68 | $translations = []; |
69 | 69 | |
70 | - foreach ($entries as $entry) { |
|
71 | - if (isset($entry['domain']) && isset($entry['string']) && isset($entry['trans'])) { |
|
72 | - $string = str_replace(['\\n', '\\'], ["\n", ''], $entry['string']); |
|
70 | + foreach( $entries as $entry ) { |
|
71 | + if( isset( $entry['domain'] ) && isset( $entry['string'] ) && isset( $entry['trans'] ) ) { |
|
72 | + $string = str_replace( ['\\n', '\\'], ["\n", ''], $entry['string'] ); |
|
73 | 73 | $trans = []; |
74 | 74 | |
75 | - foreach ((array) $entry['trans'] as $str) { |
|
76 | - $trans[] = str_replace(['\\n', '\\'], ["\n", ''], $str); |
|
75 | + foreach( (array) $entry['trans'] as $str ) { |
|
76 | + $trans[] = str_replace( ['\\n', '\\'], ["\n", ''], $str ); |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | $translations[$entry['domain']][$string] = $trans; |
@@ -29,34 +29,34 @@ discard block |
||
29 | 29 | * @param string|null $locale Code of the current language or null for no translation |
30 | 30 | * @return \Aimeos\Base\View\Iface View object |
31 | 31 | */ |
32 | - public static function get(\Aimeos\MShop\ContextIface $context, $uriBuilder, array $templatePaths, |
|
33 | - \TYPO3\CMS\Extbase\Mvc\RequestInterface $request = null, string $locale = null) : \Aimeos\Base\View\Iface |
|
32 | + public static function get( \Aimeos\MShop\ContextIface $context, $uriBuilder, array $templatePaths, |
|
33 | + \TYPO3\CMS\Extbase\Mvc\RequestInterface $request = null, string $locale = null ) : \Aimeos\Base\View\Iface |
|
34 | 34 | { |
35 | - $obj = GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class); |
|
36 | - $engines = ['.html' => new \Aimeos\Base\View\Engine\Typo3($obj)]; |
|
35 | + $obj = GeneralUtility::makeInstance( \TYPO3\CMS\Extbase\Object\ObjectManager::class ); |
|
36 | + $engines = ['.html' => new \Aimeos\Base\View\Engine\Typo3( $obj )]; |
|
37 | 37 | |
38 | 38 | $prefix = 'ai'; |
39 | - if ($uriBuilder instanceof \TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder) { |
|
39 | + if( $uriBuilder instanceof \TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder ) { |
|
40 | 40 | $prefix = $uriBuilder->getArgumentPrefix(); |
41 | 41 | } |
42 | 42 | |
43 | - $view = new \Aimeos\Base\View\Standard($templatePaths, $engines); |
|
43 | + $view = new \Aimeos\Base\View\Standard( $templatePaths, $engines ); |
|
44 | 44 | $view->prefix = $prefix; |
45 | 45 | |
46 | 46 | $config = $context->config(); |
47 | 47 | $session = $context->session(); |
48 | 48 | |
49 | - self::addTranslate($view, $locale, $config->get('i18n', [])); |
|
50 | - self::addParam($view, $request); |
|
51 | - self::addConfig($view, $config); |
|
52 | - self::addDate($view, $config, $locale); |
|
53 | - self::addFormparam($view, [$prefix]); |
|
54 | - self::addNumber($view, $config, $locale); |
|
55 | - self::addUrl($view, $config, $uriBuilder, $request); |
|
56 | - self::addSession($view, $session); |
|
57 | - self::addRequest($view, $request); |
|
58 | - self::addResponse($view); |
|
59 | - self::addAccess($view); |
|
49 | + self::addTranslate( $view, $locale, $config->get( 'i18n', [] ) ); |
|
50 | + self::addParam( $view, $request ); |
|
51 | + self::addConfig( $view, $config ); |
|
52 | + self::addDate( $view, $config, $locale ); |
|
53 | + self::addFormparam( $view, [$prefix] ); |
|
54 | + self::addNumber( $view, $config, $locale ); |
|
55 | + self::addUrl( $view, $config, $uriBuilder, $request ); |
|
56 | + self::addSession( $view, $session ); |
|
57 | + self::addRequest( $view, $request ); |
|
58 | + self::addResponse( $view ); |
|
59 | + self::addAccess( $view ); |
|
60 | 60 | |
61 | 61 | return $view; |
62 | 62 | } |
@@ -68,40 +68,40 @@ discard block |
||
68 | 68 | * @param \Aimeos\Base\View\Iface $view View object |
69 | 69 | * @return \Aimeos\Base\View\Iface Modified view object |
70 | 70 | */ |
71 | - protected static function addAccess(\Aimeos\Base\View\Iface $view) : \Aimeos\Base\View\Iface |
|
71 | + protected static function addAccess( \Aimeos\Base\View\Iface $view ) : \Aimeos\Base\View\Iface |
|
72 | 72 | { |
73 | - if (isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['aimeos_view_access']) |
|
74 | - && is_callable(($fcn = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['aimeos_view_access'])) |
|
73 | + if( isset( $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['aimeos_view_access'] ) |
|
74 | + && is_callable( ( $fcn = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['aimeos_view_access'] ) ) |
|
75 | 75 | ) { |
76 | - return $fcn($view); |
|
76 | + return $fcn( $view ); |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | $appType = null; |
80 | - if (($GLOBALS['TYPO3_REQUEST'] ?? null) instanceof \TYPO3\CMS\Core\Http\ServerRequest) { |
|
81 | - $appType = \TYPO3\CMS\Core\Http\ApplicationType::fromRequest($GLOBALS['TYPO3_REQUEST']); |
|
80 | + if( ( $GLOBALS['TYPO3_REQUEST'] ?? null ) instanceof \TYPO3\CMS\Core\Http\ServerRequest ) { |
|
81 | + $appType = \TYPO3\CMS\Core\Http\ApplicationType::fromRequest( $GLOBALS['TYPO3_REQUEST'] ); |
|
82 | 82 | } |
83 | 83 | |
84 | - if ($appType && $appType->isBackend()) { |
|
85 | - if ($GLOBALS['BE_USER']->isAdmin() === false) { |
|
84 | + if( $appType && $appType->isBackend() ) { |
|
85 | + if( $GLOBALS['BE_USER']->isAdmin() === false ) { |
|
86 | 86 | $groups = []; |
87 | - foreach ((array) $GLOBALS['BE_USER']->userGroups as $entry) { |
|
87 | + foreach( (array) $GLOBALS['BE_USER']->userGroups as $entry ) { |
|
88 | 88 | $groups[] = $entry['title']; |
89 | 89 | } |
90 | - $helper = new \Aimeos\Base\View\Helper\Access\Standard($view, $groups); |
|
90 | + $helper = new \Aimeos\Base\View\Helper\Access\Standard( $view, $groups ); |
|
91 | 91 | } else { |
92 | - $helper = new \Aimeos\Base\View\Helper\Access\All($view); |
|
92 | + $helper = new \Aimeos\Base\View\Helper\Access\All( $view ); |
|
93 | 93 | } |
94 | 94 | } else { |
95 | - $t3context = GeneralUtility::makeInstance('TYPO3\CMS\Core\Context\Context'); |
|
95 | + $t3context = GeneralUtility::makeInstance( 'TYPO3\CMS\Core\Context\Context' ); |
|
96 | 96 | |
97 | - if ($t3context->getPropertyFromAspect('frontend.user', 'isLoggedIn')) { |
|
98 | - $helper = new \Aimeos\Base\View\Helper\Access\Standard($view, $GLOBALS['TSFE']->fe_user->groupData['title']); |
|
97 | + if( $t3context->getPropertyFromAspect( 'frontend.user', 'isLoggedIn' ) ) { |
|
98 | + $helper = new \Aimeos\Base\View\Helper\Access\Standard( $view, $GLOBALS['TSFE']->fe_user->groupData['title'] ); |
|
99 | 99 | } else { |
100 | - $helper = new \Aimeos\Base\View\Helper\Access\Standard($view, []); |
|
100 | + $helper = new \Aimeos\Base\View\Helper\Access\Standard( $view, [] ); |
|
101 | 101 | } |
102 | 102 | } |
103 | 103 | |
104 | - $view->addHelper('access', $helper); |
|
104 | + $view->addHelper( 'access', $helper ); |
|
105 | 105 | |
106 | 106 | return $view; |
107 | 107 | } |
@@ -114,17 +114,17 @@ discard block |
||
114 | 114 | * @param \Aimeos\Base\Config\Iface $config Configuration object |
115 | 115 | * @return \Aimeos\Base\View\Iface Modified view object |
116 | 116 | */ |
117 | - protected static function addConfig(\Aimeos\Base\View\Iface $view, \Aimeos\Base\Config\Iface $config) : \Aimeos\Base\View\Iface |
|
117 | + protected static function addConfig( \Aimeos\Base\View\Iface $view, \Aimeos\Base\Config\Iface $config ) : \Aimeos\Base\View\Iface |
|
118 | 118 | { |
119 | - if (isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['aimeos_view_config']) |
|
120 | - && is_callable(($fcn = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['aimeos_view_config'])) |
|
119 | + if( isset( $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['aimeos_view_config'] ) |
|
120 | + && is_callable( ( $fcn = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['aimeos_view_config'] ) ) |
|
121 | 121 | ) { |
122 | - return $fcn($view, $config); |
|
122 | + return $fcn( $view, $config ); |
|
123 | 123 | } |
124 | 124 | |
125 | - $conf = new \Aimeos\Base\Config\Decorator\Protect(clone $config, ['resource/*/baseurl'], ['resource']); |
|
126 | - $helper = new \Aimeos\Base\View\Helper\Config\Standard($view, $conf); |
|
127 | - $view->addHelper('config', $helper); |
|
125 | + $conf = new \Aimeos\Base\Config\Decorator\Protect( clone $config, ['resource/*/baseurl'], ['resource'] ); |
|
126 | + $helper = new \Aimeos\Base\View\Helper\Config\Standard( $view, $conf ); |
|
127 | + $view->addHelper( 'config', $helper ); |
|
128 | 128 | |
129 | 129 | return $view; |
130 | 130 | } |
@@ -138,19 +138,19 @@ discard block |
||
138 | 138 | * @param string|null $locale (Country specific) language code |
139 | 139 | * @return \Aimeos\Base\View\Iface Modified view object |
140 | 140 | */ |
141 | - protected static function addDate(\Aimeos\Base\View\Iface $view, \Aimeos\Base\Config\Iface $config, |
|
142 | - string $locale = null) : \Aimeos\Base\View\Iface |
|
141 | + protected static function addDate( \Aimeos\Base\View\Iface $view, \Aimeos\Base\Config\Iface $config, |
|
142 | + string $locale = null ) : \Aimeos\Base\View\Iface |
|
143 | 143 | { |
144 | - if (isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['aimeos_view_date']) |
|
145 | - && is_callable(($fcn = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['aimeos_view_date'])) |
|
144 | + if( isset( $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['aimeos_view_date'] ) |
|
145 | + && is_callable( ( $fcn = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['aimeos_view_date'] ) ) |
|
146 | 146 | ) { |
147 | - return $fcn($view, $config, $locale); |
|
147 | + return $fcn( $view, $config, $locale ); |
|
148 | 148 | } |
149 | 149 | |
150 | - $format = $config->get('client/html/common/date/format'); |
|
150 | + $format = $config->get( 'client/html/common/date/format' ); |
|
151 | 151 | |
152 | - $helper = new \Aimeos\Base\View\Helper\Date\Standard($view, $format); |
|
153 | - $view->addHelper('date', $helper); |
|
152 | + $helper = new \Aimeos\Base\View\Helper\Date\Standard( $view, $format ); |
|
153 | + $view->addHelper( 'date', $helper ); |
|
154 | 154 | |
155 | 155 | return $view; |
156 | 156 | } |
@@ -163,16 +163,16 @@ discard block |
||
163 | 163 | * @param array $prefixes List of prefixes for the form name to build multi-dimensional arrays |
164 | 164 | * @return \Aimeos\Base\View\Iface Modified view object |
165 | 165 | */ |
166 | - protected static function addFormparam(\Aimeos\Base\View\Iface $view, array $prefixes) : \Aimeos\Base\View\Iface |
|
166 | + protected static function addFormparam( \Aimeos\Base\View\Iface $view, array $prefixes ) : \Aimeos\Base\View\Iface |
|
167 | 167 | { |
168 | - if (isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['aimeos_view_formparam']) |
|
169 | - && is_callable(($fcn = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['aimeos_view_formparam'])) |
|
168 | + if( isset( $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['aimeos_view_formparam'] ) |
|
169 | + && is_callable( ( $fcn = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['aimeos_view_formparam'] ) ) |
|
170 | 170 | ) { |
171 | - return $fcn($view, $prefixes); |
|
171 | + return $fcn( $view, $prefixes ); |
|
172 | 172 | } |
173 | 173 | |
174 | - $helper = new \Aimeos\Base\View\Helper\Formparam\Standard($view, $prefixes); |
|
175 | - $view->addHelper('formparam', $helper); |
|
174 | + $helper = new \Aimeos\Base\View\Helper\Formparam\Standard( $view, $prefixes ); |
|
175 | + $view->addHelper( 'formparam', $helper ); |
|
176 | 176 | |
177 | 177 | return $view; |
178 | 178 | } |
@@ -186,19 +186,19 @@ discard block |
||
186 | 186 | * @param string|null $locale (Country specific) language code |
187 | 187 | * @return \Aimeos\Base\View\Iface Modified view object |
188 | 188 | */ |
189 | - protected static function addNumber(\Aimeos\Base\View\Iface $view, \Aimeos\Base\Config\Iface $config, |
|
190 | - string $locale = null) : \Aimeos\Base\View\Iface |
|
189 | + protected static function addNumber( \Aimeos\Base\View\Iface $view, \Aimeos\Base\Config\Iface $config, |
|
190 | + string $locale = null ) : \Aimeos\Base\View\Iface |
|
191 | 191 | { |
192 | - if (isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['aimeos_view_number']) |
|
193 | - && is_callable(($fcn = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['aimeos_view_number'])) |
|
192 | + if( isset( $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['aimeos_view_number'] ) |
|
193 | + && is_callable( ( $fcn = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['aimeos_view_number'] ) ) |
|
194 | 194 | ) { |
195 | - return $fcn($view, $config, $locale); |
|
195 | + return $fcn( $view, $config, $locale ); |
|
196 | 196 | } |
197 | 197 | |
198 | - $format = $config->get('client/html/common/number/format'); |
|
198 | + $format = $config->get( 'client/html/common/number/format' ); |
|
199 | 199 | |
200 | - $helper = new \Aimeos\Base\View\Helper\Number\Locale($view, $locale ?? 'en', $format); |
|
201 | - $view->addHelper('number', $helper); |
|
200 | + $helper = new \Aimeos\Base\View\Helper\Number\Locale( $view, $locale ?? 'en', $format ); |
|
201 | + $view->addHelper( 'number', $helper ); |
|
202 | 202 | |
203 | 203 | return $view; |
204 | 204 | } |
@@ -211,18 +211,18 @@ discard block |
||
211 | 211 | * @param \TYPO3\CMS\Extbase\Mvc\RequestInterface|null $request Request object or null if not available |
212 | 212 | * @return \Aimeos\Base\View\Iface Modified view object |
213 | 213 | */ |
214 | - protected static function addParam(\Aimeos\Base\View\Iface $view, |
|
215 | - \TYPO3\CMS\Extbase\Mvc\RequestInterface $request = null) : \Aimeos\Base\View\Iface |
|
214 | + protected static function addParam( \Aimeos\Base\View\Iface $view, |
|
215 | + \TYPO3\CMS\Extbase\Mvc\RequestInterface $request = null ) : \Aimeos\Base\View\Iface |
|
216 | 216 | { |
217 | - if (isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['aimeos_view_param']) |
|
218 | - && is_callable(($fcn = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['aimeos_view_param'])) |
|
217 | + if( isset( $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['aimeos_view_param'] ) |
|
218 | + && is_callable( ( $fcn = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['aimeos_view_param'] ) ) |
|
219 | 219 | ) { |
220 | - return $fcn($view, $request); |
|
220 | + return $fcn( $view, $request ); |
|
221 | 221 | } |
222 | 222 | |
223 | 223 | $params = $request ? $request->getArguments() : []; |
224 | - $helper = new \Aimeos\Base\View\Helper\Param\Standard($view, $params); |
|
225 | - $view->addHelper('param', $helper); |
|
224 | + $helper = new \Aimeos\Base\View\Helper\Param\Standard( $view, $params ); |
|
225 | + $view->addHelper( 'param', $helper ); |
|
226 | 226 | |
227 | 227 | return $view; |
228 | 228 | } |
@@ -235,21 +235,21 @@ discard block |
||
235 | 235 | * @param \TYPO3\CMS\Extbase\Mvc\RequestInterface|null $request Request object |
236 | 236 | * @return \Aimeos\Base\View\Iface Modified view object |
237 | 237 | */ |
238 | - protected static function addRequest(\Aimeos\Base\View\Iface $view, |
|
239 | - \TYPO3\CMS\Extbase\Mvc\RequestInterface $request = null) : \Aimeos\Base\View\Iface |
|
238 | + protected static function addRequest( \Aimeos\Base\View\Iface $view, |
|
239 | + \TYPO3\CMS\Extbase\Mvc\RequestInterface $request = null ) : \Aimeos\Base\View\Iface |
|
240 | 240 | { |
241 | - if (isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['aimeos_view_request']) |
|
242 | - && is_callable(($fcn = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['aimeos_view_request'])) |
|
241 | + if( isset( $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['aimeos_view_request'] ) |
|
242 | + && is_callable( ( $fcn = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['aimeos_view_request'] ) ) |
|
243 | 243 | ) { |
244 | - return $fcn($view, $request); |
|
244 | + return $fcn( $view, $request ); |
|
245 | 245 | } |
246 | 246 | |
247 | 247 | $target = $GLOBALS["TSFE"]->id ?? null; |
248 | 248 | $get = GeneralUtility::_GET(); |
249 | 249 | $post = GeneralUtility::_POST(); |
250 | 250 | |
251 | - $helper = new \Aimeos\Base\View\Helper\Request\Typo3($view, $target, $_FILES, $get, $post, $_COOKIE, $_SERVER); |
|
252 | - $view->addHelper('request', $helper); |
|
251 | + $helper = new \Aimeos\Base\View\Helper\Request\Typo3( $view, $target, $_FILES, $get, $post, $_COOKIE, $_SERVER ); |
|
252 | + $view->addHelper( 'request', $helper ); |
|
253 | 253 | |
254 | 254 | return $view; |
255 | 255 | } |
@@ -261,16 +261,16 @@ discard block |
||
261 | 261 | * @param \Aimeos\Base\View\Iface $view View object |
262 | 262 | * @return \Aimeos\Base\View\Iface Modified view object |
263 | 263 | */ |
264 | - protected static function addResponse(\Aimeos\Base\View\Iface $view) : \Aimeos\Base\View\Iface |
|
264 | + protected static function addResponse( \Aimeos\Base\View\Iface $view ) : \Aimeos\Base\View\Iface |
|
265 | 265 | { |
266 | - if (isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['aimeos_view_response']) |
|
267 | - && is_callable(($fcn = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['aimeos_view_response'])) |
|
266 | + if( isset( $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['aimeos_view_response'] ) |
|
267 | + && is_callable( ( $fcn = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['aimeos_view_response'] ) ) |
|
268 | 268 | ) { |
269 | - return $fcn($view); |
|
269 | + return $fcn( $view ); |
|
270 | 270 | } |
271 | 271 | |
272 | - $helper = new \Aimeos\Base\View\Helper\Response\Typo3($view); |
|
273 | - $view->addHelper('response', $helper); |
|
272 | + $helper = new \Aimeos\Base\View\Helper\Response\Typo3( $view ); |
|
273 | + $view->addHelper( 'response', $helper ); |
|
274 | 274 | |
275 | 275 | return $view; |
276 | 276 | } |
@@ -283,10 +283,10 @@ discard block |
||
283 | 283 | * @param \Aimeos\Base\Session\Iface $session Session object |
284 | 284 | * @return \Aimeos\Base\View\Iface Modified view object |
285 | 285 | */ |
286 | - protected static function addSession(\Aimeos\Base\View\Iface $view, \Aimeos\Base\Session\Iface $session) : \Aimeos\Base\View\Iface |
|
286 | + protected static function addSession( \Aimeos\Base\View\Iface $view, \Aimeos\Base\Session\Iface $session ) : \Aimeos\Base\View\Iface |
|
287 | 287 | { |
288 | - $helper = new \Aimeos\Base\View\Helper\Session\Standard($view, $session); |
|
289 | - $view->addHelper('session', $helper); |
|
288 | + $helper = new \Aimeos\Base\View\Helper\Session\Standard( $view, $session ); |
|
289 | + $view->addHelper( 'session', $helper ); |
|
290 | 290 | |
291 | 291 | return $view; |
292 | 292 | } |
@@ -300,23 +300,23 @@ discard block |
||
300 | 300 | * @param array $local Local translations |
301 | 301 | * @return \Aimeos\Base\View\Iface Modified view object |
302 | 302 | */ |
303 | - protected static function addTranslate(\Aimeos\Base\View\Iface $view, string $langid = null, array $local) : \Aimeos\Base\View\Iface |
|
303 | + protected static function addTranslate( \Aimeos\Base\View\Iface $view, string $langid = null, array $local ) : \Aimeos\Base\View\Iface |
|
304 | 304 | { |
305 | - if (isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['aimeos_view_translate']) |
|
306 | - && is_callable(($fcn = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['aimeos_view_translate'])) |
|
305 | + if( isset( $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['aimeos_view_translate'] ) |
|
306 | + && is_callable( ( $fcn = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['aimeos_view_translate'] ) ) |
|
307 | 307 | ) { |
308 | - return $fcn($view, $langid, $local); |
|
308 | + return $fcn( $view, $langid, $local ); |
|
309 | 309 | } |
310 | 310 | |
311 | - if ($langid) { |
|
312 | - $i18n = \Aimeos\Aimeos\Base::i18n([$langid], $local); |
|
311 | + if( $langid ) { |
|
312 | + $i18n = \Aimeos\Aimeos\Base::i18n( [$langid], $local ); |
|
313 | 313 | $translation = $i18n[$langid]; |
314 | 314 | } else { |
315 | - $translation = new \Aimeos\Base\Translation\None('en'); |
|
315 | + $translation = new \Aimeos\Base\Translation\None( 'en' ); |
|
316 | 316 | } |
317 | 317 | |
318 | - $helper = new \Aimeos\Base\View\Helper\Translate\Standard($view, $translation); |
|
319 | - $view->addHelper('translate', $helper); |
|
318 | + $helper = new \Aimeos\Base\View\Helper\Translate\Standard( $view, $translation ); |
|
319 | + $view->addHelper( 'translate', $helper ); |
|
320 | 320 | |
321 | 321 | return $view; |
322 | 322 | } |
@@ -331,54 +331,54 @@ discard block |
||
331 | 331 | * @param \TYPO3\CMS\Extbase\Mvc\RequestInterface|null $request Request object |
332 | 332 | * @return \Aimeos\Base\View\Iface Modified view object |
333 | 333 | */ |
334 | - protected static function addUrl(\Aimeos\Base\View\Iface $view, \Aimeos\Base\Config\Iface $config, $uriBuilder, |
|
335 | - \TYPO3\CMS\Extbase\Mvc\RequestInterface $request = null) : \Aimeos\Base\View\Iface |
|
334 | + protected static function addUrl( \Aimeos\Base\View\Iface $view, \Aimeos\Base\Config\Iface $config, $uriBuilder, |
|
335 | + \TYPO3\CMS\Extbase\Mvc\RequestInterface $request = null ) : \Aimeos\Base\View\Iface |
|
336 | 336 | { |
337 | - if (isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['aimeos_view_url']) |
|
338 | - && is_callable(($fcn = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['aimeos_view_url'])) |
|
337 | + if( isset( $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['aimeos_view_url'] ) |
|
338 | + && is_callable( ( $fcn = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['aimeos_view_url'] ) ) |
|
339 | 339 | ) { |
340 | - return $fcn($view, $config, $uriBuilder, $request); |
|
340 | + return $fcn( $view, $config, $uriBuilder, $request ); |
|
341 | 341 | } |
342 | 342 | |
343 | 343 | $fixed = []; |
344 | 344 | |
345 | - if ($request) { |
|
346 | - $name = $config->get('typo3/param/name/site', 'site'); |
|
345 | + if( $request ) { |
|
346 | + $name = $config->get( 'typo3/param/name/site', 'site' ); |
|
347 | 347 | |
348 | - if ($request !== null && $request->hasArgument($name) === true) { |
|
349 | - $fixed[$name] = $request->getArgument($name); |
|
350 | - } elseif (($value = GeneralUtility::_GP('S')) !== null) { |
|
348 | + if( $request !== null && $request->hasArgument( $name ) === true ) { |
|
349 | + $fixed[$name] = $request->getArgument( $name ); |
|
350 | + } elseif( ( $value = GeneralUtility::_GP( 'S' ) ) !== null ) { |
|
351 | 351 | $fixed['S'] = $value; |
352 | 352 | } |
353 | 353 | |
354 | 354 | |
355 | - $name = $config->get('typo3/param/name/language', 'locale'); |
|
355 | + $name = $config->get( 'typo3/param/name/language', 'locale' ); |
|
356 | 356 | |
357 | - if ($request !== null && $request->hasArgument($name) === true) { |
|
358 | - $fixed[$name] = $request->getArgument($name); |
|
357 | + if( $request !== null && $request->hasArgument( $name ) === true ) { |
|
358 | + $fixed[$name] = $request->getArgument( $name ); |
|
359 | 359 | } else { // TYPO3 9+ |
360 | - $fixed['L'] = GeneralUtility::makeInstance('TYPO3\CMS\Core\Context\Context')->getAspect('language')->getId(); |
|
360 | + $fixed['L'] = GeneralUtility::makeInstance( 'TYPO3\CMS\Core\Context\Context' )->getAspect( 'language' )->getId(); |
|
361 | 361 | } |
362 | 362 | |
363 | 363 | |
364 | - $name = $config->get('typo3/param/name/currency', 'currency'); |
|
364 | + $name = $config->get( 'typo3/param/name/currency', 'currency' ); |
|
365 | 365 | |
366 | - if ($request !== null && $request->hasArgument($name) === true) { |
|
367 | - $fixed[$name] = $request->getArgument($name); |
|
368 | - } elseif (($value = GeneralUtility::_GP('C')) !== null) { |
|
366 | + if( $request !== null && $request->hasArgument( $name ) === true ) { |
|
367 | + $fixed[$name] = $request->getArgument( $name ); |
|
368 | + } elseif( ( $value = GeneralUtility::_GP( 'C' ) ) !== null ) { |
|
369 | 369 | $fixed['C'] = $value; |
370 | 370 | } |
371 | 371 | } |
372 | 372 | |
373 | - if ($uriBuilder instanceof \TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder) { |
|
374 | - $url = new \Aimeos\Base\View\Helper\Url\Typo3($view, $uriBuilder, $fixed); |
|
375 | - } elseif ($uriBuilder instanceof \TYPO3\CMS\Core\Routing\RouterInterface) { |
|
376 | - $url = new \Aimeos\Base\View\Helper\Url\T3Router($view, $uriBuilder, $fixed); |
|
373 | + if( $uriBuilder instanceof \TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder ) { |
|
374 | + $url = new \Aimeos\Base\View\Helper\Url\Typo3( $view, $uriBuilder, $fixed ); |
|
375 | + } elseif( $uriBuilder instanceof \TYPO3\CMS\Core\Routing\RouterInterface ) { |
|
376 | + $url = new \Aimeos\Base\View\Helper\Url\T3Router( $view, $uriBuilder, $fixed ); |
|
377 | 377 | } else { |
378 | - throw new \RuntimeException('No router for generating URLs available'); |
|
378 | + throw new \RuntimeException( 'No router for generating URLs available' ); |
|
379 | 379 | } |
380 | 380 | |
381 | - $view->addHelper('url', $url); |
|
381 | + $view->addHelper( 'url', $url ); |
|
382 | 382 | |
383 | 383 | return $view; |
384 | 384 | } |
@@ -38,7 +38,7 @@ |
||
38 | 38 | $controllers = (array) $this->{$this->fieldController}; |
39 | 39 | $tsconfig = $this->{$this->fieldTSconfig}; |
40 | 40 | |
41 | - Scheduler\Base::execute(Base::parseTS($tsconfig), [], $controllers, $sitecodes); |
|
41 | + Scheduler\Base::execute( Base::parseTS( $tsconfig ), [], $controllers, $sitecodes ); |
|
42 | 42 | |
43 | 43 | return true; |
44 | 44 | } |
@@ -44,56 +44,56 @@ |
||
44 | 44 | { |
45 | 45 | $conf = []; |
46 | 46 | |
47 | - if (!isset($conf['client']['html']['catalog']['detail']['url']['config']['absoluteUri'])) { |
|
47 | + if( !isset( $conf['client']['html']['catalog']['detail']['url']['config']['absoluteUri'] ) ) { |
|
48 | 48 | $conf['client']['html']['catalog']['detail']['url']['config']['absoluteUri'] = 1; |
49 | 49 | } |
50 | 50 | |
51 | - if (!isset($conf['client']['html']['account']['download']['url']['config']['absoluteUri'])) { |
|
51 | + if( !isset( $conf['client']['html']['account']['download']['url']['config']['absoluteUri'] ) ) { |
|
52 | 52 | $conf['client']['html']['account']['download']['url']['config']['absoluteUri'] = 1; |
53 | 53 | } |
54 | 54 | |
55 | - if ($this->{$this->fieldSenderFrom} != '') { |
|
55 | + if( $this->{$this->fieldSenderFrom} != '' ) { |
|
56 | 56 | $conf['resource']['email']['from-name'] = $this->{$this->fieldSenderFrom}; |
57 | 57 | } |
58 | 58 | |
59 | - if ($this->{$this->fieldSenderEmail} != '') { |
|
59 | + if( $this->{$this->fieldSenderEmail} != '' ) { |
|
60 | 60 | $conf['resource']['email']['from-email'] = $this->{$this->fieldSenderEmail}; |
61 | 61 | } |
62 | 62 | |
63 | - if ($this->{$this->fieldReplyEmail} != '') { |
|
63 | + if( $this->{$this->fieldReplyEmail} != '' ) { |
|
64 | 64 | $conf['resource']['email']['reply-email'] = $this->{$this->fieldReplyEmail}; |
65 | 65 | } |
66 | 66 | |
67 | - if ($this->{$this->fieldPageCatalog} != '') { |
|
67 | + if( $this->{$this->fieldPageCatalog} != '' ) { |
|
68 | 68 | $conf['client']['html']['catalog']['lists']['url']['target'] = $this->{$this->fieldPageCatalog}; |
69 | 69 | } |
70 | 70 | |
71 | - if ($this->{$this->fieldPageDetail} != '') { |
|
71 | + if( $this->{$this->fieldPageDetail} != '' ) { |
|
72 | 72 | $conf['client']['html']['catalog']['detail']['url']['target'] = $this->{$this->fieldPageDetail}; |
73 | 73 | } |
74 | 74 | |
75 | - if ($this->{$this->fieldPageDownload} != '') { |
|
75 | + if( $this->{$this->fieldPageDownload} != '' ) { |
|
76 | 76 | $conf['client']['html']['account']['download']['url']['target'] = $this->{$this->fieldPageDownload}; |
77 | 77 | } |
78 | 78 | |
79 | - if ($this->{$this->fieldPageLogin} != '') { |
|
79 | + if( $this->{$this->fieldPageLogin} != '' ) { |
|
80 | 80 | $conf['client']['html']['account']['index']['url']['target'] = $this->{$this->fieldPageLogin}; |
81 | 81 | } |
82 | 82 | |
83 | - if ($this->{$this->fieldTemplateBaseurl} != '') { |
|
83 | + if( $this->{$this->fieldTemplateBaseurl} != '' ) { |
|
84 | 84 | $themeDir = $this->{$this->fieldTemplateBaseurl}; |
85 | 85 | |
86 | - if ($themeDir[0] !== '/') { |
|
87 | - $themeDir = realpath(\TYPO3\CMS\Core\Core\Environment::getPublicPath() . '/' . $themeDir); |
|
86 | + if( $themeDir[0] !== '/' ) { |
|
87 | + $themeDir = realpath( \TYPO3\CMS\Core\Core\Environment::getPublicPath() . '/' . $themeDir ); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | $conf['resource']['fs-theme']['basedir'] = $themeDir; |
91 | 91 | } |
92 | 92 | |
93 | - $tsconf = Base::parseTS($this->{$this->fieldTSconfig}); |
|
93 | + $tsconf = Base::parseTS( $this->{$this->fieldTSconfig}); |
|
94 | 94 | $jobs = (array) $this->{$this->fieldController}; |
95 | 95 | |
96 | - Scheduler\Base::execute($tsconf, $conf, $jobs, $this->{$this->fieldSite}, $this->{$this->fieldPageDetail}); |
|
96 | + Scheduler\Base::execute( $tsconf, $conf, $jobs, $this->{$this->fieldSite}, $this->{$this->fieldPageDetail}); |
|
97 | 97 | |
98 | 98 | return true; |
99 | 99 | } |
@@ -33,33 +33,33 @@ discard block |
||
33 | 33 | * @param array $jobs List of job names |
34 | 34 | * @param array|string $sites List of site names |
35 | 35 | */ |
36 | - public static function execute(array $tsconf, array $conf, array $jobs, $sites, ?string $pid = null) |
|
36 | + public static function execute( array $tsconf, array $conf, array $jobs, $sites, ?string $pid = null ) |
|
37 | 37 | { |
38 | 38 | $aimeos = Aimeos\Base::aimeos(); |
39 | - $context = self::context($tsconf, $conf, $pid); |
|
39 | + $context = self::context( $tsconf, $conf, $pid ); |
|
40 | 40 | $process = $context->process(); |
41 | 41 | |
42 | 42 | // Reset before child processes are spawned to avoid lost DB connections afterwards |
43 | - GeneralUtility::makeInstance('TYPO3\CMS\Core\Database\ConnectionPool')->resetConnections(); |
|
43 | + GeneralUtility::makeInstance( 'TYPO3\CMS\Core\Database\ConnectionPool' )->resetConnections(); |
|
44 | 44 | |
45 | - $manager = \Aimeos\MShop::create($context, 'locale'); |
|
45 | + $manager = \Aimeos\MShop::create( $context, 'locale' ); |
|
46 | 46 | |
47 | - foreach (self::getSiteItems($context, $sites) as $siteItem) { |
|
48 | - \Aimeos\MShop::cache(true); |
|
49 | - \Aimeos\MAdmin::cache(true); |
|
47 | + foreach( self::getSiteItems( $context, $sites ) as $siteItem ) { |
|
48 | + \Aimeos\MShop::cache( true ); |
|
49 | + \Aimeos\MAdmin::cache( true ); |
|
50 | 50 | |
51 | - $localeItem = $manager->bootstrap($siteItem->getCode(), '', '', false); |
|
52 | - $localeItem->setLanguageId(null); |
|
53 | - $localeItem->setCurrencyId(null); |
|
51 | + $localeItem = $manager->bootstrap( $siteItem->getCode(), '', '', false ); |
|
52 | + $localeItem->setLanguageId( null ); |
|
53 | + $localeItem->setCurrencyId( null ); |
|
54 | 54 | |
55 | - $context->setLocale($localeItem); |
|
55 | + $context->setLocale( $localeItem ); |
|
56 | 56 | |
57 | - foreach ($jobs as $jobname) { |
|
58 | - $fcn = function($context, $aimeos, $jobname) { |
|
59 | - \Aimeos\Controller\Jobs::create($context, $aimeos, $jobname)->run(); |
|
57 | + foreach( $jobs as $jobname ) { |
|
58 | + $fcn = function( $context, $aimeos, $jobname ) { |
|
59 | + \Aimeos\Controller\Jobs::create( $context, $aimeos, $jobname )->run(); |
|
60 | 60 | }; |
61 | 61 | |
62 | - $process->start($fcn, [$context, $aimeos, $jobname], false); |
|
62 | + $process->start( $fcn, [$context, $aimeos, $jobname], false ); |
|
63 | 63 | } |
64 | 64 | } |
65 | 65 | |
@@ -73,33 +73,33 @@ discard block |
||
73 | 73 | * @param array $tsconf Multi-dimensional associative list of key/value pairs |
74 | 74 | * @return \Aimeos\MShop\ContextIface Context object |
75 | 75 | */ |
76 | - public static function context(array $tsconf = [], array $conf = [], ?string $pid = null) : \Aimeos\MShop\ContextIface |
|
76 | + public static function context( array $tsconf = [], array $conf = [], ?string $pid = null ) : \Aimeos\MShop\ContextIface |
|
77 | 77 | { |
78 | - $config = Aimeos\Base::config($tsconf); |
|
79 | - $context = Aimeos\Base::context($config); |
|
80 | - $context->config()->apply($conf); |
|
78 | + $config = Aimeos\Base::config( $tsconf ); |
|
79 | + $context = Aimeos\Base::context( $config ); |
|
80 | + $context->config()->apply( $conf ); |
|
81 | 81 | |
82 | 82 | |
83 | - $langManager = \Aimeos\MShop::create($context, 'locale/language'); |
|
84 | - $search = $langManager->filter(true); |
|
83 | + $langManager = \Aimeos\MShop::create( $context, 'locale/language' ); |
|
84 | + $search = $langManager->filter( true ); |
|
85 | 85 | |
86 | 86 | $expr = []; |
87 | 87 | $expr[] = $search->getConditions(); |
88 | - $expr[] = $search->compare('==', 'locale.language.id', 'en'); // default language |
|
88 | + $expr[] = $search->compare( '==', 'locale.language.id', 'en' ); // default language |
|
89 | 89 | |
90 | - if (isset($GLOBALS['BE_USER']->uc['lang']) && $GLOBALS['BE_USER']->uc['lang'] != '') { // BE language |
|
91 | - $expr[] = $search->compare('==', 'locale.language.id', $GLOBALS['BE_USER']->uc['lang']); |
|
90 | + if( isset( $GLOBALS['BE_USER']->uc['lang'] ) && $GLOBALS['BE_USER']->uc['lang'] != '' ) { // BE language |
|
91 | + $expr[] = $search->compare( '==', 'locale.language.id', $GLOBALS['BE_USER']->uc['lang'] ); |
|
92 | 92 | } |
93 | 93 | |
94 | - $search->setConditions($search->combine('||', $expr)); |
|
95 | - $langids = $langManager->search($search)->keys()->toArray(); |
|
94 | + $search->setConditions( $search->combine( '||', $expr ) ); |
|
95 | + $langids = $langManager->search( $search )->keys()->toArray(); |
|
96 | 96 | |
97 | - $context->setI18n(Aimeos\Base::i18n($langids, (array) ($tsconf['i18n'] ?? []))); |
|
97 | + $context->setI18n( Aimeos\Base::i18n( $langids, (array) ( $tsconf['i18n'] ?? [] ) ) ); |
|
98 | 98 | |
99 | - $tmplPaths = Aimeos\Base::aimeos()->getTemplatePaths('controller/jobs/templates'); |
|
100 | - $context->setView(Aimeos\Base::view($context, self::getRouter($pid), $tmplPaths)); |
|
99 | + $tmplPaths = Aimeos\Base::aimeos()->getTemplatePaths( 'controller/jobs/templates' ); |
|
100 | + $context->setView( Aimeos\Base::view( $context, self::getRouter( $pid ), $tmplPaths ) ); |
|
101 | 101 | |
102 | - $context->setEditor('scheduler'); |
|
102 | + $context->setEditor( 'scheduler' ); |
|
103 | 103 | |
104 | 104 | return $context; |
105 | 105 | } |
@@ -112,20 +112,20 @@ discard block |
||
112 | 112 | * @param array|string $sites Unique site codes |
113 | 113 | * @return \Aimeos\Map List of site items implementing \Aimeos\MShop\Locale\Item\Site\Iface |
114 | 114 | */ |
115 | - public static function getSiteItems(\Aimeos\MShop\ContextIface $context, $sites) : \Aimeos\Map |
|
115 | + public static function getSiteItems( \Aimeos\MShop\ContextIface $context, $sites ) : \Aimeos\Map |
|
116 | 116 | { |
117 | - if (!is_array($sites)) { |
|
118 | - $sites = explode(' ', $sites); |
|
117 | + if( !is_array( $sites ) ) { |
|
118 | + $sites = explode( ' ', $sites ); |
|
119 | 119 | } |
120 | 120 | |
121 | - $manager = \Aimeos\MShop::create($context, 'locale/site'); |
|
121 | + $manager = \Aimeos\MShop::create( $context, 'locale/site' ); |
|
122 | 122 | $search = $manager->filter(); |
123 | 123 | |
124 | - if (!empty($sites)) { |
|
125 | - $search->setConditions($search->compare('==', 'locale.site.code', $sites)); |
|
124 | + if( !empty( $sites ) ) { |
|
125 | + $search->setConditions( $search->compare( '==', 'locale.site.code', $sites ) ); |
|
126 | 126 | } |
127 | 127 | |
128 | - return $manager->search($search); |
|
128 | + return $manager->search( $search ); |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | |
@@ -136,15 +136,15 @@ discard block |
||
136 | 136 | * @return \TYPO3\CMS\Core\Routing\RouterInterface Page router |
137 | 137 | * @throws \RuntimeException If no site configuraiton is available |
138 | 138 | */ |
139 | - protected static function getRouter(?string $pid) : \TYPO3\CMS\Core\Routing\RouterInterface |
|
139 | + protected static function getRouter( ?string $pid ) : \TYPO3\CMS\Core\Routing\RouterInterface |
|
140 | 140 | { |
141 | - $siteFinder = GeneralUtility::makeInstance(SiteFinder::class); |
|
142 | - $site = $pid ? $siteFinder->getSiteByPageId($pid) : current($siteFinder->getAllSites()); |
|
141 | + $siteFinder = GeneralUtility::makeInstance( SiteFinder::class ); |
|
142 | + $site = $pid ? $siteFinder->getSiteByPageId( $pid ) : current( $siteFinder->getAllSites() ); |
|
143 | 143 | |
144 | - if ($site) { |
|
144 | + if( $site ) { |
|
145 | 145 | return $site->getRouter(); |
146 | 146 | } |
147 | 147 | |
148 | - throw new \RuntimeException('No site configuration found'); |
|
148 | + throw new \RuntimeException( 'No site configuration found' ); |
|
149 | 149 | } |
150 | 150 | } |
@@ -34,12 +34,12 @@ discard block |
||
34 | 34 | * ['cshKey'] => The CSH key for the field |
35 | 35 | * ['cshLabel'] => The code of the CSH label |
36 | 36 | */ |
37 | - public function getAdditionalFields(array &$taskInfo, $task, \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $parentObject) |
|
37 | + public function getAdditionalFields( array &$taskInfo, $task, \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $parentObject ) |
|
38 | 38 | { |
39 | 39 | try { |
40 | - return $this->getFields($taskInfo, $task, $parentObject); |
|
41 | - } catch(\Exception $e) { |
|
42 | - $this->addMessage($e->getMessage(), \TYPO3\CMS\Core\Messaging\AbstractMessage::ERROR); |
|
40 | + return $this->getFields( $taskInfo, $task, $parentObject ); |
|
41 | + } catch( \Exception $e ) { |
|
42 | + $this->addMessage( $e->getMessage(), \TYPO3\CMS\Core\Messaging\AbstractMessage::ERROR ); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | return []; |
@@ -54,9 +54,9 @@ discard block |
||
54 | 54 | * @param array $submittedData Array containing the data submitted by the user |
55 | 55 | * @param tx_scheduler_Task $task Reference to the current task object |
56 | 56 | */ |
57 | - public function saveAdditionalFields(array $submittedData, \TYPO3\CMS\Scheduler\Task\AbstractTask $task) |
|
57 | + public function saveAdditionalFields( array $submittedData, \TYPO3\CMS\Scheduler\Task\AbstractTask $task ) |
|
58 | 58 | { |
59 | - $this->saveFields($submittedData, $task); |
|
59 | + $this->saveFields( $submittedData, $task ); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | |
@@ -69,12 +69,12 @@ discard block |
||
69 | 69 | * @param tx_scheduler_Module $parentObject Reference to the calling object (Scheduler's BE module) |
70 | 70 | * @return boolean True if validation was ok (or selected class is not relevant), false otherwise |
71 | 71 | */ |
72 | - public function validateAdditionalFields(array &$submittedData, \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $parentObject) |
|
72 | + public function validateAdditionalFields( array &$submittedData, \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $parentObject ) |
|
73 | 73 | { |
74 | 74 | try { |
75 | - return $this->validateFields($submittedData, $parentObject); |
|
76 | - } catch(\Exception $e) { |
|
77 | - $this->addMessage($e->getMessage(), \TYPO3\CMS\Core\Messaging\AbstractMessage::ERROR); |
|
75 | + return $this->validateFields( $submittedData, $parentObject ); |
|
76 | + } catch( \Exception $e ) { |
|
77 | + $this->addMessage( $e->getMessage(), \TYPO3\CMS\Core\Messaging\AbstractMessage::ERROR ); |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | return false; |
@@ -36,9 +36,12 @@ discard block |
||
36 | 36 | */ |
37 | 37 | public function getAdditionalFields(array &$taskInfo, $task, \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $parentObject) |
38 | 38 | { |
39 | - try { |
|
39 | + try |
|
40 | + { |
|
40 | 41 | return $this->getFields($taskInfo, $task, $parentObject); |
41 | - } catch(\Exception $e) { |
|
42 | + } |
|
43 | + catch(\Exception $e) |
|
44 | + { |
|
42 | 45 | $this->addMessage($e->getMessage(), \TYPO3\CMS\Core\Messaging\AbstractMessage::ERROR); |
43 | 46 | } |
44 | 47 | |
@@ -71,9 +74,12 @@ discard block |
||
71 | 74 | */ |
72 | 75 | public function validateAdditionalFields(array &$submittedData, \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $parentObject) |
73 | 76 | { |
74 | - try { |
|
77 | + try |
|
78 | + { |
|
75 | 79 | return $this->validateFields($submittedData, $parentObject); |
76 | - } catch(\Exception $e) { |
|
80 | + } |
|
81 | + catch(\Exception $e) |
|
82 | + { |
|
77 | 83 | $this->addMessage($e->getMessage(), \TYPO3\CMS\Core\Messaging\AbstractMessage::ERROR); |
78 | 84 | } |
79 | 85 |
@@ -48,20 +48,20 @@ discard block |
||
48 | 48 | * ['cshKey'] => The CSH key for the field |
49 | 49 | * ['cshLabel'] => The code of the CSH label |
50 | 50 | */ |
51 | - protected function getFields(array &$taskInfo, $task, $parentObject) |
|
51 | + protected function getFields( array &$taskInfo, $task, $parentObject ) |
|
52 | 52 | { |
53 | 53 | $additionalFields = []; |
54 | 54 | |
55 | 55 | |
56 | 56 | // In case of editing a task, set to the internal value if data wasn't already submitted |
57 | - if (empty($taskInfo[$this->fieldSenderFrom]) && $parentObject->getCurrentAction()->equals(Action::EDIT)) { |
|
57 | + if( empty( $taskInfo[$this->fieldSenderFrom] ) && $parentObject->getCurrentAction()->equals( Action::EDIT ) ) { |
|
58 | 58 | $taskInfo[$this->fieldSenderFrom] = $task->{$this->fieldSenderFrom} ?? ''; |
59 | 59 | } |
60 | 60 | |
61 | - $taskInfo[$this->fieldSenderFrom] = htmlspecialchars($taskInfo[$this->fieldSenderFrom] ?? '', ENT_QUOTES, 'UTF-8'); |
|
61 | + $taskInfo[$this->fieldSenderFrom] = htmlspecialchars( $taskInfo[$this->fieldSenderFrom] ?? '', ENT_QUOTES, 'UTF-8' ); |
|
62 | 62 | |
63 | 63 | $fieldStr = '<input class="form-control" name="tx_scheduler[%1$s]" id="%1$s" value="%2$s">'; |
64 | - $fieldCode = sprintf($fieldStr, $this->fieldSenderFrom, $taskInfo[$this->fieldSenderFrom]); |
|
64 | + $fieldCode = sprintf( $fieldStr, $this->fieldSenderFrom, $taskInfo[$this->fieldSenderFrom] ); |
|
65 | 65 | |
66 | 66 | $additionalFields[$this->fieldSenderFrom] = [ |
67 | 67 | 'code' => $fieldCode, |
@@ -72,14 +72,14 @@ discard block |
||
72 | 72 | |
73 | 73 | |
74 | 74 | // In case of editing a task, set to the internal value if data wasn't already submitted |
75 | - if (empty($taskInfo[$this->fieldSenderEmail]) && $parentObject->getCurrentAction()->equals(Action::EDIT)) { |
|
75 | + if( empty( $taskInfo[$this->fieldSenderEmail] ) && $parentObject->getCurrentAction()->equals( Action::EDIT ) ) { |
|
76 | 76 | $taskInfo[$this->fieldSenderEmail] = $task->{$this->fieldSenderEmail} ?? ''; |
77 | 77 | } |
78 | 78 | |
79 | - $taskInfo[$this->fieldSenderEmail] = htmlspecialchars($taskInfo[$this->fieldSenderEmail] ?? '', ENT_QUOTES, 'UTF-8'); |
|
79 | + $taskInfo[$this->fieldSenderEmail] = htmlspecialchars( $taskInfo[$this->fieldSenderEmail] ?? '', ENT_QUOTES, 'UTF-8' ); |
|
80 | 80 | |
81 | 81 | $fieldStr = '<input class="form-control" name="tx_scheduler[%1$s]" id="%1$s" value="%2$s">'; |
82 | - $fieldCode = sprintf($fieldStr, $this->fieldSenderEmail, $taskInfo[$this->fieldSenderEmail]); |
|
82 | + $fieldCode = sprintf( $fieldStr, $this->fieldSenderEmail, $taskInfo[$this->fieldSenderEmail] ); |
|
83 | 83 | |
84 | 84 | $additionalFields[$this->fieldSenderEmail] = [ |
85 | 85 | 'code' => $fieldCode, |
@@ -90,14 +90,14 @@ discard block |
||
90 | 90 | |
91 | 91 | |
92 | 92 | // In case of editing a task, set to the internal value if data wasn't already submitted |
93 | - if (empty($taskInfo[$this->fieldReplyEmail]) && $parentObject->getCurrentAction()->equals(Action::EDIT)) { |
|
93 | + if( empty( $taskInfo[$this->fieldReplyEmail] ) && $parentObject->getCurrentAction()->equals( Action::EDIT ) ) { |
|
94 | 94 | $taskInfo[$this->fieldReplyEmail] = $task->{$this->fieldReplyEmail} ?? ''; |
95 | 95 | } |
96 | 96 | |
97 | - $taskInfo[$this->fieldReplyEmail] = htmlspecialchars($taskInfo[$this->fieldReplyEmail] ?? '', ENT_QUOTES, 'UTF-8'); |
|
97 | + $taskInfo[$this->fieldReplyEmail] = htmlspecialchars( $taskInfo[$this->fieldReplyEmail] ?? '', ENT_QUOTES, 'UTF-8' ); |
|
98 | 98 | |
99 | 99 | $fieldStr = '<input class="form-control" name="tx_scheduler[%1$s]" id="%1$s" value="%2$s">'; |
100 | - $fieldCode = sprintf($fieldStr, $this->fieldReplyEmail, $taskInfo[$this->fieldReplyEmail]); |
|
100 | + $fieldCode = sprintf( $fieldStr, $this->fieldReplyEmail, $taskInfo[$this->fieldReplyEmail] ); |
|
101 | 101 | |
102 | 102 | $additionalFields[$this->fieldReplyEmail] = [ |
103 | 103 | 'code' => $fieldCode, |
@@ -108,14 +108,14 @@ discard block |
||
108 | 108 | |
109 | 109 | |
110 | 110 | // In case of editing a task, set to the internal value if data wasn't already submitted |
111 | - if (empty($taskInfo[$this->fieldPageCatalog]) && $parentObject->getCurrentAction()->equals(Action::EDIT)) { |
|
111 | + if( empty( $taskInfo[$this->fieldPageCatalog] ) && $parentObject->getCurrentAction()->equals( Action::EDIT ) ) { |
|
112 | 112 | $taskInfo[$this->fieldPageCatalog] = $task->{$this->fieldPageCatalog} ?? ''; |
113 | 113 | } |
114 | 114 | |
115 | - $taskInfo[$this->fieldPageCatalog] = htmlspecialchars($taskInfo[$this->fieldPageCatalog] ?? '', ENT_QUOTES, 'UTF-8'); |
|
115 | + $taskInfo[$this->fieldPageCatalog] = htmlspecialchars( $taskInfo[$this->fieldPageCatalog] ?? '', ENT_QUOTES, 'UTF-8' ); |
|
116 | 116 | |
117 | 117 | $fieldStr = '<input class="form-control" name="tx_scheduler[%1$s]" id="%1$s" value="%2$s">'; |
118 | - $fieldCode = sprintf($fieldStr, $this->fieldPageCatalog, $taskInfo[$this->fieldPageCatalog]); |
|
118 | + $fieldCode = sprintf( $fieldStr, $this->fieldPageCatalog, $taskInfo[$this->fieldPageCatalog] ); |
|
119 | 119 | |
120 | 120 | $additionalFields[$this->fieldPageCatalog] = [ |
121 | 121 | 'code' => $fieldCode, |
@@ -126,14 +126,14 @@ discard block |
||
126 | 126 | |
127 | 127 | |
128 | 128 | // In case of editing a task, set to the internal value if data wasn't already submitted |
129 | - if (empty($taskInfo[$this->fieldPageDetail]) && $parentObject->getCurrentAction()->equals(Action::EDIT)) { |
|
129 | + if( empty( $taskInfo[$this->fieldPageDetail] ) && $parentObject->getCurrentAction()->equals( Action::EDIT ) ) { |
|
130 | 130 | $taskInfo[$this->fieldPageDetail] = $task->{$this->fieldPageDetail} ?? ''; |
131 | 131 | } |
132 | 132 | |
133 | - $taskInfo[$this->fieldPageDetail] = htmlspecialchars($taskInfo[$this->fieldPageDetail] ?? '', ENT_QUOTES, 'UTF-8'); |
|
133 | + $taskInfo[$this->fieldPageDetail] = htmlspecialchars( $taskInfo[$this->fieldPageDetail] ?? '', ENT_QUOTES, 'UTF-8' ); |
|
134 | 134 | |
135 | 135 | $fieldStr = '<input class="form-control" name="tx_scheduler[%1$s]" id="%1$s" value="%2$s">'; |
136 | - $fieldCode = sprintf($fieldStr, $this->fieldPageDetail, $taskInfo[$this->fieldPageDetail]); |
|
136 | + $fieldCode = sprintf( $fieldStr, $this->fieldPageDetail, $taskInfo[$this->fieldPageDetail] ); |
|
137 | 137 | |
138 | 138 | $additionalFields[$this->fieldPageDetail] = [ |
139 | 139 | 'code' => $fieldCode, |
@@ -144,14 +144,14 @@ discard block |
||
144 | 144 | |
145 | 145 | |
146 | 146 | // In case of editing a task, set to the internal value if data wasn't already submitted |
147 | - if (empty($taskInfo[$this->fieldPageDownload]) && $parentObject->getCurrentAction()->equals(Action::EDIT)) { |
|
147 | + if( empty( $taskInfo[$this->fieldPageDownload] ) && $parentObject->getCurrentAction()->equals( Action::EDIT ) ) { |
|
148 | 148 | $taskInfo[$this->fieldPageDownload] = $task->{$this->fieldPageDownload} ?? ''; |
149 | 149 | } |
150 | 150 | |
151 | - $taskInfo[$this->fieldPageDownload] = htmlspecialchars($taskInfo[$this->fieldPageDownload] ?? '', ENT_QUOTES, 'UTF-8'); |
|
151 | + $taskInfo[$this->fieldPageDownload] = htmlspecialchars( $taskInfo[$this->fieldPageDownload] ?? '', ENT_QUOTES, 'UTF-8' ); |
|
152 | 152 | |
153 | 153 | $fieldStr = '<input class="form-control" name="tx_scheduler[%1$s]" id="%1$s" value="%2$s">'; |
154 | - $fieldCode = sprintf($fieldStr, $this->fieldPageDownload, $taskInfo[$this->fieldPageDownload]); |
|
154 | + $fieldCode = sprintf( $fieldStr, $this->fieldPageDownload, $taskInfo[$this->fieldPageDownload] ); |
|
155 | 155 | |
156 | 156 | $additionalFields[$this->fieldPageDownload] = [ |
157 | 157 | 'code' => $fieldCode, |
@@ -162,14 +162,14 @@ discard block |
||
162 | 162 | |
163 | 163 | |
164 | 164 | // In case of editing a task, set to the internal value if data wasn't already submitted |
165 | - if (empty($taskInfo[$this->fieldPageLogin]) && $parentObject->getCurrentAction()->equals(Action::EDIT)) { |
|
165 | + if( empty( $taskInfo[$this->fieldPageLogin] ) && $parentObject->getCurrentAction()->equals( Action::EDIT ) ) { |
|
166 | 166 | $taskInfo[$this->fieldPageLogin] = $task->{$this->fieldPageLogin} ?? ''; |
167 | 167 | } |
168 | 168 | |
169 | - $taskInfo[$this->fieldPageLogin] = htmlspecialchars($taskInfo[$this->fieldPageLogin] ?? '', ENT_QUOTES, 'UTF-8'); |
|
169 | + $taskInfo[$this->fieldPageLogin] = htmlspecialchars( $taskInfo[$this->fieldPageLogin] ?? '', ENT_QUOTES, 'UTF-8' ); |
|
170 | 170 | |
171 | 171 | $fieldStr = '<input class="form-control" name="tx_scheduler[%1$s]" id="%1$s" value="%2$s">'; |
172 | - $fieldCode = sprintf($fieldStr, $this->fieldPageLogin, $taskInfo[$this->fieldPageLogin]); |
|
172 | + $fieldCode = sprintf( $fieldStr, $this->fieldPageLogin, $taskInfo[$this->fieldPageLogin] ); |
|
173 | 173 | |
174 | 174 | $additionalFields[$this->fieldPageLogin] = [ |
175 | 175 | 'code' => $fieldCode, |
@@ -180,17 +180,17 @@ discard block |
||
180 | 180 | |
181 | 181 | |
182 | 182 | // In case of editing a task, set to the internal value if data wasn't already submitted |
183 | - if (empty($taskInfo[$this->fieldTemplateBaseurl]) && $parentObject->getCurrentAction()->equals(Action::EDIT)) { |
|
183 | + if( empty( $taskInfo[$this->fieldTemplateBaseurl] ) && $parentObject->getCurrentAction()->equals( Action::EDIT ) ) { |
|
184 | 184 | $taskInfo[$this->fieldTemplateBaseurl] = $task->{$this->fieldTemplateBaseurl} ?? ''; |
185 | 185 | } |
186 | 186 | |
187 | - $taskInfo[$this->fieldTemplateBaseurl] = htmlspecialchars($taskInfo[$this->fieldTemplateBaseurl] ?? '', ENT_QUOTES, 'UTF-8'); |
|
187 | + $taskInfo[$this->fieldTemplateBaseurl] = htmlspecialchars( $taskInfo[$this->fieldTemplateBaseurl] ?? '', ENT_QUOTES, 'UTF-8' ); |
|
188 | 188 | |
189 | 189 | $path = 'typo3conf/ext/aimeos/Resources/Public/Themes/default'; |
190 | 190 | $path = $taskInfo[$this->fieldTemplateBaseurl] = $taskInfo[$this->fieldTemplateBaseurl] ?? $path; |
191 | 191 | |
192 | 192 | $fieldStr = '<input class="form-control" name="tx_scheduler[%1$s]" id="%1$s" value="%2$s">'; |
193 | - $fieldCode = sprintf($fieldStr, $this->fieldTemplateBaseurl, $path); |
|
193 | + $fieldCode = sprintf( $fieldStr, $this->fieldTemplateBaseurl, $path ); |
|
194 | 194 | |
195 | 195 | $additionalFields[$this->fieldTemplateBaseurl] = [ |
196 | 196 | 'code' => $fieldCode, |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | ]; |
201 | 201 | |
202 | 202 | |
203 | - $additionalFields += parent::getFields($taskInfo, $task, $parentObject); |
|
203 | + $additionalFields += parent::getFields( $taskInfo, $task, $parentObject ); |
|
204 | 204 | |
205 | 205 | return $additionalFields; |
206 | 206 | } |
@@ -214,9 +214,9 @@ discard block |
||
214 | 214 | * @param array $submittedData Array containing the data submitted by the user |
215 | 215 | * @param object $task Reference to the current task object |
216 | 216 | */ |
217 | - protected function saveFields(array $submittedData, $task) |
|
217 | + protected function saveFields( array $submittedData, $task ) |
|
218 | 218 | { |
219 | - parent::saveFields($submittedData, $task); |
|
219 | + parent::saveFields( $submittedData, $task ); |
|
220 | 220 | |
221 | 221 | $task->{$this->fieldSenderFrom} = $submittedData[$this->fieldSenderFrom] ?? ''; |
222 | 222 | $task->{$this->fieldSenderEmail} = $submittedData[$this->fieldSenderEmail] ?? ''; |
@@ -238,33 +238,33 @@ discard block |
||
238 | 238 | * @param tx_scheduler_Module $parentObject Reference to the calling object (Scheduler's BE module) |
239 | 239 | * @return boolean True if validation was ok (or selected class is not relevant), false otherwise |
240 | 240 | */ |
241 | - protected function validateFields(array &$submittedData, $parentObject) |
|
241 | + protected function validateFields( array &$submittedData, $parentObject ) |
|
242 | 242 | { |
243 | - if (preg_match('/^.+@[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]+)*$/', $submittedData[$this->fieldSenderEmail] ?? '') !== 1) { |
|
244 | - throw new \InvalidArgumentException($GLOBALS['LANG']->sL('LLL:EXT:aimeos/Resources/Private/Language/scheduler.xlf:email.error.from-email.invalid')); |
|
243 | + if( preg_match( '/^.+@[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]+)*$/', $submittedData[$this->fieldSenderEmail] ?? '' ) !== 1 ) { |
|
244 | + throw new \InvalidArgumentException( $GLOBALS['LANG']->sL( 'LLL:EXT:aimeos/Resources/Private/Language/scheduler.xlf:email.error.from-email.invalid' ) ); |
|
245 | 245 | } |
246 | 246 | |
247 | - if (($submittedData[$this->fieldReplyEmail] ?? '') && preg_match('/^.+@[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]+)*$/', $submittedData[$this->fieldReplyEmail]) !== 1) { |
|
248 | - throw new \InvalidArgumentException($GLOBALS['LANG']->sL('LLL:EXT:aimeos/Resources/Private/Language/scheduler.xlf:email.error.reply-email.invalid')); |
|
247 | + if( ( $submittedData[$this->fieldReplyEmail] ?? '' ) && preg_match( '/^.+@[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]+)*$/', $submittedData[$this->fieldReplyEmail] ) !== 1 ) { |
|
248 | + throw new \InvalidArgumentException( $GLOBALS['LANG']->sL( 'LLL:EXT:aimeos/Resources/Private/Language/scheduler.xlf:email.error.reply-email.invalid' ) ); |
|
249 | 249 | } |
250 | 250 | |
251 | - if (preg_match('/^[0-9]+$/', $submittedData[$this->fieldPageCatalog] ?? '') !== 1) { |
|
252 | - throw new \InvalidArgumentException($GLOBALS['LANG']->sL('LLL:EXT:aimeos/Resources/Private/Language/scheduler.xlf:email.error.page-catalog.invalid')); |
|
251 | + if( preg_match( '/^[0-9]+$/', $submittedData[$this->fieldPageCatalog] ?? '' ) !== 1 ) { |
|
252 | + throw new \InvalidArgumentException( $GLOBALS['LANG']->sL( 'LLL:EXT:aimeos/Resources/Private/Language/scheduler.xlf:email.error.page-catalog.invalid' ) ); |
|
253 | 253 | } |
254 | 254 | |
255 | - if (preg_match('/^[0-9]+$/', $submittedData[$this->fieldPageDetail] ?? '') !== 1) { |
|
256 | - throw new \InvalidArgumentException($GLOBALS['LANG']->sL('LLL:EXT:aimeos/Resources/Private/Language/scheduler.xlf:email.error.page-detail.invalid')); |
|
255 | + if( preg_match( '/^[0-9]+$/', $submittedData[$this->fieldPageDetail] ?? '' ) !== 1 ) { |
|
256 | + throw new \InvalidArgumentException( $GLOBALS['LANG']->sL( 'LLL:EXT:aimeos/Resources/Private/Language/scheduler.xlf:email.error.page-detail.invalid' ) ); |
|
257 | 257 | } |
258 | 258 | |
259 | - if (preg_match('/^[0-9]+$/', $submittedData[$this->fieldPageLogin] ?? '') !== 1) { |
|
260 | - throw new \InvalidArgumentException($GLOBALS['LANG']->sL('LLL:EXT:aimeos/Resources/Private/Language/scheduler.xlf:email.error.page-login.invalid')); |
|
259 | + if( preg_match( '/^[0-9]+$/', $submittedData[$this->fieldPageLogin] ?? '' ) !== 1 ) { |
|
260 | + throw new \InvalidArgumentException( $GLOBALS['LANG']->sL( 'LLL:EXT:aimeos/Resources/Private/Language/scheduler.xlf:email.error.page-login.invalid' ) ); |
|
261 | 261 | } |
262 | 262 | |
263 | - if (preg_match('/^[0-9]+$/', $submittedData[$this->fieldPageDownload] ?? '') !== 1) { |
|
264 | - throw new \InvalidArgumentException($GLOBALS['LANG']->sL('LLL:EXT:aimeos/Resources/Private/Language/scheduler.xlf:email.error.page-download.invalid')); |
|
263 | + if( preg_match( '/^[0-9]+$/', $submittedData[$this->fieldPageDownload] ?? '' ) !== 1 ) { |
|
264 | + throw new \InvalidArgumentException( $GLOBALS['LANG']->sL( 'LLL:EXT:aimeos/Resources/Private/Language/scheduler.xlf:email.error.page-download.invalid' ) ); |
|
265 | 265 | } |
266 | 266 | |
267 | - parent::validateFields($submittedData, $parentObject); |
|
267 | + parent::validateFields( $submittedData, $parentObject ); |
|
268 | 268 | |
269 | 269 | return true; |
270 | 270 | } |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | * ['cshKey'] => The CSH key for the field |
44 | 44 | * ['cshLabel'] => The code of the CSH label |
45 | 45 | */ |
46 | - protected function getFields(array &$taskInfo, $task, $parentObject) |
|
46 | + protected function getFields( array &$taskInfo, $task, $parentObject ) |
|
47 | 47 | { |
48 | 48 | $additionalFields = []; |
49 | 49 | |
@@ -52,10 +52,10 @@ discard block |
||
52 | 52 | $taskInfo[$this->fieldController] = $task->{$this->fieldController} ?? []; |
53 | 53 | } |
54 | 54 | |
55 | - $taskInfo[$this->fieldController] = (array) ($taskInfo[$this->fieldController] ?? []); |
|
55 | + $taskInfo[$this->fieldController] = (array) ( $taskInfo[$this->fieldController] ?? [] ); |
|
56 | 56 | |
57 | - $fieldCode = sprintf('<select class="form-control" name="tx_scheduler[%1$s][]" id="%1$s" multiple="multiple" size="10" />', $this->fieldController); |
|
58 | - $fieldCode .= $this->getControllerOptions($taskInfo[$this->fieldController]); |
|
57 | + $fieldCode = sprintf( '<select class="form-control" name="tx_scheduler[%1$s][]" id="%1$s" multiple="multiple" size="10" />', $this->fieldController ); |
|
58 | + $fieldCode .= $this->getControllerOptions( $taskInfo[$this->fieldController] ); |
|
59 | 59 | $fieldCode .= '</select>'; |
60 | 60 | |
61 | 61 | $additionalFields[$this->fieldController] = [ |
@@ -71,10 +71,10 @@ discard block |
||
71 | 71 | $taskInfo[$this->fieldSite] = $task->{$this->fieldSite} ?? []; |
72 | 72 | } |
73 | 73 | |
74 | - $taskInfo[$this->fieldSite] = (array) ($taskInfo[$this->fieldSite] ?? []); |
|
74 | + $taskInfo[$this->fieldSite] = (array) ( $taskInfo[$this->fieldSite] ?? [] ); |
|
75 | 75 | |
76 | - $fieldCode = sprintf('<select class="form-control" name="tx_scheduler[%1$s][]" id="%1$s" multiple="multiple" size="10" />', $this->fieldSite); |
|
77 | - $fieldCode .= $this->getSiteOptions($this->getAvailableSites(), $taskInfo[$this->fieldSite], 0); |
|
76 | + $fieldCode = sprintf( '<select class="form-control" name="tx_scheduler[%1$s][]" id="%1$s" multiple="multiple" size="10" />', $this->fieldSite ); |
|
77 | + $fieldCode .= $this->getSiteOptions( $this->getAvailableSites(), $taskInfo[$this->fieldSite], 0 ); |
|
78 | 78 | $fieldCode .= '</select>'; |
79 | 79 | |
80 | 80 | $additionalFields[$this->fieldSite] = [ |
@@ -86,14 +86,14 @@ discard block |
||
86 | 86 | |
87 | 87 | |
88 | 88 | // In case of editing a task, set to the internal value if data wasn't already submitted |
89 | - if (empty($taskInfo[$this->fieldTSconfig]) && $parentObject->getCurrentAction()->equals(Action::EDIT)) { |
|
89 | + if( empty( $taskInfo[$this->fieldTSconfig] ) && $parentObject->getCurrentAction()->equals( Action::EDIT ) ) { |
|
90 | 90 | $taskInfo[$this->fieldTSconfig] = $task->{$this->fieldTSconfig} ?? ''; |
91 | 91 | } |
92 | 92 | |
93 | 93 | $taskInfo[$this->fieldTSconfig] = htmlspecialchars( $taskInfo[$this->fieldTSconfig] ?? '', ENT_QUOTES, 'UTF-8' ); |
94 | 94 | |
95 | 95 | $fieldStr = '<textarea class="form-control" name="tx_scheduler[%1$s]" id="%1$s" rows="20" cols="80" >%2$s</textarea>'; |
96 | - $fieldCode = sprintf($fieldStr, $this->fieldTSconfig, $taskInfo[$this->fieldTSconfig]); |
|
96 | + $fieldCode = sprintf( $fieldStr, $this->fieldTSconfig, $taskInfo[$this->fieldTSconfig] ); |
|
97 | 97 | |
98 | 98 | $additionalFields[$this->fieldTSconfig] = [ |
99 | 99 | 'code' => $fieldCode, |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | * @param array $submittedData Array containing the data submitted by the user |
115 | 115 | * @param object $task Reference to the current task object |
116 | 116 | */ |
117 | - protected function saveFields(array $submittedData, $task) |
|
117 | + protected function saveFields( array $submittedData, $task ) |
|
118 | 118 | { |
119 | 119 | $task->{$this->fieldSite} = $submittedData[$this->fieldSite] ?? ''; |
120 | 120 | $task->{$this->fieldController} = $submittedData[$this->fieldController] ?? ''; |
@@ -148,8 +148,8 @@ discard block |
||
148 | 148 | $submittedData[$this->fieldSite] = array_unique( (array) $submittedData[$this->fieldSite] ?? [] ); |
149 | 149 | $siteItems = Scheduler\Base::getSiteItems( $context, $submittedData[$this->fieldSite] ); |
150 | 150 | |
151 | - if (count($siteItems) !== count($submittedData[$this->fieldSite])) { |
|
152 | - throw new \RuntimeException($GLOBALS['LANG']->sL('LLL:EXT:aimeos/Resources/Private/Language/scheduler.xlf:default.error.sitecode')); |
|
151 | + if( count( $siteItems ) !== count( $submittedData[$this->fieldSite] ) ) { |
|
152 | + throw new \RuntimeException( $GLOBALS['LANG']->sL( 'LLL:EXT:aimeos/Resources/Private/Language/scheduler.xlf:default.error.sitecode' ) ); |
|
153 | 153 | } |
154 | 154 | |
155 | 155 | |
@@ -157,8 +157,8 @@ discard block |
||
157 | 157 | $cntlPaths = $aimeos->getCustomPaths( 'controller/jobs' ); |
158 | 158 | $submittedData[$this->fieldController] = array_unique( (array) $submittedData[$this->fieldController] ?? [] ); |
159 | 159 | |
160 | - foreach ($submittedData[$this->fieldController] as $name) { |
|
161 | - \Aimeos\Controller\Jobs::create($context, $aimeos, $name); |
|
160 | + foreach( $submittedData[$this->fieldController] as $name ) { |
|
161 | + \Aimeos\Controller\Jobs::create( $context, $aimeos, $name ); |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | return true; |
@@ -172,16 +172,16 @@ discard block |
||
172 | 172 | */ |
173 | 173 | protected function getAvailableSites() : \Aimeos\Map |
174 | 174 | { |
175 | - $manager = \Aimeos\MShop::create(Scheduler\Base::context(), 'locale/site'); |
|
175 | + $manager = \Aimeos\MShop::create( Scheduler\Base::context(), 'locale/site' ); |
|
176 | 176 | |
177 | 177 | $search = $manager->filter(); |
178 | - $search->setConditions($search->compare('==', 'locale.site.level', 0)); |
|
179 | - $search->setSortations(array($search->sort('+', 'locale.site.label'))); |
|
178 | + $search->setConditions( $search->compare( '==', 'locale.site.level', 0 ) ); |
|
179 | + $search->setSortations( array( $search->sort( '+', 'locale.site.label' ) ) ); |
|
180 | 180 | |
181 | - $sites = $manager->search($search); |
|
181 | + $sites = $manager->search( $search ); |
|
182 | 182 | |
183 | - foreach ($sites as $id => $siteItem) { |
|
184 | - $sites[$id] = $manager->getTree($id, [], \Aimeos\MW\Tree\Manager\Base::LEVEL_TREE); |
|
183 | + foreach( $sites as $id => $siteItem ) { |
|
184 | + $sites[$id] = $manager->getTree( $id, [], \Aimeos\MW\Tree\Manager\Base::LEVEL_TREE ); |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | return $sites; |
@@ -197,18 +197,18 @@ discard block |
||
197 | 197 | * @param int $level Nesting level of the sites (should start with 0) |
198 | 198 | * @return string HTML code with <option> tags for the select box |
199 | 199 | */ |
200 | - protected function getSiteOptions(\Aimeos\Map $siteItems, array $selected, int $level) : string |
|
200 | + protected function getSiteOptions( \Aimeos\Map $siteItems, array $selected, int $level ) : string |
|
201 | 201 | { |
202 | 202 | $html = ''; |
203 | - $prefix = str_repeat('-', $level) . ' '; |
|
203 | + $prefix = str_repeat( '-', $level ) . ' '; |
|
204 | 204 | |
205 | - foreach ($siteItems as $item) { |
|
206 | - $active = (in_array($item->getCode(), $selected) ? 'selected="selected"' : ''); |
|
207 | - $disabled = ($item->getStatus() > 0 ? '' : 'disabled="disabled"'); |
|
205 | + foreach( $siteItems as $item ) { |
|
206 | + $active = ( in_array( $item->getCode(), $selected ) ? 'selected="selected"' : '' ); |
|
207 | + $disabled = ( $item->getStatus() > 0 ? '' : 'disabled="disabled"' ); |
|
208 | 208 | $string = '<option value="%1$s" %2$s %3$s>%4$s</option>'; |
209 | - $html .= sprintf($string, $item->getCode(), $active, $disabled, $prefix . $item->getLabel()); |
|
209 | + $html .= sprintf( $string, $item->getCode(), $active, $disabled, $prefix . $item->getLabel() ); |
|
210 | 210 | |
211 | - $html .= $this->getSiteOptions($item->getChildren(), $selected, $level + 1); |
|
211 | + $html .= $this->getSiteOptions( $item->getChildren(), $selected, $level + 1 ); |
|
212 | 212 | } |
213 | 213 | |
214 | 214 | return $html; |
@@ -221,31 +221,31 @@ discard block |
||
221 | 221 | * @param array $selected List of site codes that were previously selected by the user |
222 | 222 | * @return string HTML code with <option> tags for the select box |
223 | 223 | */ |
224 | - protected function getControllerOptions(array $selected) : string |
|
224 | + protected function getControllerOptions( array $selected ) : string |
|
225 | 225 | { |
226 | 226 | $html = ''; |
227 | 227 | $aimeos = Base::aimeos(); |
228 | 228 | $context = Scheduler\Base::context(); |
229 | - $cntlPaths = $aimeos->getCustomPaths('controller/jobs'); |
|
229 | + $cntlPaths = $aimeos->getCustomPaths( 'controller/jobs' ); |
|
230 | 230 | |
231 | 231 | $langid = 'en'; |
232 | - if (isset($GLOBALS['BE_USER']->uc['lang']) && !in_array($GLOBALS['BE_USER']->uc['lang'], ['', 'default'])) { |
|
232 | + if( isset( $GLOBALS['BE_USER']->uc['lang'] ) && !in_array( $GLOBALS['BE_USER']->uc['lang'], ['', 'default'] ) ) { |
|
233 | 233 | $langid = $GLOBALS['BE_USER']->uc['lang']; |
234 | 234 | } |
235 | 235 | |
236 | - $localeItem = \Aimeos\MShop::create($context, 'locale')->create(); |
|
237 | - $localeItem->setLanguageId($langid); |
|
238 | - $context->setLocale($localeItem); |
|
236 | + $localeItem = \Aimeos\MShop::create( $context, 'locale' )->create(); |
|
237 | + $localeItem->setLanguageId( $langid ); |
|
238 | + $context->setLocale( $localeItem ); |
|
239 | 239 | |
240 | - $controllers = \Aimeos\Controller\Jobs::get($context, $aimeos, $cntlPaths); |
|
240 | + $controllers = \Aimeos\Controller\Jobs::get( $context, $aimeos, $cntlPaths ); |
|
241 | 241 | |
242 | - foreach ($controllers as $name => $controller) { |
|
243 | - $active = (in_array($name, $selected) ? 'selected="selected"' : ''); |
|
244 | - $title = htmlspecialchars($controller->getDescription(), ENT_QUOTES, 'UTF-8'); |
|
245 | - $cntl = htmlspecialchars(sprintf('%1$s: %2$s', $name, $controller->getName()), ENT_QUOTES, 'UTF-8'); |
|
246 | - $name = htmlspecialchars($name, ENT_QUOTES, 'UTF-8'); |
|
242 | + foreach( $controllers as $name => $controller ) { |
|
243 | + $active = ( in_array( $name, $selected ) ? 'selected="selected"' : '' ); |
|
244 | + $title = htmlspecialchars( $controller->getDescription(), ENT_QUOTES, 'UTF-8' ); |
|
245 | + $cntl = htmlspecialchars( sprintf( '%1$s: %2$s', $name, $controller->getName() ), ENT_QUOTES, 'UTF-8' ); |
|
246 | + $name = htmlspecialchars( $name, ENT_QUOTES, 'UTF-8' ); |
|
247 | 247 | |
248 | - $html .= sprintf('<option value="%1$s" title="%2$s" %3$s>%4$s</option>', $name, $title, $active, $cntl); |
|
248 | + $html .= sprintf( '<option value="%1$s" title="%2$s" %3$s>%4$s</option>', $name, $title, $active, $cntl ); |
|
249 | 249 | } |
250 | 250 | |
251 | 251 | return $html; |
@@ -36,15 +36,15 @@ discard block |
||
36 | 36 | * @return bool True if the user is allowed to access the site |
37 | 37 | * @throws \TYPO3\CMS\Core\Resource\Exception\InsufficientUserPermissionsException If user doesn't have access |
38 | 38 | */ |
39 | - protected function checkSite(array $sitePath, $userSiteId) : bool |
|
39 | + protected function checkSite( array $sitePath, $userSiteId ) : bool |
|
40 | 40 | { |
41 | - foreach (array_reverse($sitePath) as $siteid) { |
|
42 | - if ((string) $userSiteId === (string) $siteid) { |
|
41 | + foreach( array_reverse( $sitePath ) as $siteid ) { |
|
42 | + if( (string) $userSiteId === (string) $siteid ) { |
|
43 | 43 | return true; |
44 | 44 | } |
45 | 45 | } |
46 | 46 | |
47 | - throw new \TYPO3\CMS\Core\Resource\Exception\InsufficientUserPermissionsException('Access not allowed'); |
|
47 | + throw new \TYPO3\CMS\Core\Resource\Exception\InsufficientUserPermissionsException( 'Access not allowed' ); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | |
@@ -55,33 +55,33 @@ discard block |
||
55 | 55 | * @param bool $withView True to add view to context object, false for no view |
56 | 56 | * @return \Aimeos\MShop\ContextIface Context item |
57 | 57 | */ |
58 | - protected function context(string $templatePath = 'client/html/templates', |
|
59 | - bool $withView = true) : \Aimeos\MShop\ContextIface |
|
58 | + protected function context( string $templatePath = 'client/html/templates', |
|
59 | + bool $withView = true ) : \Aimeos\MShop\ContextIface |
|
60 | 60 | { |
61 | - $config = Base::config((array) $this->settings); |
|
61 | + $config = Base::config( (array) $this->settings ); |
|
62 | 62 | |
63 | - if (!isset(self::$context)) { |
|
64 | - $context = Base::context($config); |
|
65 | - $locale = Base::locale($context, $this->request); |
|
66 | - $context->setI18n(Base::i18n([$locale->getLanguageId()], $config->get('i18n', []))); |
|
67 | - $context->setLocale($locale); |
|
63 | + if( !isset( self::$context ) ) { |
|
64 | + $context = Base::context( $config ); |
|
65 | + $locale = Base::locale( $context, $this->request ); |
|
66 | + $context->setI18n( Base::i18n( [$locale->getLanguageId()], $config->get( 'i18n', [] ) ) ); |
|
67 | + $context->setLocale( $locale ); |
|
68 | 68 | |
69 | 69 | self::$context = $context; |
70 | 70 | } |
71 | 71 | |
72 | 72 | // Use plugin specific configuration |
73 | - self::$context->setConfig($config); |
|
73 | + self::$context->setConfig( $config ); |
|
74 | 74 | |
75 | - foreach (self::$context->locale()->getSiteItem()->getConfig() as $key => $value) { |
|
76 | - $config->set($key, $value); |
|
75 | + foreach( self::$context->locale()->getSiteItem()->getConfig() as $key => $value ) { |
|
76 | + $config->set( $key, $value ); |
|
77 | 77 | } |
78 | 78 | |
79 | - if ($withView === true) { |
|
79 | + if( $withView === true ) { |
|
80 | 80 | $langid = self::$context->locale()->getLanguageId(); |
81 | - $paths = self::$aimeos->getTemplatePaths($templatePath); |
|
82 | - $view = Base::view(self::$context, $this->uriBuilder, $paths, $this->request, $langid); |
|
81 | + $paths = self::$aimeos->getTemplatePaths( $templatePath ); |
|
82 | + $view = Base::view( self::$context, $this->uriBuilder, $paths, $this->request, $langid ); |
|
83 | 83 | |
84 | - self::$context->setView($view); |
|
84 | + self::$context->setView( $view ); |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | return self::$context; |
@@ -95,48 +95,48 @@ discard block |
||
95 | 95 | * @param bool $withView True to add view to context object, false for no view |
96 | 96 | * @return \Aimeos\MShop\ContextIface Context item |
97 | 97 | */ |
98 | - protected function contextBackend(string $templatePath = 'admin/jqadm/templates', |
|
99 | - bool $withView = true) : \Aimeos\MShop\ContextIface |
|
98 | + protected function contextBackend( string $templatePath = 'admin/jqadm/templates', |
|
99 | + bool $withView = true ) : \Aimeos\MShop\ContextIface |
|
100 | 100 | { |
101 | - if (!isset($this->contextBE)) { |
|
101 | + if( !isset( $this->contextBE ) ) { |
|
102 | 102 | $lang = 'en'; |
103 | 103 | $site = 'default'; |
104 | 104 | |
105 | - $config = Base::config((array) $this->settings); |
|
106 | - $context = Base::context($config); |
|
105 | + $config = Base::config( (array) $this->settings ); |
|
106 | + $context = Base::context( $config ); |
|
107 | 107 | |
108 | - if ($this->request->hasArgument('locale') && ($value = $this->request->getArgument('locale')) != '') { |
|
108 | + if( $this->request->hasArgument( 'locale' ) && ( $value = $this->request->getArgument( 'locale' ) ) != '' ) { |
|
109 | 109 | $lang = $value; |
110 | - } elseif (!in_array($GLOBALS['BE_USER']->uc['lang'] ?? '', ['', 'default'])) { |
|
110 | + } elseif( !in_array( $GLOBALS['BE_USER']->uc['lang'] ?? '', ['', 'default'] ) ) { |
|
111 | 111 | $lang = $GLOBALS['BE_USER']->uc['lang']; |
112 | 112 | } |
113 | 113 | |
114 | - if ($this->request->hasArgument('site') && ($value = $this->request->getArgument('site')) != '') { |
|
114 | + if( $this->request->hasArgument( 'site' ) && ( $value = $this->request->getArgument( 'site' ) ) != '' ) { |
|
115 | 115 | $site = $value; |
116 | - } elseif (isset($GLOBALS['BE_USER']->user['siteid']) && $GLOBALS['BE_USER']->user['siteid'] != '') { |
|
117 | - $siteManager = \Aimeos\MShop::create($context, 'locale/site'); |
|
118 | - $siteId = current(array_reverse(explode('.', trim($GLOBALS['BE_USER']->user['siteid'], '.')))); |
|
119 | - $site = ($siteId ? $siteManager->get($siteId)->getCode() : 'default'); |
|
116 | + } elseif( isset( $GLOBALS['BE_USER']->user['siteid'] ) && $GLOBALS['BE_USER']->user['siteid'] != '' ) { |
|
117 | + $siteManager = \Aimeos\MShop::create( $context, 'locale/site' ); |
|
118 | + $siteId = current( array_reverse( explode( '.', trim( $GLOBALS['BE_USER']->user['siteid'], '.' ) ) ) ); |
|
119 | + $site = ( $siteId ? $siteManager->get( $siteId )->getCode() : 'default' ); |
|
120 | 120 | } |
121 | 121 | |
122 | - $locale = Base::getLocaleBackend($context, $site); |
|
123 | - $context->setLocale($locale); |
|
122 | + $locale = Base::getLocaleBackend( $context, $site ); |
|
123 | + $context->setLocale( $locale ); |
|
124 | 124 | |
125 | - if (isset($GLOBALS['BE_USER']->user['siteid']) && $GLOBALS['BE_USER']->user['siteid'] != '') { |
|
126 | - $this->checkSite($locale->getSitePath(), $GLOBALS['BE_USER']->user['siteid']); |
|
125 | + if( isset( $GLOBALS['BE_USER']->user['siteid'] ) && $GLOBALS['BE_USER']->user['siteid'] != '' ) { |
|
126 | + $this->checkSite( $locale->getSitePath(), $GLOBALS['BE_USER']->user['siteid'] ); |
|
127 | 127 | } |
128 | 128 | |
129 | - $i18n = Base::i18n([$lang, 'en'], $config->get('i18n', [])); |
|
130 | - $context->setI18n($i18n); |
|
129 | + $i18n = Base::i18n( [$lang, 'en'], $config->get( 'i18n', [] ) ); |
|
130 | + $context->setI18n( $i18n ); |
|
131 | 131 | |
132 | - foreach ($locale->getSiteItem()->getConfig() as $key => $value) { |
|
133 | - $config->set($key, $value); |
|
132 | + foreach( $locale->getSiteItem()->getConfig() as $key => $value ) { |
|
133 | + $config->set( $key, $value ); |
|
134 | 134 | } |
135 | 135 | |
136 | - if ($withView) { |
|
137 | - $paths = self::$aimeos->getTemplatePaths($templatePath); |
|
138 | - $view = Base::view($context, $this->uriBuilder, $paths, $this->request, $lang); |
|
139 | - $context->setView($view); |
|
136 | + if( $withView ) { |
|
137 | + $paths = self::$aimeos->getTemplatePaths( $templatePath ); |
|
138 | + $view = Base::view( $context, $this->uriBuilder, $paths, $this->request, $lang ); |
|
139 | + $context->setView( $view ); |
|
140 | 140 | } |
141 | 141 | |
142 | 142 | $this->contextBE = $context; |
@@ -152,31 +152,31 @@ discard block |
||
152 | 152 | * @param \Aimeos\Client\Html\Iface $client Html client object (no type hint to prevent reflection) |
153 | 153 | * @return string HTML code for inserting into the HTML body |
154 | 154 | */ |
155 | - protected function getClientOutput(\Aimeos\Client\Html\Iface $client) |
|
155 | + protected function getClientOutput( \Aimeos\Client\Html\Iface $client ) |
|
156 | 156 | { |
157 | 157 | $uid = $this->ceUid; |
158 | - if ($GLOBALS['TYPO3_REQUEST'] instanceof \Psr\Http\Message\ServerRequestInterface |
|
159 | - && empty($GLOBALS['TYPO3_REQUEST']->getAttribute('routing')) === false |
|
158 | + if( $GLOBALS['TYPO3_REQUEST'] instanceof \Psr\Http\Message\ServerRequestInterface |
|
159 | + && empty( $GLOBALS['TYPO3_REQUEST']->getAttribute( 'routing' ) ) === false |
|
160 | 160 | ) { |
161 | - $uid .= '-' . $GLOBALS['TYPO3_REQUEST']->getAttribute('routing')->getPageType(); |
|
161 | + $uid .= '-' . $GLOBALS['TYPO3_REQUEST']->getAttribute( 'routing' )->getPageType(); |
|
162 | 162 | } |
163 | 163 | |
164 | - $client->setView($this->context()->view())->init(); |
|
165 | - $header = (string) $client->header($uid); |
|
166 | - $html = (string) $client->body($uid); |
|
164 | + $client->setView( $this->context()->view() )->init(); |
|
165 | + $header = (string) $client->header( $uid ); |
|
166 | + $html = (string) $client->body( $uid ); |
|
167 | 167 | |
168 | - if (!isset($this->responseFactory)) // TYPO3 10 |
|
168 | + if( !isset( $this->responseFactory ) ) // TYPO3 10 |
|
169 | 169 | { |
170 | - $this->response->addAdditionalHeaderData($header); |
|
170 | + $this->response->addAdditionalHeaderData( $header ); |
|
171 | 171 | return $html; |
172 | 172 | } |
173 | 173 | |
174 | - $renderer = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Page\PageRenderer::class); |
|
175 | - $renderer->addHeaderData($header); |
|
174 | + $renderer = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( \TYPO3\CMS\Core\Page\PageRenderer::class ); |
|
175 | + $renderer->addHeaderData( $header ); |
|
176 | 176 | |
177 | 177 | return $this->responseFactory->createResponse() |
178 | - ->withAddedHeader('Content-Type', 'text/html; charset=utf-8') |
|
179 | - ->withBody($this->streamFactory->createStream($html)); |
|
178 | + ->withAddedHeader( 'Content-Type', 'text/html; charset=utf-8' ) |
|
179 | + ->withBody( $this->streamFactory->createStream( $html ) ); |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | */ |
186 | 186 | protected function initializeAction() |
187 | 187 | { |
188 | - $this->uriBuilder->setArgumentPrefix('ai'); |
|
188 | + $this->uriBuilder->setArgumentPrefix( 'ai' ); |
|
189 | 189 | |
190 | 190 | $ce = $this->configurationManager->getContentObject(); |
191 | 191 | $this->ceUid = $ce->data['uid'] ?? null; |
@@ -165,9 +165,11 @@ |
||
165 | 165 | $header = (string) $client->header($uid); |
166 | 166 | $html = (string) $client->body($uid); |
167 | 167 | |
168 | - if (!isset($this->responseFactory)) // TYPO3 10 |
|
168 | + if (!isset($this->responseFactory)) { |
|
169 | + // TYPO3 10 |
|
169 | 170 | { |
170 | 171 | $this->response->addAdditionalHeaderData($header); |
172 | + } |
|
171 | 173 | return $html; |
172 | 174 | } |
173 | 175 |