@@ -67,13 +67,13 @@ discard block |
||
| 67 | 67 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 68 | 68 | * @return string HTML code |
| 69 | 69 | */ |
| 70 | - public function getBody( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 70 | + public function getBody($uid = '', array &$tags = array(), &$expire = null) |
|
| 71 | 71 | { |
| 72 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 72 | + $view = $this->setViewParams($this->getView(), $tags, $expire); |
|
| 73 | 73 | |
| 74 | 74 | $html = ''; |
| 75 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 76 | - $html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 75 | + foreach ($this->getSubClients() as $subclient) { |
|
| 76 | + $html .= $subclient->setView($view)->getBody($uid, $tags, $expire); |
|
| 77 | 77 | } |
| 78 | 78 | $view->headBody = $html; |
| 79 | 79 | |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | $tplconf = 'client/html/catalog/lists/head/standard/template-body'; |
| 101 | 101 | $default = 'catalog/lists/head-body-default.php'; |
| 102 | 102 | |
| 103 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 103 | + return $view->render($view->config($tplconf, $default)); |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | |
@@ -112,13 +112,13 @@ discard block |
||
| 112 | 112 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 113 | 113 | * @return string|null String including HTML tags for the header on error |
| 114 | 114 | */ |
| 115 | - public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 115 | + public function getHeader($uid = '', array &$tags = array(), &$expire = null) |
|
| 116 | 116 | { |
| 117 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 117 | + $view = $this->setViewParams($this->getView(), $tags, $expire); |
|
| 118 | 118 | |
| 119 | 119 | $html = ''; |
| 120 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 121 | - $html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 120 | + foreach ($this->getSubClients() as $subclient) { |
|
| 121 | + $html .= $subclient->setView($view)->getHeader($uid, $tags, $expire); |
|
| 122 | 122 | } |
| 123 | 123 | $view->headHeader = $html; |
| 124 | 124 | |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | $tplconf = 'client/html/catalog/lists/head/standard/template-header'; |
| 147 | 147 | $default = 'catalog/lists/head-header-default.php'; |
| 148 | 148 | |
| 149 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 149 | + return $view->render($view->config($tplconf, $default)); |
|
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | * @param string|null $name Name of the sub-client (Default if null) |
| 158 | 158 | * @return \Aimeos\Client\Html\Iface Sub-client object |
| 159 | 159 | */ |
| 160 | - public function getSubClient( $type, $name = null ) |
|
| 160 | + public function getSubClient($type, $name = null) |
|
| 161 | 161 | { |
| 162 | 162 | /** client/html/catalog/lists/head/decorators/excludes |
| 163 | 163 | * Excludes decorators added by the "common" option from the catalog list head html client |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | * @see client/html/catalog/lists/head/decorators/global |
| 234 | 234 | */ |
| 235 | 235 | |
| 236 | - return $this->createSubClient( 'catalog/lists/head/' . $type, $name ); |
|
| 236 | + return $this->createSubClient('catalog/lists/head/'.$type, $name); |
|
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | |
@@ -244,6 +244,6 @@ discard block |
||
| 244 | 244 | */ |
| 245 | 245 | protected function getSubClientNames() |
| 246 | 246 | { |
| 247 | - return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 247 | + return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames); |
|
| 248 | 248 | } |
| 249 | 249 | } |
| 250 | 250 | \ No newline at end of file |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | * @return \Aimeos\Client\Html\Iface Filter part implementing \Aimeos\Client\Html\Iface |
| 32 | 32 | * @throws \Aimeos\Client\Html\Exception If requested client implementation couldn't be found or initialisation fails |
| 33 | 33 | */ |
| 34 | - public static function createClient( \Aimeos\MShop\Context\Item\Iface $context, array $templatePaths, $name = null ) |
|
| 34 | + public static function createClient(\Aimeos\MShop\Context\Item\Iface $context, array $templatePaths, $name = null) |
|
| 35 | 35 | { |
| 36 | 36 | /** client/html/catalog/lists/name |
| 37 | 37 | * Class name of the used catalog list client implementation |
@@ -66,22 +66,22 @@ discard block |
||
| 66 | 66 | * @since 2014.03 |
| 67 | 67 | * @category Developer |
| 68 | 68 | */ |
| 69 | - if( $name === null ) { |
|
| 70 | - $name = $context->getConfig()->get( 'client/html/catalog/lists/name', 'Standard' ); |
|
| 69 | + if ($name === null) { |
|
| 70 | + $name = $context->getConfig()->get('client/html/catalog/lists/name', 'Standard'); |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | - if( ctype_alnum( $name ) === false ) |
|
| 73 | + if (ctype_alnum($name) === false) |
|
| 74 | 74 | { |
| 75 | - $classname = is_string( $name ) ? '\\Aimeos\\Client\\Html\\Catalog\\Lists\\' . $name : '<not a string>'; |
|
| 76 | - throw new \Aimeos\Client\Html\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) ); |
|
| 75 | + $classname = is_string($name) ? '\\Aimeos\\Client\\Html\\Catalog\\Lists\\'.$name : '<not a string>'; |
|
| 76 | + throw new \Aimeos\Client\Html\Exception(sprintf('Invalid characters in class name "%1$s"', $classname)); |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | $iface = '\\Aimeos\\Client\\Html\\Iface'; |
| 80 | - $classname = '\\Aimeos\\Client\\Html\\Catalog\\Lists\\' . $name; |
|
| 80 | + $classname = '\\Aimeos\\Client\\Html\\Catalog\\Lists\\'.$name; |
|
| 81 | 81 | |
| 82 | - $client = self::createClientBase( $context, $classname, $iface, $templatePaths ); |
|
| 82 | + $client = self::createClientBase($context, $classname, $iface, $templatePaths); |
|
| 83 | 83 | |
| 84 | - return self::addClientDecorators( $context, $client, $templatePaths, 'catalog/lists' ); |
|
| 84 | + return self::addClientDecorators($context, $client, $templatePaths, 'catalog/lists'); |
|
| 85 | 85 | } |
| 86 | 86 | } |
| 87 | 87 | |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | * @since 2014.03 |
| 112 | 112 | * @category Developer |
| 113 | 113 | */ |
| 114 | - private $subPartNames = array( 'head', 'quote', 'promo', 'pagination', 'items', 'pagination' ); |
|
| 114 | + private $subPartNames = array('head', 'quote', 'promo', 'pagination', 'items', 'pagination'); |
|
| 115 | 115 | |
| 116 | 116 | private $tags = array(); |
| 117 | 117 | private $expire; |
@@ -126,9 +126,9 @@ discard block |
||
| 126 | 126 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 127 | 127 | * @return string HTML code |
| 128 | 128 | */ |
| 129 | - public function getBody( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 129 | + public function getBody($uid = '', array &$tags = array(), &$expire = null) |
|
| 130 | 130 | { |
| 131 | - $prefixes = array( 'f', 'l' ); |
|
| 131 | + $prefixes = array('f', 'l'); |
|
| 132 | 132 | $context = $this->getContext(); |
| 133 | 133 | |
| 134 | 134 | /** client/html/catalog/list |
@@ -143,41 +143,41 @@ discard block |
||
| 143 | 143 | */ |
| 144 | 144 | $confkey = 'client/html/catalog/list'; |
| 145 | 145 | |
| 146 | - if( $context->getUserId() != null || ( $html = $this->getCached( 'body', $uid, $prefixes, $confkey ) ) === null ) |
|
| 146 | + if ($context->getUserId() != null || ($html = $this->getCached('body', $uid, $prefixes, $confkey)) === null) |
|
| 147 | 147 | { |
| 148 | 148 | $view = $this->getView(); |
| 149 | 149 | |
| 150 | 150 | try |
| 151 | 151 | { |
| 152 | - $view = $this->setViewParams( $view, $tags, $expire ); |
|
| 152 | + $view = $this->setViewParams($view, $tags, $expire); |
|
| 153 | 153 | |
| 154 | 154 | $html = ''; |
| 155 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 156 | - $html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 155 | + foreach ($this->getSubClients() as $subclient) { |
|
| 156 | + $html .= $subclient->setView($view)->getBody($uid, $tags, $expire); |
|
| 157 | 157 | } |
| 158 | 158 | $view->listBody = $html; |
| 159 | 159 | } |
| 160 | - catch( \Aimeos\Client\Html\Exception $e ) |
|
| 160 | + catch (\Aimeos\Client\Html\Exception $e) |
|
| 161 | 161 | { |
| 162 | - $error = array( $context->getI18n()->dt( 'client', $e->getMessage() ) ); |
|
| 163 | - $view->listErrorList = $view->get( 'listErrorList', array() ) + $error; |
|
| 162 | + $error = array($context->getI18n()->dt('client', $e->getMessage())); |
|
| 163 | + $view->listErrorList = $view->get('listErrorList', array()) + $error; |
|
| 164 | 164 | } |
| 165 | - catch( \Aimeos\Controller\Frontend\Exception $e ) |
|
| 165 | + catch (\Aimeos\Controller\Frontend\Exception $e) |
|
| 166 | 166 | { |
| 167 | - $error = array( $context->getI18n()->dt( 'controller/frontend', $e->getMessage() ) ); |
|
| 168 | - $view->listErrorList = $view->get( 'listErrorList', array() ) + $error; |
|
| 167 | + $error = array($context->getI18n()->dt('controller/frontend', $e->getMessage())); |
|
| 168 | + $view->listErrorList = $view->get('listErrorList', array()) + $error; |
|
| 169 | 169 | } |
| 170 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 170 | + catch (\Aimeos\MShop\Exception $e) |
|
| 171 | 171 | { |
| 172 | - $error = array( $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
| 173 | - $view->listErrorList = $view->get( 'listErrorList', array() ) + $error; |
|
| 172 | + $error = array($context->getI18n()->dt('mshop', $e->getMessage())); |
|
| 173 | + $view->listErrorList = $view->get('listErrorList', array()) + $error; |
|
| 174 | 174 | } |
| 175 | - catch( \Exception $e ) |
|
| 175 | + catch (\Exception $e) |
|
| 176 | 176 | { |
| 177 | - $context->getLogger()->log( $e->getMessage() . PHP_EOL . $e->getTraceAsString() ); |
|
| 177 | + $context->getLogger()->log($e->getMessage().PHP_EOL.$e->getTraceAsString()); |
|
| 178 | 178 | |
| 179 | - $error = array( $context->getI18n()->dt( 'client', 'A non-recoverable error occured' ) ); |
|
| 180 | - $view->listErrorList = $view->get( 'listErrorList', array() ) + $error; |
|
| 179 | + $error = array($context->getI18n()->dt('client', 'A non-recoverable error occured')); |
|
| 180 | + $view->listErrorList = $view->get('listErrorList', array()) + $error; |
|
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | /** client/html/catalog/lists/standard/template-body |
@@ -203,13 +203,13 @@ discard block |
||
| 203 | 203 | $tplconf = 'client/html/catalog/lists/standard/template-body'; |
| 204 | 204 | $default = 'catalog/lists/body-default.php'; |
| 205 | 205 | |
| 206 | - $html = $view->render( $view->config( $tplconf, $default ) ); |
|
| 206 | + $html = $view->render($view->config($tplconf, $default)); |
|
| 207 | 207 | |
| 208 | - $this->setCached( 'body', $uid, $prefixes, $confkey, $html, $tags, $expire ); |
|
| 208 | + $this->setCached('body', $uid, $prefixes, $confkey, $html, $tags, $expire); |
|
| 209 | 209 | } |
| 210 | 210 | else |
| 211 | 211 | { |
| 212 | - $html = $this->modifyBody( $html, $uid ); |
|
| 212 | + $html = $this->modifyBody($html, $uid); |
|
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | return $html; |
@@ -224,29 +224,29 @@ discard block |
||
| 224 | 224 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 225 | 225 | * @return string|null String including HTML tags for the header on error |
| 226 | 226 | */ |
| 227 | - public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 227 | + public function getHeader($uid = '', array &$tags = array(), &$expire = null) |
|
| 228 | 228 | { |
| 229 | - $prefixes = array( 'f', 'l' ); |
|
| 229 | + $prefixes = array('f', 'l'); |
|
| 230 | 230 | $context = $this->getContext(); |
| 231 | 231 | $confkey = 'client/html/catalog/list'; |
| 232 | 232 | |
| 233 | - if( $context->getUserId() != null || ( $html = $this->getCached( 'header', $uid, $prefixes, $confkey ) ) === null ) |
|
| 233 | + if ($context->getUserId() != null || ($html = $this->getCached('header', $uid, $prefixes, $confkey)) === null) |
|
| 234 | 234 | { |
| 235 | 235 | $view = $this->getView(); |
| 236 | 236 | |
| 237 | 237 | try |
| 238 | 238 | { |
| 239 | - $view = $this->setViewParams( $view, $tags, $expire ); |
|
| 239 | + $view = $this->setViewParams($view, $tags, $expire); |
|
| 240 | 240 | |
| 241 | 241 | $html = ''; |
| 242 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 243 | - $html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 242 | + foreach ($this->getSubClients() as $subclient) { |
|
| 243 | + $html .= $subclient->setView($view)->getHeader($uid, $tags, $expire); |
|
| 244 | 244 | } |
| 245 | 245 | $view->listHeader = $html; |
| 246 | 246 | } |
| 247 | - catch( \Exception $e ) |
|
| 247 | + catch (\Exception $e) |
|
| 248 | 248 | { |
| 249 | - $context->getLogger()->log( $e->getMessage() . PHP_EOL . $e->getTraceAsString() ); |
|
| 249 | + $context->getLogger()->log($e->getMessage().PHP_EOL.$e->getTraceAsString()); |
|
| 250 | 250 | } |
| 251 | 251 | |
| 252 | 252 | /** client/html/catalog/lists/standard/template-header |
@@ -273,13 +273,13 @@ discard block |
||
| 273 | 273 | $tplconf = 'client/html/catalog/lists/standard/template-header'; |
| 274 | 274 | $default = 'catalog/lists/header-default.php'; |
| 275 | 275 | |
| 276 | - $html = $view->render( $view->config( $tplconf, $default ) ); |
|
| 276 | + $html = $view->render($view->config($tplconf, $default)); |
|
| 277 | 277 | |
| 278 | - $this->setCached( 'header', $uid, $prefixes, $confkey, $html, $tags, $expire ); |
|
| 278 | + $this->setCached('header', $uid, $prefixes, $confkey, $html, $tags, $expire); |
|
| 279 | 279 | } |
| 280 | 280 | else |
| 281 | 281 | { |
| 282 | - $html = $this->modifyHeader( $html, $uid ); |
|
| 282 | + $html = $this->modifyHeader($html, $uid); |
|
| 283 | 283 | } |
| 284 | 284 | |
| 285 | 285 | return $html; |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | * @param string|null $name Name of the sub-client (Default if null) |
| 294 | 294 | * @return \Aimeos\Client\Html\Iface Sub-client object |
| 295 | 295 | */ |
| 296 | - public function getSubClient( $type, $name = null ) |
|
| 296 | + public function getSubClient($type, $name = null) |
|
| 297 | 297 | { |
| 298 | 298 | /** client/html/catalog/lists/decorators/excludes |
| 299 | 299 | * Excludes decorators added by the "common" option from the catalog list html client |
@@ -369,7 +369,7 @@ discard block |
||
| 369 | 369 | * @see client/html/catalog/lists/decorators/global |
| 370 | 370 | */ |
| 371 | 371 | |
| 372 | - return $this->createSubClient( 'catalog/lists/' . $type, $name ); |
|
| 372 | + return $this->createSubClient('catalog/lists/'.$type, $name); |
|
| 373 | 373 | } |
| 374 | 374 | |
| 375 | 375 | |
@@ -386,32 +386,32 @@ discard block |
||
| 386 | 386 | try |
| 387 | 387 | { |
| 388 | 388 | $site = $context->getLocale()->getSite()->getCode(); |
| 389 | - $params = $this->getClientParams( $view->param() ); |
|
| 390 | - $context->getSession()->set( 'aimeos/catalog/lists/params/last/' . $site, $params ); |
|
| 389 | + $params = $this->getClientParams($view->param()); |
|
| 390 | + $context->getSession()->set('aimeos/catalog/lists/params/last/'.$site, $params); |
|
| 391 | 391 | |
| 392 | 392 | parent::process(); |
| 393 | 393 | } |
| 394 | - catch( \Aimeos\Client\Html\Exception $e ) |
|
| 394 | + catch (\Aimeos\Client\Html\Exception $e) |
|
| 395 | 395 | { |
| 396 | - $error = array( $context->getI18n()->dt( 'client', $e->getMessage() ) ); |
|
| 397 | - $view->listErrorList = $view->get( 'listErrorList', array() ) + $error; |
|
| 396 | + $error = array($context->getI18n()->dt('client', $e->getMessage())); |
|
| 397 | + $view->listErrorList = $view->get('listErrorList', array()) + $error; |
|
| 398 | 398 | } |
| 399 | - catch( \Aimeos\Controller\Frontend\Exception $e ) |
|
| 399 | + catch (\Aimeos\Controller\Frontend\Exception $e) |
|
| 400 | 400 | { |
| 401 | - $error = array( $context->getI18n()->dt( 'controller/frontend', $e->getMessage() ) ); |
|
| 402 | - $view->listErrorList = $view->get( 'listErrorList', array() ) + $error; |
|
| 401 | + $error = array($context->getI18n()->dt('controller/frontend', $e->getMessage())); |
|
| 402 | + $view->listErrorList = $view->get('listErrorList', array()) + $error; |
|
| 403 | 403 | } |
| 404 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 404 | + catch (\Aimeos\MShop\Exception $e) |
|
| 405 | 405 | { |
| 406 | - $error = array( $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
| 407 | - $view->listErrorList = $view->get( 'listErrorList', array() ) + $error; |
|
| 406 | + $error = array($context->getI18n()->dt('mshop', $e->getMessage())); |
|
| 407 | + $view->listErrorList = $view->get('listErrorList', array()) + $error; |
|
| 408 | 408 | } |
| 409 | - catch( \Exception $e ) |
|
| 409 | + catch (\Exception $e) |
|
| 410 | 410 | { |
| 411 | - $context->getLogger()->log( $e->getMessage() . PHP_EOL . $e->getTraceAsString() ); |
|
| 411 | + $context->getLogger()->log($e->getMessage().PHP_EOL.$e->getTraceAsString()); |
|
| 412 | 412 | |
| 413 | - $error = array( $context->getI18n()->dt( 'client', 'A non-recoverable error occured' ) ); |
|
| 414 | - $view->listErrorList = $view->get( 'listErrorList', array() ) + $error; |
|
| 413 | + $error = array($context->getI18n()->dt('client', 'A non-recoverable error occured')); |
|
| 414 | + $view->listErrorList = $view->get('listErrorList', array()) + $error; |
|
| 415 | 415 | } |
| 416 | 416 | } |
| 417 | 417 | |
@@ -423,7 +423,7 @@ discard block |
||
| 423 | 423 | */ |
| 424 | 424 | protected function getSubClientNames() |
| 425 | 425 | { |
| 426 | - return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 426 | + return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames); |
|
| 427 | 427 | } |
| 428 | 428 | |
| 429 | 429 | |
@@ -435,37 +435,37 @@ discard block |
||
| 435 | 435 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 436 | 436 | * @return \Aimeos\MW\View\Iface Modified view object |
| 437 | 437 | */ |
| 438 | - protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null ) |
|
| 438 | + protected function setViewParams(\Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null) |
|
| 439 | 439 | { |
| 440 | - if( !isset( $this->cache ) ) |
|
| 440 | + if (!isset($this->cache)) |
|
| 441 | 441 | { |
| 442 | 442 | $context = $this->getContext(); |
| 443 | 443 | $config = $context->getConfig(); |
| 444 | 444 | |
| 445 | - $products = $this->getProductList( $view ); |
|
| 445 | + $products = $this->getProductList($view); |
|
| 446 | 446 | |
| 447 | - $text = (string) $view->param( 'f_search' ); |
|
| 448 | - $catid = (string) $view->param( 'f_catid' ); |
|
| 447 | + $text = (string) $view->param('f_search'); |
|
| 448 | + $catid = (string) $view->param('f_catid'); |
|
| 449 | 449 | |
| 450 | - if( $catid == '' ) { |
|
| 451 | - $catid = $config->get( 'client/html/catalog/lists/catid-default', '' ); |
|
| 450 | + if ($catid == '') { |
|
| 451 | + $catid = $config->get('client/html/catalog/lists/catid-default', ''); |
|
| 452 | 452 | } |
| 453 | 453 | |
| 454 | - if( $text === '' && $catid !== '' ) |
|
| 454 | + if ($text === '' && $catid !== '') |
|
| 455 | 455 | { |
| 456 | - $domains = $config->get( 'client/html/catalog/domains', array( 'media', 'text' ) ); |
|
| 457 | - $controller = \Aimeos\Controller\Frontend\Factory::createController( $context, 'catalog' ); |
|
| 456 | + $domains = $config->get('client/html/catalog/domains', array('media', 'text')); |
|
| 457 | + $controller = \Aimeos\Controller\Frontend\Factory::createController($context, 'catalog'); |
|
| 458 | 458 | |
| 459 | - $listCatPath = $controller->getCatalogPath( $catid, $domains ); |
|
| 459 | + $listCatPath = $controller->getCatalogPath($catid, $domains); |
|
| 460 | 460 | |
| 461 | - if( ( $categoryItem = end( $listCatPath ) ) !== false ) { |
|
| 461 | + if (($categoryItem = end($listCatPath)) !== false) { |
|
| 462 | 462 | $view->listCurrentCatItem = $categoryItem; |
| 463 | 463 | } |
| 464 | 464 | |
| 465 | 465 | $view->listCatPath = $listCatPath; |
| 466 | 466 | |
| 467 | - $this->addMetaItem( $listCatPath, 'catalog', $this->expire, $this->tags ); |
|
| 468 | - $this->addMetaList( array_keys( $listCatPath ), 'catalog', $this->expire ); |
|
| 467 | + $this->addMetaItem($listCatPath, 'catalog', $this->expire, $this->tags); |
|
| 468 | + $this->addMetaList(array_keys($listCatPath), 'catalog', $this->expire); |
|
| 469 | 469 | } |
| 470 | 470 | |
| 471 | 471 | /** client/html/catalog/lists/stock/enable |
@@ -489,29 +489,29 @@ discard block |
||
| 489 | 489 | * @see client/html/catalog/stock/url/action |
| 490 | 490 | * @see client/html/catalog/stock/url/config |
| 491 | 491 | */ |
| 492 | - if( !empty( $products ) && $config->get( 'client/html/catalog/lists/stock/enable', true ) === true ) { |
|
| 493 | - $view->listStockUrl = $this->getStockUrl( $view, array_keys( $products ) ); |
|
| 492 | + if (!empty($products) && $config->get('client/html/catalog/lists/stock/enable', true) === true) { |
|
| 493 | + $view->listStockUrl = $this->getStockUrl($view, array_keys($products)); |
|
| 494 | 494 | } |
| 495 | 495 | |
| 496 | 496 | |
| 497 | - $this->addMetaItem( $products, 'product', $this->expire, $this->tags ); |
|
| 498 | - $this->addMetaList( array_keys( $products ), 'product', $this->expire ); |
|
| 497 | + $this->addMetaItem($products, 'product', $this->expire, $this->tags); |
|
| 498 | + $this->addMetaList(array_keys($products), 'product', $this->expire); |
|
| 499 | 499 | |
| 500 | 500 | // Delete cache when products are added or deleted even when in "tag-all" mode |
| 501 | 501 | $this->tags[] = 'product'; |
| 502 | 502 | |
| 503 | - $view->listParams = $this->getClientParams( $view->param() ); |
|
| 504 | - $view->listPageCurr = $this->getProductListPage( $view ); |
|
| 505 | - $view->listPageSize = $this->getProductListSize( $view ); |
|
| 506 | - $view->listProductTotal = $this->getProductListTotal( $view ); |
|
| 507 | - $view->listProductSort = $view->param( 'f_sort', 'relevance' ); |
|
| 503 | + $view->listParams = $this->getClientParams($view->param()); |
|
| 504 | + $view->listPageCurr = $this->getProductListPage($view); |
|
| 505 | + $view->listPageSize = $this->getProductListSize($view); |
|
| 506 | + $view->listProductTotal = $this->getProductListTotal($view); |
|
| 507 | + $view->listProductSort = $view->param('f_sort', 'relevance'); |
|
| 508 | 508 | $view->listProductItems = $products; |
| 509 | 509 | |
| 510 | 510 | $this->cache = $view; |
| 511 | 511 | } |
| 512 | 512 | |
| 513 | - $expire = $this->expires( $this->expire, $expire ); |
|
| 514 | - $tags = array_merge( $tags, $this->tags ); |
|
| 513 | + $expire = $this->expires($this->expire, $expire); |
|
| 514 | + $tags = array_merge($tags, $this->tags); |
|
| 515 | 515 | |
| 516 | 516 | return $this->cache; |
| 517 | 517 | } |
@@ -524,7 +524,7 @@ discard block |
||
| 524 | 524 | * @param array $productIds List of product IDs |
| 525 | 525 | * @return string Generated stock level URL |
| 526 | 526 | */ |
| 527 | - protected function getStockUrl( \Aimeos\MW\View\Iface $view, array $productIds ) |
|
| 527 | + protected function getStockUrl(\Aimeos\MW\View\Iface $view, array $productIds) |
|
| 528 | 528 | { |
| 529 | 529 | /** client/html/catalog/stock/url/target |
| 530 | 530 | * Destination of the URL where the controller specified in the URL is known |
@@ -540,7 +540,7 @@ discard block |
||
| 540 | 540 | * @see client/html/catalog/stock/url/action |
| 541 | 541 | * @see client/html/catalog/stock/url/config |
| 542 | 542 | */ |
| 543 | - $stockTarget = $view->config( 'client/html/catalog/stock/url/target' ); |
|
| 543 | + $stockTarget = $view->config('client/html/catalog/stock/url/target'); |
|
| 544 | 544 | |
| 545 | 545 | /** client/html/catalog/stock/url/controller |
| 546 | 546 | * Name of the controller whose action should be called |
@@ -556,7 +556,7 @@ discard block |
||
| 556 | 556 | * @see client/html/catalog/stock/url/action |
| 557 | 557 | * @see client/html/catalog/stock/url/config |
| 558 | 558 | */ |
| 559 | - $stockController = $view->config( 'client/html/catalog/stock/url/controller', 'catalog' ); |
|
| 559 | + $stockController = $view->config('client/html/catalog/stock/url/controller', 'catalog'); |
|
| 560 | 560 | |
| 561 | 561 | /** client/html/catalog/stock/url/action |
| 562 | 562 | * Name of the action that should create the output |
@@ -572,7 +572,7 @@ discard block |
||
| 572 | 572 | * @see client/html/catalog/stock/url/controller |
| 573 | 573 | * @see client/html/catalog/stock/url/config |
| 574 | 574 | */ |
| 575 | - $stockAction = $view->config( 'client/html/catalog/stock/url/action', 'stock' ); |
|
| 575 | + $stockAction = $view->config('client/html/catalog/stock/url/action', 'stock'); |
|
| 576 | 576 | |
| 577 | 577 | /** client/html/catalog/stock/url/config |
| 578 | 578 | * Associative list of configuration options used for generating the URL |
@@ -595,11 +595,11 @@ discard block |
||
| 595 | 595 | * @see client/html/catalog/stock/url/action |
| 596 | 596 | * @see client/html/url/config |
| 597 | 597 | */ |
| 598 | - $stockConfig = $view->config( 'client/html/catalog/stock/url/config', array() ); |
|
| 598 | + $stockConfig = $view->config('client/html/catalog/stock/url/config', array()); |
|
| 599 | 599 | |
| 600 | - sort( $productIds ); |
|
| 600 | + sort($productIds); |
|
| 601 | 601 | |
| 602 | - $params = array( 's_prodid' => implode( ' ', $productIds ) ); |
|
| 603 | - return $view->url( $stockTarget, $stockController, $stockAction, $params, array(), $stockConfig ); |
|
| 602 | + $params = array('s_prodid' => implode(' ', $productIds)); |
|
| 603 | + return $view->url($stockTarget, $stockController, $stockAction, $params, array(), $stockConfig); |
|
| 604 | 604 | } |
| 605 | 605 | } |
@@ -70,13 +70,13 @@ discard block |
||
| 70 | 70 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 71 | 71 | * @return string HTML code |
| 72 | 72 | */ |
| 73 | - public function getBody( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 73 | + public function getBody($uid = '', array &$tags = array(), &$expire = null) |
|
| 74 | 74 | { |
| 75 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 75 | + $view = $this->setViewParams($this->getView(), $tags, $expire); |
|
| 76 | 76 | |
| 77 | 77 | $html = ''; |
| 78 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 79 | - $html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 78 | + foreach ($this->getSubClients() as $subclient) { |
|
| 79 | + $html .= $subclient->setView($view)->getBody($uid, $tags, $expire); |
|
| 80 | 80 | } |
| 81 | 81 | $view->promoBody = $html; |
| 82 | 82 | |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | $tplconf = 'client/html/catalog/lists/promo/standard/template-body'; |
| 104 | 104 | $default = 'catalog/lists/promo-body-default.php'; |
| 105 | 105 | |
| 106 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 106 | + return $view->render($view->config($tplconf, $default)); |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | |
@@ -115,13 +115,13 @@ discard block |
||
| 115 | 115 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 116 | 116 | * @return string|null String including HTML tags for the header on error |
| 117 | 117 | */ |
| 118 | - public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 118 | + public function getHeader($uid = '', array &$tags = array(), &$expire = null) |
|
| 119 | 119 | { |
| 120 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 120 | + $view = $this->setViewParams($this->getView(), $tags, $expire); |
|
| 121 | 121 | |
| 122 | 122 | $html = ''; |
| 123 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 124 | - $html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 123 | + foreach ($this->getSubClients() as $subclient) { |
|
| 124 | + $html .= $subclient->setView($view)->getHeader($uid, $tags, $expire); |
|
| 125 | 125 | } |
| 126 | 126 | $view->promoHeader = $html; |
| 127 | 127 | |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | $tplconf = 'client/html/catalog/lists/promo/standard/template-header'; |
| 150 | 150 | $default = 'catalog/lists/promo-header-default.php'; |
| 151 | 151 | |
| 152 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 152 | + return $view->render($view->config($tplconf, $default)); |
|
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | * @param string|null $name Name of the sub-client (Default if null) |
| 161 | 161 | * @return \Aimeos\Client\Html\Iface Sub-client object |
| 162 | 162 | */ |
| 163 | - public function getSubClient( $type, $name = null ) |
|
| 163 | + public function getSubClient($type, $name = null) |
|
| 164 | 164 | { |
| 165 | 165 | /** client/html/catalog/lists/promo/decorators/excludes |
| 166 | 166 | * Excludes decorators added by the "common" option from the catalog list promo html client |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | * @see client/html/catalog/lists/promo/decorators/global |
| 237 | 237 | */ |
| 238 | 238 | |
| 239 | - return $this->createSubClient( 'catalog/lists/promo/' . $type, $name ); |
|
| 239 | + return $this->createSubClient('catalog/lists/promo/'.$type, $name); |
|
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | */ |
| 248 | 248 | protected function getSubClientNames() |
| 249 | 249 | { |
| 250 | - return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 250 | + return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames); |
|
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | |
@@ -259,21 +259,21 @@ discard block |
||
| 259 | 259 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 260 | 260 | * @return \Aimeos\MW\View\Iface Modified view object |
| 261 | 261 | */ |
| 262 | - protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null ) |
|
| 262 | + protected function setViewParams(\Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null) |
|
| 263 | 263 | { |
| 264 | - if( !isset( $this->cache ) ) |
|
| 264 | + if (!isset($this->cache)) |
|
| 265 | 265 | { |
| 266 | 266 | $products = array(); |
| 267 | 267 | $context = $this->getContext(); |
| 268 | 268 | $config = $context->getConfig(); |
| 269 | 269 | |
| 270 | - if( isset( $view->listCurrentCatItem ) ) { |
|
| 270 | + if (isset($view->listCurrentCatItem)) { |
|
| 271 | 271 | $catId = $view->listCurrentCatItem->getId(); |
| 272 | 272 | } else { |
| 273 | - $catId = $config->get( 'client/html/catalog/lists/catid-default', '' ); |
|
| 273 | + $catId = $config->get('client/html/catalog/lists/catid-default', ''); |
|
| 274 | 274 | } |
| 275 | 275 | |
| 276 | - if( $catId != '' ) |
|
| 276 | + if ($catId != '') |
|
| 277 | 277 | { |
| 278 | 278 | /** client/html/catalog/lists/promo/size |
| 279 | 279 | * The maximum number of products that should be shown in the promotion section |
@@ -290,34 +290,34 @@ discard block |
||
| 290 | 290 | * @category User |
| 291 | 291 | * @category Developer |
| 292 | 292 | */ |
| 293 | - $size = $config->get( 'client/html/catalog/lists/promo/size', 6 ); |
|
| 294 | - $domains = $config->get( 'client/html/catalog/lists/domains', array( 'media', 'price', 'text' ) ); |
|
| 293 | + $size = $config->get('client/html/catalog/lists/promo/size', 6); |
|
| 294 | + $domains = $config->get('client/html/catalog/lists/domains', array('media', 'price', 'text')); |
|
| 295 | 295 | |
| 296 | 296 | $total = null; |
| 297 | 297 | |
| 298 | - $controller = \Aimeos\Controller\Frontend\Factory::createController( $context, 'catalog' ); |
|
| 299 | - $filter = $controller->createIndexFilterCategory( $catId, 'relevance', '+', 0, $size, 'promotion' ); |
|
| 300 | - $products = $controller->getIndexItems( $filter, $domains, $total ); |
|
| 298 | + $controller = \Aimeos\Controller\Frontend\Factory::createController($context, 'catalog'); |
|
| 299 | + $filter = $controller->createIndexFilterCategory($catId, 'relevance', '+', 0, $size, 'promotion'); |
|
| 300 | + $products = $controller->getIndexItems($filter, $domains, $total); |
|
| 301 | 301 | } |
| 302 | 302 | |
| 303 | 303 | |
| 304 | - if( !empty( $products ) && $config->get( 'client/html/catalog/lists/stock/enable', true ) === true ) |
|
| 304 | + if (!empty($products) && $config->get('client/html/catalog/lists/stock/enable', true) === true) |
|
| 305 | 305 | { |
| 306 | - $stockTarget = $config->get( 'client/html/catalog/stock/url/target' ); |
|
| 307 | - $stockController = $config->get( 'client/html/catalog/stock/url/controller', 'catalog' ); |
|
| 308 | - $stockAction = $config->get( 'client/html/catalog/stock/url/action', 'stock' ); |
|
| 309 | - $stockConfig = $config->get( 'client/html/catalog/stock/url/config', array() ); |
|
| 306 | + $stockTarget = $config->get('client/html/catalog/stock/url/target'); |
|
| 307 | + $stockController = $config->get('client/html/catalog/stock/url/controller', 'catalog'); |
|
| 308 | + $stockAction = $config->get('client/html/catalog/stock/url/action', 'stock'); |
|
| 309 | + $stockConfig = $config->get('client/html/catalog/stock/url/config', array()); |
|
| 310 | 310 | |
| 311 | - $productIds = array_keys( $products ); |
|
| 312 | - sort( $productIds ); |
|
| 311 | + $productIds = array_keys($products); |
|
| 312 | + sort($productIds); |
|
| 313 | 313 | |
| 314 | - $params = array( 's_prodid' => implode( ' ', $productIds ) ); |
|
| 315 | - $view->promoStockUrl = $view->url( $stockTarget, $stockController, $stockAction, $params, array(), $stockConfig ); |
|
| 314 | + $params = array('s_prodid' => implode(' ', $productIds)); |
|
| 315 | + $view->promoStockUrl = $view->url($stockTarget, $stockController, $stockAction, $params, array(), $stockConfig); |
|
| 316 | 316 | } |
| 317 | 317 | |
| 318 | 318 | |
| 319 | - $this->addMetaItem( $products, 'product', $this->expire, $this->tags ); |
|
| 320 | - $this->addMetaList( array_keys( $products ), 'product', $this->expire ); |
|
| 319 | + $this->addMetaItem($products, 'product', $this->expire, $this->tags); |
|
| 320 | + $this->addMetaList(array_keys($products), 'product', $this->expire); |
|
| 321 | 321 | |
| 322 | 322 | |
| 323 | 323 | $view->promoItems = $products; |
@@ -325,8 +325,8 @@ discard block |
||
| 325 | 325 | $this->cache = $view; |
| 326 | 326 | } |
| 327 | 327 | |
| 328 | - $expire = $this->expires( $this->expire, $expire ); |
|
| 329 | - $tags = array_merge( $tags, $this->tags ); |
|
| 328 | + $expire = $this->expires($this->expire, $expire); |
|
| 329 | + $tags = array_merge($tags, $this->tags); |
|
| 330 | 330 | |
| 331 | 331 | return $this->cache; |
| 332 | 332 | } |
@@ -69,13 +69,13 @@ discard block |
||
| 69 | 69 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 70 | 70 | * @return string HTML code |
| 71 | 71 | */ |
| 72 | - public function getBody( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 72 | + public function getBody($uid = '', array &$tags = array(), &$expire = null) |
|
| 73 | 73 | { |
| 74 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 74 | + $view = $this->setViewParams($this->getView(), $tags, $expire); |
|
| 75 | 75 | |
| 76 | 76 | $html = ''; |
| 77 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 78 | - $html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 77 | + foreach ($this->getSubClients() as $subclient) { |
|
| 78 | + $html .= $subclient->setView($view)->getBody($uid, $tags, $expire); |
|
| 79 | 79 | } |
| 80 | 80 | $view->pagiBody = $html; |
| 81 | 81 | |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | $tplconf = 'client/html/catalog/lists/pagination/standard/template-body'; |
| 103 | 103 | $default = 'catalog/lists/pagination-body-default.php'; |
| 104 | 104 | |
| 105 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 105 | + return $view->render($view->config($tplconf, $default)); |
|
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | |
@@ -114,19 +114,19 @@ discard block |
||
| 114 | 114 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 115 | 115 | * @return string|null String including HTML tags for the header on error |
| 116 | 116 | */ |
| 117 | - public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 117 | + public function getHeader($uid = '', array &$tags = array(), &$expire = null) |
|
| 118 | 118 | { |
| 119 | 119 | // output header only once |
| 120 | - if( $this->header !== null ) { |
|
| 120 | + if ($this->header !== null) { |
|
| 121 | 121 | return ''; |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | $this->header = true; |
| 125 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 125 | + $view = $this->setViewParams($this->getView(), $tags, $expire); |
|
| 126 | 126 | |
| 127 | 127 | $html = ''; |
| 128 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 129 | - $html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 128 | + foreach ($this->getSubClients() as $subclient) { |
|
| 129 | + $html .= $subclient->setView($view)->getHeader($uid, $tags, $expire); |
|
| 130 | 130 | } |
| 131 | 131 | $view->pagiHeader = $html; |
| 132 | 132 | |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | $tplconf = 'client/html/catalog/lists/pagination/standard/template-header'; |
| 155 | 155 | $default = 'catalog/lists/pagination-header-default.php'; |
| 156 | 156 | |
| 157 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 157 | + return $view->render($view->config($tplconf, $default)); |
|
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | * @param string|null $name Name of the sub-client (Default if null) |
| 166 | 166 | * @return \Aimeos\Client\Html\Iface Sub-client object |
| 167 | 167 | */ |
| 168 | - public function getSubClient( $type, $name = null ) |
|
| 168 | + public function getSubClient($type, $name = null) |
|
| 169 | 169 | { |
| 170 | 170 | /** client/html/catalog/lists/pagination/decorators/excludes |
| 171 | 171 | * Excludes decorators added by the "common" option from the catalog list pagination html client |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | * @see client/html/catalog/lists/pagination/decorators/global |
| 242 | 242 | */ |
| 243 | 243 | |
| 244 | - return $this->createSubClient( 'catalog/lists/pagination/' . $type, $name ); |
|
| 244 | + return $this->createSubClient('catalog/lists/pagination/'.$type, $name); |
|
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | */ |
| 253 | 253 | protected function getSubClientNames() |
| 254 | 254 | { |
| 255 | - return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 255 | + return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames); |
|
| 256 | 256 | } |
| 257 | 257 | |
| 258 | 258 | |
@@ -264,17 +264,17 @@ discard block |
||
| 264 | 264 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 265 | 265 | * @return \Aimeos\MW\View\Iface Modified view object |
| 266 | 266 | */ |
| 267 | - protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null ) |
|
| 267 | + protected function setViewParams(\Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null) |
|
| 268 | 268 | { |
| 269 | - if( !isset( $this->cache ) ) |
|
| 269 | + if (!isset($this->cache)) |
|
| 270 | 270 | { |
| 271 | 271 | $total = $view->listProductTotal; |
| 272 | 272 | $current = $view->listPageCurr; |
| 273 | - $last = ( $total != 0 ? ceil( $total / $view->listPageSize ) : 1 ); |
|
| 273 | + $last = ($total != 0 ? ceil($total / $view->listPageSize) : 1); |
|
| 274 | 274 | |
| 275 | 275 | $view->pagiPageFirst = 1; |
| 276 | - $view->pagiPagePrev = ( $current > 1 ? $current - 1 : 1 ); |
|
| 277 | - $view->pagiPageNext = ( $current < $last ? $current + 1 : $last ); |
|
| 276 | + $view->pagiPagePrev = ($current > 1 ? $current - 1 : 1); |
|
| 277 | + $view->pagiPageNext = ($current < $last ? $current + 1 : $last); |
|
| 278 | 278 | $view->pagiPageLast = $last; |
| 279 | 279 | |
| 280 | 280 | $this->cache = $view; |
@@ -70,13 +70,13 @@ discard block |
||
| 70 | 70 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 71 | 71 | * @return string HTML code |
| 72 | 72 | */ |
| 73 | - public function getBody( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 73 | + public function getBody($uid = '', array &$tags = array(), &$expire = null) |
|
| 74 | 74 | { |
| 75 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 75 | + $view = $this->setViewParams($this->getView(), $tags, $expire); |
|
| 76 | 76 | |
| 77 | 77 | $html = ''; |
| 78 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 79 | - $html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 78 | + foreach ($this->getSubClients() as $subclient) { |
|
| 79 | + $html .= $subclient->setView($view)->getBody($uid, $tags, $expire); |
|
| 80 | 80 | } |
| 81 | 81 | $view->itemsBody = $html; |
| 82 | 82 | |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | $tplconf = 'client/html/catalog/lists/items/standard/template-body'; |
| 104 | 104 | $default = 'catalog/lists/items-body-default.php'; |
| 105 | 105 | |
| 106 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 106 | + return $view->render($view->config($tplconf, $default)); |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | |
@@ -115,13 +115,13 @@ discard block |
||
| 115 | 115 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 116 | 116 | * @return string|null String including HTML tags for the header on error |
| 117 | 117 | */ |
| 118 | - public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 118 | + public function getHeader($uid = '', array &$tags = array(), &$expire = null) |
|
| 119 | 119 | { |
| 120 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 120 | + $view = $this->setViewParams($this->getView(), $tags, $expire); |
|
| 121 | 121 | |
| 122 | 122 | $html = ''; |
| 123 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 124 | - $html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 123 | + foreach ($this->getSubClients() as $subclient) { |
|
| 124 | + $html .= $subclient->setView($view)->getHeader($uid, $tags, $expire); |
|
| 125 | 125 | } |
| 126 | 126 | $view->itemsHeader = $html; |
| 127 | 127 | |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | $tplconf = 'client/html/catalog/lists/items/standard/template-header'; |
| 150 | 150 | $default = 'catalog/lists/items-header-default.php'; |
| 151 | 151 | |
| 152 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 152 | + return $view->render($view->config($tplconf, $default)); |
|
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | * @param string|null $name Name of the sub-client (Default if null) |
| 161 | 161 | * @return \Aimeos\Client\Html\Iface Sub-client object |
| 162 | 162 | */ |
| 163 | - public function getSubClient( $type, $name = null ) |
|
| 163 | + public function getSubClient($type, $name = null) |
|
| 164 | 164 | { |
| 165 | 165 | /** client/html/catalog/lists/items/decorators/excludes |
| 166 | 166 | * Excludes decorators added by the "common" option from the catalog list items html client |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | * @see client/html/catalog/lists/items/decorators/global |
| 237 | 237 | */ |
| 238 | 238 | |
| 239 | - return $this->createSubClient( 'catalog/lists/items/' . $type, $name ); |
|
| 239 | + return $this->createSubClient('catalog/lists/items/'.$type, $name); |
|
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | */ |
| 248 | 248 | protected function getSubClientNames() |
| 249 | 249 | { |
| 250 | - return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 250 | + return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames); |
|
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | |
@@ -258,11 +258,11 @@ discard block |
||
| 258 | 258 | * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
| 259 | 259 | * @return string Modified body content |
| 260 | 260 | */ |
| 261 | - public function modifyBody( $content, $uid ) |
|
| 261 | + public function modifyBody($content, $uid) |
|
| 262 | 262 | { |
| 263 | - $content = parent::modifyBody( $content, $uid ); |
|
| 263 | + $content = parent::modifyBody($content, $uid); |
|
| 264 | 264 | |
| 265 | - return $this->replaceSection( $content, $this->getView()->csrf()->formfield(), 'catalog.lists.items.csrf' ); |
|
| 265 | + return $this->replaceSection($content, $this->getView()->csrf()->formfield(), 'catalog.lists.items.csrf'); |
|
| 266 | 266 | } |
| 267 | 267 | |
| 268 | 268 | |
@@ -274,16 +274,16 @@ discard block |
||
| 274 | 274 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 275 | 275 | * @return \Aimeos\MW\View\Iface Modified view object |
| 276 | 276 | */ |
| 277 | - protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null ) |
|
| 277 | + protected function setViewParams(\Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null) |
|
| 278 | 278 | { |
| 279 | - if( !isset( $this->view ) ) |
|
| 279 | + if (!isset($this->view)) |
|
| 280 | 280 | { |
| 281 | - $view->itemPosition = ( $this->getProductListPage( $view ) - 1 ) * $this->getProductListSize( $view ); |
|
| 281 | + $view->itemPosition = ($this->getProductListPage($view) - 1) * $this->getProductListSize($view); |
|
| 282 | 282 | |
| 283 | - if( $this->getContext()->getConfig()->get( 'client/html/catalog/lists/basket-add', false ) ) |
|
| 283 | + if ($this->getContext()->getConfig()->get('client/html/catalog/lists/basket-add', false)) |
|
| 284 | 284 | { |
| 285 | - $view = $this->addSelectionProducts( $view, $tags, $expire ); |
|
| 286 | - $view = $this->addConfigAttributes( $view, $tags, $expire ); |
|
| 285 | + $view = $this->addSelectionProducts($view, $tags, $expire); |
|
| 286 | + $view = $this->addConfigAttributes($view, $tags, $expire); |
|
| 287 | 287 | } |
| 288 | 288 | |
| 289 | 289 | $this->view = $view; |
@@ -301,17 +301,17 @@ discard block |
||
| 301 | 301 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 302 | 302 | * @return \Aimeos\MW\View\Iface Modified view object |
| 303 | 303 | */ |
| 304 | - protected function addSelectionProducts( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null ) |
|
| 304 | + protected function addSelectionProducts(\Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null) |
|
| 305 | 305 | { |
| 306 | 306 | $context = $this->getContext(); |
| 307 | 307 | $config = $context->getConfig(); |
| 308 | 308 | $subProdMap = $prodMap = $prodIds = array(); |
| 309 | 309 | |
| 310 | - foreach( (array) $view->get( 'listProductItems', array() ) as $product ) |
|
| 310 | + foreach ((array) $view->get('listProductItems', array()) as $product) |
|
| 311 | 311 | { |
| 312 | - if( $product->getType() === 'select' ) |
|
| 312 | + if ($product->getType() === 'select') |
|
| 313 | 313 | { |
| 314 | - foreach( $product->getListItems( 'product', 'default' ) as $listItem ) |
|
| 314 | + foreach ($product->getListItems('product', 'default') as $listItem) |
|
| 315 | 315 | { |
| 316 | 316 | $prodMap[$listItem->getParentId()][] = $listItem->getRefId(); |
| 317 | 317 | $prodIds[$listItem->getRefId()] = null; |
@@ -319,26 +319,26 @@ discard block |
||
| 319 | 319 | } |
| 320 | 320 | } |
| 321 | 321 | |
| 322 | - $prodIds = array_keys( $prodIds ); |
|
| 322 | + $prodIds = array_keys($prodIds); |
|
| 323 | 323 | |
| 324 | 324 | |
| 325 | - $domains = array( 'text', 'price', 'media', 'attribute' ); |
|
| 326 | - $domains = $config->get( 'client/html/catalog/detail/basket/selection/domains', $domains ); |
|
| 325 | + $domains = array('text', 'price', 'media', 'attribute'); |
|
| 326 | + $domains = $config->get('client/html/catalog/detail/basket/selection/domains', $domains); |
|
| 327 | 327 | |
| 328 | - $controller = \Aimeos\Controller\Frontend\Factory::createController( $context, 'catalog' ); |
|
| 329 | - $subproducts = $controller->getProductItems( $prodIds, $domains ); |
|
| 328 | + $controller = \Aimeos\Controller\Frontend\Factory::createController($context, 'catalog'); |
|
| 329 | + $subproducts = $controller->getProductItems($prodIds, $domains); |
|
| 330 | 330 | $attrIds = $prodDeps = $attrDeps = $attrTypeDeps = array(); |
| 331 | 331 | |
| 332 | - foreach( $prodMap as $prodId => $list ) |
|
| 332 | + foreach ($prodMap as $prodId => $list) |
|
| 333 | 333 | { |
| 334 | - foreach( $list as $subProdId ) |
|
| 334 | + foreach ($list as $subProdId) |
|
| 335 | 335 | { |
| 336 | - if( isset( $subproducts[$subProdId] ) ) |
|
| 336 | + if (isset($subproducts[$subProdId])) |
|
| 337 | 337 | { |
| 338 | 338 | $subProduct = $subproducts[$subProdId]; |
| 339 | 339 | $subProdMap[$prodId][$subProdId] = $subProduct; |
| 340 | 340 | |
| 341 | - foreach( $subProduct->getRefItems( 'attribute', null, 'variant' ) as $attrId => $attrItem ) |
|
| 341 | + foreach ($subProduct->getRefItems('attribute', null, 'variant') as $attrId => $attrItem) |
|
| 342 | 342 | { |
| 343 | 343 | $attrTypeDeps[$prodId][$attrItem->getType()][$attrId] = $attrItem->getPosition(); |
| 344 | 344 | $attrDeps[$prodId][$attrId][] = $subProdId; |
@@ -348,31 +348,31 @@ discard block |
||
| 348 | 348 | } |
| 349 | 349 | } |
| 350 | 350 | |
| 351 | - ksort( $attrTypeDeps[$prodId] ); |
|
| 351 | + ksort($attrTypeDeps[$prodId]); |
|
| 352 | 352 | } |
| 353 | 353 | |
| 354 | - $this->addMetaItem( $subproducts, 'product', $this->expire, $this->tags ); |
|
| 355 | - $this->addMetaList( array_keys( $subproducts ), 'product', $this->expire ); |
|
| 354 | + $this->addMetaItem($subproducts, 'product', $this->expire, $this->tags); |
|
| 355 | + $this->addMetaList(array_keys($subproducts), 'product', $this->expire); |
|
| 356 | 356 | |
| 357 | 357 | |
| 358 | - $attrManager = $controller->createManager( 'attribute' ); |
|
| 358 | + $attrManager = $controller->createManager('attribute'); |
|
| 359 | 359 | |
| 360 | - $search = $attrManager->createSearch( true ); |
|
| 360 | + $search = $attrManager->createSearch(true); |
|
| 361 | 361 | $expr = array( |
| 362 | - $search->compare( '==', 'attribute.id', array_keys( $attrIds ) ), |
|
| 362 | + $search->compare('==', 'attribute.id', array_keys($attrIds)), |
|
| 363 | 363 | $search->getConditions(), |
| 364 | 364 | ); |
| 365 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
| 365 | + $search->setConditions($search->combine('&&', $expr)); |
|
| 366 | 366 | |
| 367 | - $domains = $config->get( 'client/html/catalog/lists/items/domains-attributes', array( 'text', 'price', 'media' ) ); |
|
| 368 | - $attributes = $attrManager->searchItems( $search, $domains ); |
|
| 367 | + $domains = $config->get('client/html/catalog/lists/items/domains-attributes', array('text', 'price', 'media')); |
|
| 368 | + $attributes = $attrManager->searchItems($search, $domains); |
|
| 369 | 369 | |
| 370 | - $this->addMetaItem( $attributes, 'attribute', $this->expire, $this->tags ); |
|
| 371 | - $this->addMetaList( array_keys( $attributes ), 'attribute', $this->expire ); |
|
| 370 | + $this->addMetaItem($attributes, 'attribute', $this->expire, $this->tags); |
|
| 371 | + $this->addMetaList(array_keys($attributes), 'attribute', $this->expire); |
|
| 372 | 372 | |
| 373 | 373 | |
| 374 | - if( !empty( $prodIds ) && $config->get( 'client/html/catalog/lists/stock/enable', true ) === true ) { |
|
| 375 | - $view->itemsStockUrl = $this->getStockUrl( $view, $prodIds ); |
|
| 374 | + if (!empty($prodIds) && $config->get('client/html/catalog/lists/stock/enable', true) === true) { |
|
| 375 | + $view->itemsStockUrl = $this->getStockUrl($view, $prodIds); |
|
| 376 | 376 | } |
| 377 | 377 | |
| 378 | 378 | $view->itemsSelectionProducts = $subProdMap; |
@@ -393,15 +393,15 @@ discard block |
||
| 393 | 393 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 394 | 394 | * @return \Aimeos\MW\View\Iface Modified view object |
| 395 | 395 | */ |
| 396 | - protected function addConfigAttributes( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null ) |
|
| 396 | + protected function addConfigAttributes(\Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null) |
|
| 397 | 397 | { |
| 398 | 398 | $context = $this->getContext(); |
| 399 | 399 | $config = $context->getConfig(); |
| 400 | 400 | $attrIds = $attributeTypes = array(); |
| 401 | 401 | |
| 402 | - foreach( (array) $view->get( 'listProductItems', array() ) as $product ) |
|
| 402 | + foreach ((array) $view->get('listProductItems', array()) as $product) |
|
| 403 | 403 | { |
| 404 | - foreach( $product->getListItems( 'attribute' ) as $listItem ) { |
|
| 404 | + foreach ($product->getListItems('attribute') as $listItem) { |
|
| 405 | 405 | $attrIds[$listItem->getRefId()] = null; |
| 406 | 406 | } |
| 407 | 407 | } |
@@ -424,29 +424,29 @@ discard block |
||
| 424 | 424 | * @since 2016.01 |
| 425 | 425 | * @category Developer |
| 426 | 426 | */ |
| 427 | - $domains = $config->get( 'client/html/catalog/lists/items/domains-attributes', array( 'text', 'price', 'media' ) ); |
|
| 427 | + $domains = $config->get('client/html/catalog/lists/items/domains-attributes', array('text', 'price', 'media')); |
|
| 428 | 428 | |
| 429 | - $controller = \Aimeos\Controller\Frontend\Factory::createController( $context, 'catalog' ); |
|
| 430 | - $attrManager = $controller->createManager( 'attribute' ); |
|
| 429 | + $controller = \Aimeos\Controller\Frontend\Factory::createController($context, 'catalog'); |
|
| 430 | + $attrManager = $controller->createManager('attribute'); |
|
| 431 | 431 | |
| 432 | - $search = $attrManager->createSearch( true ); |
|
| 432 | + $search = $attrManager->createSearch(true); |
|
| 433 | 433 | $expr = array( |
| 434 | - $search->compare( '==', 'attribute.id', array_keys( $attrIds ) ), |
|
| 434 | + $search->compare('==', 'attribute.id', array_keys($attrIds)), |
|
| 435 | 435 | $search->getConditions(), |
| 436 | 436 | ); |
| 437 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
| 437 | + $search->setConditions($search->combine('&&', $expr)); |
|
| 438 | 438 | |
| 439 | - $attrItems = $attrManager->searchItems( $search, $domains ); |
|
| 439 | + $attrItems = $attrManager->searchItems($search, $domains); |
|
| 440 | 440 | |
| 441 | - $this->addMetaItem( $attrItems, 'attribute', $this->expire, $this->tags ); |
|
| 442 | - $this->addMetaList( array_keys( $attrItems ), 'attribute', $this->expire ); |
|
| 441 | + $this->addMetaItem($attrItems, 'attribute', $this->expire, $this->tags); |
|
| 442 | + $this->addMetaList(array_keys($attrItems), 'attribute', $this->expire); |
|
| 443 | 443 | |
| 444 | 444 | |
| 445 | - foreach( (array) $view->get( 'listProductItems', array() ) as $prodId => $product ) |
|
| 445 | + foreach ((array) $view->get('listProductItems', array()) as $prodId => $product) |
|
| 446 | 446 | { |
| 447 | - foreach( $product->getRefItems( 'attribute', null, 'config' ) as $id => $attribute ) |
|
| 447 | + foreach ($product->getRefItems('attribute', null, 'config') as $id => $attribute) |
|
| 448 | 448 | { |
| 449 | - if( isset( $attrItems[$id] ) ) { |
|
| 449 | + if (isset($attrItems[$id])) { |
|
| 450 | 450 | $attributeTypes[$prodId][$attrItems[$id]->getType()][$id] = $attrItems[$id]; |
| 451 | 451 | } |
| 452 | 452 | } |
@@ -465,16 +465,16 @@ discard block |
||
| 465 | 465 | * @param array $productIds List of product IDs |
| 466 | 466 | * @return string Generated stock level URL |
| 467 | 467 | */ |
| 468 | - protected function getStockUrl( \Aimeos\MW\View\Iface $view, array $productIds ) |
|
| 468 | + protected function getStockUrl(\Aimeos\MW\View\Iface $view, array $productIds) |
|
| 469 | 469 | { |
| 470 | - $stockTarget = $view->config( 'client/html/catalog/stock/url/target' ); |
|
| 471 | - $stockController = $view->config( 'client/html/catalog/stock/url/controller', 'catalog' ); |
|
| 472 | - $stockAction = $view->config( 'client/html/catalog/stock/url/action', 'stock' ); |
|
| 473 | - $stockConfig = $view->config( 'client/html/catalog/stock/url/config', array() ); |
|
| 470 | + $stockTarget = $view->config('client/html/catalog/stock/url/target'); |
|
| 471 | + $stockController = $view->config('client/html/catalog/stock/url/controller', 'catalog'); |
|
| 472 | + $stockAction = $view->config('client/html/catalog/stock/url/action', 'stock'); |
|
| 473 | + $stockConfig = $view->config('client/html/catalog/stock/url/config', array()); |
|
| 474 | 474 | |
| 475 | - sort( $productIds ); |
|
| 475 | + sort($productIds); |
|
| 476 | 476 | |
| 477 | - $params = array( 's_prodid' => implode( ' ', $productIds ) ); |
|
| 478 | - return $view->url( $stockTarget, $stockController, $stockAction, $params, array(), $stockConfig ); |
|
| 477 | + $params = array('s_prodid' => implode(' ', $productIds)); |
|
| 478 | + return $view->url($stockTarget, $stockController, $stockAction, $params, array(), $stockConfig); |
|
| 479 | 479 | } |
| 480 | 480 | } |
| 481 | 481 | \ No newline at end of file |
@@ -68,13 +68,13 @@ discard block |
||
| 68 | 68 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 69 | 69 | * @return string HTML code |
| 70 | 70 | */ |
| 71 | - public function getBody( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 71 | + public function getBody($uid = '', array &$tags = array(), &$expire = null) |
|
| 72 | 72 | { |
| 73 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 73 | + $view = $this->setViewParams($this->getView(), $tags, $expire); |
|
| 74 | 74 | |
| 75 | 75 | $html = ''; |
| 76 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 77 | - $html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 76 | + foreach ($this->getSubClients() as $subclient) { |
|
| 77 | + $html .= $subclient->setView($view)->getBody($uid, $tags, $expire); |
|
| 78 | 78 | } |
| 79 | 79 | $view->quoteBody = $html; |
| 80 | 80 | |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | $tplconf = 'client/html/catalog/lists/quote/standard/template-body'; |
| 102 | 102 | $default = 'catalog/lists/quote-body-default.php'; |
| 103 | 103 | |
| 104 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 104 | + return $view->render($view->config($tplconf, $default)); |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | |
@@ -113,13 +113,13 @@ discard block |
||
| 113 | 113 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 114 | 114 | * @return string|null String including HTML tags for the header on error |
| 115 | 115 | */ |
| 116 | - public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 116 | + public function getHeader($uid = '', array &$tags = array(), &$expire = null) |
|
| 117 | 117 | { |
| 118 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 118 | + $view = $this->setViewParams($this->getView(), $tags, $expire); |
|
| 119 | 119 | |
| 120 | 120 | $html = ''; |
| 121 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 122 | - $html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 121 | + foreach ($this->getSubClients() as $subclient) { |
|
| 122 | + $html .= $subclient->setView($view)->getHeader($uid, $tags, $expire); |
|
| 123 | 123 | } |
| 124 | 124 | $view->quoteHeader = $html; |
| 125 | 125 | |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | $tplconf = 'client/html/catalog/lists/quote/standard/template-header'; |
| 148 | 148 | $default = 'catalog/lists/quote-header-default.php'; |
| 149 | 149 | |
| 150 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 150 | + return $view->render($view->config($tplconf, $default)); |
|
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | * @param string|null $name Name of the sub-client (Default if null) |
| 159 | 159 | * @return \Aimeos\Client\Html\Iface Sub-client object |
| 160 | 160 | */ |
| 161 | - public function getSubClient( $type, $name = null ) |
|
| 161 | + public function getSubClient($type, $name = null) |
|
| 162 | 162 | { |
| 163 | 163 | /** client/html/catalog/lists/quote/decorators/excludes |
| 164 | 164 | * Excludes decorators added by the "common" option from the catalog list quote html client |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | * @see client/html/catalog/lists/quote/decorators/global |
| 235 | 235 | */ |
| 236 | 236 | |
| 237 | - return $this->createSubClient( 'catalog/lists/quote/' . $type, $name ); |
|
| 237 | + return $this->createSubClient('catalog/lists/quote/'.$type, $name); |
|
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | */ |
| 246 | 246 | protected function getSubClientNames() |
| 247 | 247 | { |
| 248 | - return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 248 | + return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames); |
|
| 249 | 249 | } |
| 250 | 250 | |
| 251 | 251 | |
@@ -257,16 +257,16 @@ discard block |
||
| 257 | 257 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 258 | 258 | * @return \Aimeos\MW\View\Iface Modified view object |
| 259 | 259 | */ |
| 260 | - protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null ) |
|
| 260 | + protected function setViewParams(\Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null) |
|
| 261 | 261 | { |
| 262 | - if( !isset( $this->cache ) ) |
|
| 262 | + if (!isset($this->cache)) |
|
| 263 | 263 | { |
| 264 | 264 | $view->quoteItems = array(); |
| 265 | - if( isset( $view->listCatPath ) ) |
|
| 265 | + if (isset($view->listCatPath)) |
|
| 266 | 266 | { |
| 267 | 267 | $catPath = $view->listCatPath; |
| 268 | - if( ( $catItem = end( $catPath ) ) !== false ) { |
|
| 269 | - $view->quoteItems = $catItem->getRefItems( 'text', 'quote', 'default' ); |
|
| 268 | + if (($catItem = end($catPath)) !== false) { |
|
| 269 | + $view->quoteItems = $catItem->getRefItems('text', 'quote', 'default'); |
|
| 270 | 270 | } |
| 271 | 271 | } |
| 272 | 272 | |
@@ -69,13 +69,13 @@ discard block |
||
| 69 | 69 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 70 | 70 | * @return string HTML code |
| 71 | 71 | */ |
| 72 | - public function getBody( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 72 | + public function getBody($uid = '', array &$tags = array(), &$expire = null) |
|
| 73 | 73 | { |
| 74 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 74 | + $view = $this->setViewParams($this->getView(), $tags, $expire); |
|
| 75 | 75 | |
| 76 | 76 | $html = ''; |
| 77 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 78 | - $html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 77 | + foreach ($this->getSubClients() as $subclient) { |
|
| 78 | + $html .= $subclient->setView($view)->getBody($uid, $tags, $expire); |
|
| 79 | 79 | } |
| 80 | 80 | $view->boughtBody = $html; |
| 81 | 81 | |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | $tplconf = 'client/html/catalog/detail/bought/standard/template-body'; |
| 103 | 103 | $default = 'catalog/detail/bought-body-default.php'; |
| 104 | 104 | |
| 105 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 105 | + return $view->render($view->config($tplconf, $default)); |
|
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | |
@@ -114,13 +114,13 @@ discard block |
||
| 114 | 114 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 115 | 115 | * @return string|null String including HTML tags for the header on error |
| 116 | 116 | */ |
| 117 | - public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 117 | + public function getHeader($uid = '', array &$tags = array(), &$expire = null) |
|
| 118 | 118 | { |
| 119 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 119 | + $view = $this->setViewParams($this->getView(), $tags, $expire); |
|
| 120 | 120 | |
| 121 | 121 | $html = ''; |
| 122 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 123 | - $html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 122 | + foreach ($this->getSubClients() as $subclient) { |
|
| 123 | + $html .= $subclient->setView($view)->getHeader($uid, $tags, $expire); |
|
| 124 | 124 | } |
| 125 | 125 | $view->boughtHeader = $html; |
| 126 | 126 | |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | $tplconf = 'client/html/catalog/detail/bought/standard/template-header'; |
| 149 | 149 | $default = 'catalog/detail/bought-header-default.php'; |
| 150 | 150 | |
| 151 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 151 | + return $view->render($view->config($tplconf, $default)); |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | * @param string|null $name Name of the sub-client (Default if null) |
| 160 | 160 | * @return \Aimeos\Client\Html\Iface Sub-client object |
| 161 | 161 | */ |
| 162 | - public function getSubClient( $type, $name = null ) |
|
| 162 | + public function getSubClient($type, $name = null) |
|
| 163 | 163 | { |
| 164 | 164 | /** client/html/catalog/detail/bought/decorators/excludes |
| 165 | 165 | * Excludes decorators added by the "common" option from the catalog detail bought html client |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | * @see client/html/catalog/detail/bought/decorators/global |
| 236 | 236 | */ |
| 237 | 237 | |
| 238 | - return $this->createSubClient( 'catalog/detail/bought/' . $type, $name ); |
|
| 238 | + return $this->createSubClient('catalog/detail/bought/'.$type, $name); |
|
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | */ |
| 247 | 247 | protected function getSubClientNames() |
| 248 | 248 | { |
| 249 | - return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 249 | + return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames); |
|
| 250 | 250 | } |
| 251 | 251 | |
| 252 | 252 | |
@@ -258,23 +258,23 @@ discard block |
||
| 258 | 258 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 259 | 259 | * @return \Aimeos\MW\View\Iface Modified view object |
| 260 | 260 | */ |
| 261 | - protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null ) |
|
| 261 | + protected function setViewParams(\Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null) |
|
| 262 | 262 | { |
| 263 | - if( !isset( $this->cache ) ) |
|
| 263 | + if (!isset($this->cache)) |
|
| 264 | 264 | { |
| 265 | - if( isset( $view->detailProductItem ) ) |
|
| 265 | + if (isset($view->detailProductItem)) |
|
| 266 | 266 | { |
| 267 | 267 | $context = $this->getContext(); |
| 268 | 268 | $config = $context->getConfig(); |
| 269 | - $domains = array( 'text', 'price', 'media' ); |
|
| 270 | - $products = $view->detailProductItem->getRefItems( 'product', null, 'bought-together' ); |
|
| 269 | + $domains = array('text', 'price', 'media'); |
|
| 270 | + $products = $view->detailProductItem->getRefItems('product', null, 'bought-together'); |
|
| 271 | 271 | |
| 272 | 272 | /** client/html/catalog/detail/domains |
| 273 | 273 | * A list of domain names whose items should be available in the catalog view templates |
| 274 | 274 | * |
| 275 | 275 | * @see client/html/catalog/detail/domains |
| 276 | 276 | */ |
| 277 | - $domains = $config->get( 'client/html/catalog/detail/domains', $domains ); |
|
| 277 | + $domains = $config->get('client/html/catalog/detail/domains', $domains); |
|
| 278 | 278 | |
| 279 | 279 | /** client/html/catalog/detail/bought/domains |
| 280 | 280 | * A list of domain names whose items should be available in the bought part of the catalog detail view templates |
@@ -297,22 +297,22 @@ discard block |
||
| 297 | 297 | * @category Developer |
| 298 | 298 | * @see client/html/catalog/detail/domains |
| 299 | 299 | */ |
| 300 | - $domains = $config->get( 'client/html/catalog/detail/bought/domains', $domains ); |
|
| 300 | + $domains = $config->get('client/html/catalog/detail/bought/domains', $domains); |
|
| 301 | 301 | |
| 302 | - $controller = \Aimeos\Controller\Frontend\Factory::createController( $context, 'catalog' ); |
|
| 302 | + $controller = \Aimeos\Controller\Frontend\Factory::createController($context, 'catalog'); |
|
| 303 | 303 | |
| 304 | - $view->boughtItems = $controller->getProductItems( array_keys( $products ), $domains ); |
|
| 304 | + $view->boughtItems = $controller->getProductItems(array_keys($products), $domains); |
|
| 305 | 305 | $view->boughtPosItems = $products; |
| 306 | 306 | |
| 307 | - $this->addMetaItem( $view->boughtItems, 'product', $this->expire, $this->tags ); |
|
| 308 | - $this->addMetaList( array_keys( $view->boughtItems ), 'product', $this->expire ); |
|
| 307 | + $this->addMetaItem($view->boughtItems, 'product', $this->expire, $this->tags); |
|
| 308 | + $this->addMetaList(array_keys($view->boughtItems), 'product', $this->expire); |
|
| 309 | 309 | } |
| 310 | 310 | |
| 311 | 311 | $this->cache = $view; |
| 312 | 312 | } |
| 313 | 313 | |
| 314 | - $expire = $this->expires( $this->expire, $expire ); |
|
| 315 | - $tags = array_merge( $tags, $this->tags ); |
|
| 314 | + $expire = $this->expires($this->expire, $expire); |
|
| 315 | + $tags = array_merge($tags, $this->tags); |
|
| 316 | 316 | |
| 317 | 317 | return $this->cache; |
| 318 | 318 | } |
@@ -67,13 +67,13 @@ discard block |
||
| 67 | 67 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 68 | 68 | * @return string HTML code |
| 69 | 69 | */ |
| 70 | - public function getBody( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 70 | + public function getBody($uid = '', array &$tags = array(), &$expire = null) |
|
| 71 | 71 | { |
| 72 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 72 | + $view = $this->setViewParams($this->getView(), $tags, $expire); |
|
| 73 | 73 | |
| 74 | 74 | $html = ''; |
| 75 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 76 | - $html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 75 | + foreach ($this->getSubClients() as $subclient) { |
|
| 76 | + $html .= $subclient->setView($view)->getBody($uid, $tags, $expire); |
|
| 77 | 77 | } |
| 78 | 78 | $view->socialBody = $html; |
| 79 | 79 | |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | $tplconf = 'client/html/catalog/detail/social/standard/template-body'; |
| 101 | 101 | $default = 'catalog/detail/social-body-default.php'; |
| 102 | 102 | |
| 103 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 103 | + return $view->render($view->config($tplconf, $default)); |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | |
@@ -112,13 +112,13 @@ discard block |
||
| 112 | 112 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 113 | 113 | * @return string|null String including HTML tags for the header on error |
| 114 | 114 | */ |
| 115 | - public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 115 | + public function getHeader($uid = '', array &$tags = array(), &$expire = null) |
|
| 116 | 116 | { |
| 117 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 117 | + $view = $this->setViewParams($this->getView(), $tags, $expire); |
|
| 118 | 118 | |
| 119 | 119 | $html = ''; |
| 120 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 121 | - $html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 120 | + foreach ($this->getSubClients() as $subclient) { |
|
| 121 | + $html .= $subclient->setView($view)->getHeader($uid, $tags, $expire); |
|
| 122 | 122 | } |
| 123 | 123 | $view->socialHeader = $html; |
| 124 | 124 | |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | $tplconf = 'client/html/catalog/detail/social/standard/template-header'; |
| 147 | 147 | $default = 'catalog/detail/social-header-default.php'; |
| 148 | 148 | |
| 149 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 149 | + return $view->render($view->config($tplconf, $default)); |
|
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | * @param string|null $name Name of the sub-client (Default if null) |
| 158 | 158 | * @return \Aimeos\Client\Html\Iface Sub-client object |
| 159 | 159 | */ |
| 160 | - public function getSubClient( $type, $name = null ) |
|
| 160 | + public function getSubClient($type, $name = null) |
|
| 161 | 161 | { |
| 162 | 162 | /** client/html/catalog/detail/social/decorators/excludes |
| 163 | 163 | * Excludes decorators added by the "common" option from the catalog detail social html client |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | * @see client/html/catalog/detail/social/decorators/global |
| 234 | 234 | */ |
| 235 | 235 | |
| 236 | - return $this->createSubClient( 'catalog/detail/social/' . $type, $name ); |
|
| 236 | + return $this->createSubClient('catalog/detail/social/'.$type, $name); |
|
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | |
@@ -244,6 +244,6 @@ discard block |
||
| 244 | 244 | */ |
| 245 | 245 | protected function getSubClientNames() |
| 246 | 246 | { |
| 247 | - return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 247 | + return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames); |
|
| 248 | 248 | } |
| 249 | 249 | } |
| 250 | 250 | \ No newline at end of file |