@@ -72,8 +72,8 @@ discard block |
||
| 72 | 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->productBody = $html; |
| 79 | 79 | |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | $tplconf = 'client/html/basket/mini/product/standard/template-body'; |
| 101 | 101 | $default = 'basket/mini/product-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 | |
@@ -114,11 +114,11 @@ discard block |
||
| 114 | 114 | */ |
| 115 | 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->productHeader = $html; |
| 124 | 124 | |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | $tplconf = 'client/html/basket/mini/product/standard/template-header'; |
| 147 | 147 | $default = 'basket/mini/product-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 | |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | * @see client/html/basket/mini/product/decorators/global |
| 234 | 234 | */ |
| 235 | 235 | |
| 236 | - return $this->createSubClient( 'basket/mini/product/' . $type, $name ); |
|
| 236 | + return $this->createSubClient('basket/mini/product/'.$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/basket/mini/name |
| 37 | 37 | * Class name of the used basket mini 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/basket/mini/name', 'Standard' ); |
|
| 69 | + if ($name === null) { |
|
| 70 | + $name = $context->getConfig()->get('client/html/basket/mini/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\\Basket\\Mini\\' . $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\\Basket\\Mini\\'.$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\\Basket\\Mini\\' . $name; |
|
| 80 | + $classname = '\\Aimeos\\Client\\Html\\Basket\\Mini\\'.$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, 'basket/mini' ); |
|
| 84 | + return self::addClientDecorators($context, $client, $templatePaths, 'basket/mini'); |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | } |
| 88 | 88 | \ No newline at end of file |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | * @since 2015.09 |
| 79 | 79 | * @category Developer |
| 80 | 80 | */ |
| 81 | - private $subPartNames = array( 'main', 'product' ); |
|
| 81 | + private $subPartNames = array('main', 'product'); |
|
| 82 | 82 | |
| 83 | 83 | private $cache; |
| 84 | 84 | |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 92 | 92 | * @return string HTML code |
| 93 | 93 | */ |
| 94 | - public function getBody( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 94 | + public function getBody($uid = '', array &$tags = array(), &$expire = null) |
|
| 95 | 95 | { |
| 96 | 96 | $context = $this->getContext(); |
| 97 | 97 | $site = $context->getLocale()->getSiteId(); |
@@ -107,42 +107,42 @@ discard block |
||
| 107 | 107 | * @category Developer |
| 108 | 108 | * @see client/html/basket#mini |
| 109 | 109 | */ |
| 110 | - $config = $context->getConfig()->get( 'client/html/basket/mini', array() ); |
|
| 111 | - $key = $this->getParamHash( array(), $uid . $site . ':basket:mini-body', $config ); |
|
| 110 | + $config = $context->getConfig()->get('client/html/basket/mini', array()); |
|
| 111 | + $key = $this->getParamHash(array(), $uid.$site.':basket:mini-body', $config); |
|
| 112 | 112 | |
| 113 | - if( ( $html = $this->getBasketCached( $key ) ) === null ) |
|
| 113 | + if (($html = $this->getBasketCached($key)) === null) |
|
| 114 | 114 | { |
| 115 | 115 | try |
| 116 | 116 | { |
| 117 | - $view = $this->setViewParams( $view, $tags, $expire ); |
|
| 117 | + $view = $this->setViewParams($view, $tags, $expire); |
|
| 118 | 118 | |
| 119 | 119 | $output = ''; |
| 120 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 121 | - $output .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 120 | + foreach ($this->getSubClients() as $subclient) { |
|
| 121 | + $output .= $subclient->setView($view)->getBody($uid, $tags, $expire); |
|
| 122 | 122 | } |
| 123 | 123 | $view->miniBody = $output; |
| 124 | 124 | } |
| 125 | - catch( \Aimeos\Client\Html\Exception $e ) |
|
| 125 | + catch (\Aimeos\Client\Html\Exception $e) |
|
| 126 | 126 | { |
| 127 | - $error = array( $context->getI18n()->dt( 'client', $e->getMessage() ) ); |
|
| 128 | - $view->miniErrorList = $view->get( 'miniErrorList', array() ) + $error; |
|
| 127 | + $error = array($context->getI18n()->dt('client', $e->getMessage())); |
|
| 128 | + $view->miniErrorList = $view->get('miniErrorList', array()) + $error; |
|
| 129 | 129 | } |
| 130 | - catch( \Aimeos\Controller\Frontend\Exception $e ) |
|
| 130 | + catch (\Aimeos\Controller\Frontend\Exception $e) |
|
| 131 | 131 | { |
| 132 | - $error = array( $context->getI18n()->dt( 'controller/frontend', $e->getMessage() ) ); |
|
| 133 | - $view->miniErrorList = $view->get( 'miniErrorList', array() ) + $error; |
|
| 132 | + $error = array($context->getI18n()->dt('controller/frontend', $e->getMessage())); |
|
| 133 | + $view->miniErrorList = $view->get('miniErrorList', array()) + $error; |
|
| 134 | 134 | } |
| 135 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 135 | + catch (\Aimeos\MShop\Exception $e) |
|
| 136 | 136 | { |
| 137 | - $error = array( $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
| 138 | - $view->miniErrorList = $view->get( 'miniErrorList', array() ) + $error; |
|
| 137 | + $error = array($context->getI18n()->dt('mshop', $e->getMessage())); |
|
| 138 | + $view->miniErrorList = $view->get('miniErrorList', array()) + $error; |
|
| 139 | 139 | } |
| 140 | - catch( \Exception $e ) |
|
| 140 | + catch (\Exception $e) |
|
| 141 | 141 | { |
| 142 | - $context->getLogger()->log( $e->getMessage() . PHP_EOL . $e->getTraceAsString() ); |
|
| 142 | + $context->getLogger()->log($e->getMessage().PHP_EOL.$e->getTraceAsString()); |
|
| 143 | 143 | |
| 144 | - $error = array( $context->getI18n()->dt( 'client', 'A non-recoverable error occured' ) ); |
|
| 145 | - $view->miniErrorList = $view->get( 'miniErrorList', array() ) + $error; |
|
| 144 | + $error = array($context->getI18n()->dt('client', 'A non-recoverable error occured')); |
|
| 145 | + $view->miniErrorList = $view->get('miniErrorList', array()) + $error; |
|
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | /** client/html/basket/mini/standard/template-body |
@@ -168,12 +168,12 @@ discard block |
||
| 168 | 168 | $tplconf = 'client/html/basket/mini/standard/template-body'; |
| 169 | 169 | $default = 'basket/mini/body-default.php'; |
| 170 | 170 | |
| 171 | - $html = $view->render( $view->config( $tplconf, $default ) ); |
|
| 172 | - $this->setBasketCached( $key, $html ); |
|
| 171 | + $html = $view->render($view->config($tplconf, $default)); |
|
| 172 | + $this->setBasketCached($key, $html); |
|
| 173 | 173 | } |
| 174 | 174 | else |
| 175 | 175 | { |
| 176 | - $html = $this->modifyBody( $html, $uid ); |
|
| 176 | + $html = $this->modifyBody($html, $uid); |
|
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | return $html; |
@@ -188,24 +188,24 @@ discard block |
||
| 188 | 188 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 189 | 189 | * @return string|null String including HTML tags for the header on error |
| 190 | 190 | */ |
| 191 | - public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 191 | + public function getHeader($uid = '', array &$tags = array(), &$expire = null) |
|
| 192 | 192 | { |
| 193 | 193 | $context = $this->getContext(); |
| 194 | 194 | $site = $context->getLocale()->getSiteId(); |
| 195 | 195 | $view = $this->getView(); |
| 196 | 196 | |
| 197 | - $config = $context->getConfig()->get( 'client/html/basket/mini', array() ); |
|
| 198 | - $key = $this->getParamHash( array(), $uid . $site . ':basket:mini-header', $config ); |
|
| 197 | + $config = $context->getConfig()->get('client/html/basket/mini', array()); |
|
| 198 | + $key = $this->getParamHash(array(), $uid.$site.':basket:mini-header', $config); |
|
| 199 | 199 | |
| 200 | - if( ( $html = $this->getBasketCached( $key ) ) === null ) |
|
| 200 | + if (($html = $this->getBasketCached($key)) === null) |
|
| 201 | 201 | { |
| 202 | 202 | try |
| 203 | 203 | { |
| 204 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 204 | + $view = $this->setViewParams($this->getView(), $tags, $expire); |
|
| 205 | 205 | |
| 206 | 206 | $output = ''; |
| 207 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 208 | - $output .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 207 | + foreach ($this->getSubClients() as $subclient) { |
|
| 208 | + $output .= $subclient->setView($view)->getHeader($uid, $tags, $expire); |
|
| 209 | 209 | } |
| 210 | 210 | $view->miniHeader = $output; |
| 211 | 211 | |
@@ -233,17 +233,17 @@ discard block |
||
| 233 | 233 | $tplconf = 'client/html/basket/mini/standard/template-header'; |
| 234 | 234 | $default = 'basket/mini/header-default.php'; |
| 235 | 235 | |
| 236 | - $html = $view->render( $view->config( $tplconf, $default ) ); |
|
| 237 | - $this->setBasketCached( $key, $html ); |
|
| 236 | + $html = $view->render($view->config($tplconf, $default)); |
|
| 237 | + $this->setBasketCached($key, $html); |
|
| 238 | 238 | } |
| 239 | - catch( \Exception $e ) |
|
| 239 | + catch (\Exception $e) |
|
| 240 | 240 | { |
| 241 | - $this->getContext()->getLogger()->log( $e->getMessage() . PHP_EOL . $e->getTraceAsString() ); |
|
| 241 | + $this->getContext()->getLogger()->log($e->getMessage().PHP_EOL.$e->getTraceAsString()); |
|
| 242 | 242 | } |
| 243 | 243 | } |
| 244 | 244 | else |
| 245 | 245 | { |
| 246 | - $html = $this->modifyHeader( $html, $uid ); |
|
| 246 | + $html = $this->modifyHeader($html, $uid); |
|
| 247 | 247 | } |
| 248 | 248 | |
| 249 | 249 | return $html; |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | * @param string|null $name Name of the sub-client (Default if null) |
| 258 | 258 | * @return \Aimeos\Client\Html\Iface Sub-client object |
| 259 | 259 | */ |
| 260 | - public function getSubClient( $type, $name = null ) |
|
| 260 | + public function getSubClient($type, $name = null) |
|
| 261 | 261 | { |
| 262 | 262 | /** client/html/basket/mini/decorators/excludes |
| 263 | 263 | * Excludes decorators added by the "common" option from the basket mini html client |
@@ -333,7 +333,7 @@ discard block |
||
| 333 | 333 | * @see client/html/basket/mini/decorators/global |
| 334 | 334 | */ |
| 335 | 335 | |
| 336 | - return $this->createSubClient( 'basket/mini/' . $type, $name ); |
|
| 336 | + return $this->createSubClient('basket/mini/'.$type, $name); |
|
| 337 | 337 | } |
| 338 | 338 | |
| 339 | 339 | |
@@ -344,7 +344,7 @@ discard block |
||
| 344 | 344 | */ |
| 345 | 345 | protected function getSubClientNames() |
| 346 | 346 | { |
| 347 | - return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 347 | + return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames); |
|
| 348 | 348 | } |
| 349 | 349 | |
| 350 | 350 | |
@@ -356,11 +356,11 @@ discard block |
||
| 356 | 356 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 357 | 357 | * @return \Aimeos\MW\View\Iface Modified view object |
| 358 | 358 | */ |
| 359 | - protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null ) |
|
| 359 | + protected function setViewParams(\Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null) |
|
| 360 | 360 | { |
| 361 | - if( !isset( $this->cache ) ) |
|
| 361 | + if (!isset($this->cache)) |
|
| 362 | 362 | { |
| 363 | - $controller = \Aimeos\Controller\Frontend\Factory::createController( $this->getContext(), 'basket' ); |
|
| 363 | + $controller = \Aimeos\Controller\Frontend\Factory::createController($this->getContext(), 'basket'); |
|
| 364 | 364 | $view->miniBasket = $controller->get(); |
| 365 | 365 | |
| 366 | 366 | $this->cache = $view; |
@@ -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->mainBody = $html; |
| 80 | 80 | |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | $tplconf = 'client/html/basket/mini/main/standard/template-body'; |
| 102 | 102 | $default = 'basket/mini/main-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->mainHeader = $html; |
| 125 | 125 | |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | $tplconf = 'client/html/basket/mini/main/standard/template-header'; |
| 148 | 148 | $default = 'basket/mini/main-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/basket/mini/main/decorators/excludes |
| 164 | 164 | * Excludes decorators added by the "common" option from the basket mini main html client |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | * @see client/html/basket/mini/main/decorators/excludes |
| 234 | 234 | * @see client/html/basket/mini/main/decorators/global |
| 235 | 235 | */ |
| 236 | - return $this->createSubClient( 'basket/mini/main/' . $type, $name ); |
|
| 236 | + return $this->createSubClient('basket/mini/main/'.$type, $name); |
|
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | |
@@ -244,7 +244,7 @@ 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 | |
@@ -256,14 +256,14 @@ discard block |
||
| 256 | 256 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 257 | 257 | * @return \Aimeos\MW\View\Iface Modified view object |
| 258 | 258 | */ |
| 259 | - protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null ) |
|
| 259 | + protected function setViewParams(\Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null) |
|
| 260 | 260 | { |
| 261 | - if( !isset( $this->cache ) ) |
|
| 261 | + if (!isset($this->cache)) |
|
| 262 | 262 | { |
| 263 | 263 | $view->mainPriceItem = $view->miniBasket->getPrice(); |
| 264 | 264 | |
| 265 | 265 | $count = 0; |
| 266 | - foreach( $view->miniBasket->getProducts() as $product ) { |
|
| 266 | + foreach ($view->miniBasket->getProducts() as $product) { |
|
| 267 | 267 | $count += $product->getQuantity(); |
| 268 | 268 | } |
| 269 | 269 | |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | * @param array $templatePaths Associative list of the file system paths to the core or the extensions as key |
| 36 | 36 | * and a list of relative paths inside the core or the extension as values |
| 37 | 37 | */ |
| 38 | - public function __construct( \Aimeos\MShop\Context\Item\Iface $context, array $templatePaths ) |
|
| 38 | + public function __construct(\Aimeos\MShop\Context\Item\Iface $context, array $templatePaths) |
|
| 39 | 39 | { |
| 40 | 40 | $this->context = $context; |
| 41 | 41 | $this->templatePaths = $templatePaths; |
@@ -49,8 +49,8 @@ discard block |
||
| 49 | 49 | */ |
| 50 | 50 | public function getView() |
| 51 | 51 | { |
| 52 | - if( !isset( $this->view ) ) { |
|
| 53 | - throw new \Aimeos\Client\Html\Exception( sprintf( 'No view available' ) ); |
|
| 52 | + if (!isset($this->view)) { |
|
| 53 | + throw new \Aimeos\Client\Html\Exception(sprintf('No view available')); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | return $this->view; |
@@ -64,14 +64,14 @@ discard block |
||
| 64 | 64 | * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
| 65 | 65 | * @return string Modified body content |
| 66 | 66 | */ |
| 67 | - public function modifyBody( $content, $uid ) |
|
| 67 | + public function modifyBody($content, $uid) |
|
| 68 | 68 | { |
| 69 | 69 | $view = $this->getView(); |
| 70 | 70 | |
| 71 | - foreach( $this->getSubClients() as $subclient ) |
|
| 71 | + foreach ($this->getSubClients() as $subclient) |
|
| 72 | 72 | { |
| 73 | - $subclient->setView( $view ); |
|
| 74 | - $content = $subclient->modifyBody( $content, $uid ); |
|
| 73 | + $subclient->setView($view); |
|
| 74 | + $content = $subclient->modifyBody($content, $uid); |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | return $content; |
@@ -85,14 +85,14 @@ discard block |
||
| 85 | 85 | * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
| 86 | 86 | * @return string Modified header content |
| 87 | 87 | */ |
| 88 | - public function modifyHeader( $content, $uid ) |
|
| 88 | + public function modifyHeader($content, $uid) |
|
| 89 | 89 | { |
| 90 | 90 | $view = $this->getView(); |
| 91 | 91 | |
| 92 | - foreach( $this->getSubClients() as $subclient ) |
|
| 92 | + foreach ($this->getSubClients() as $subclient) |
|
| 93 | 93 | { |
| 94 | - $subclient->setView( $view ); |
|
| 95 | - $content = $subclient->modifyHeader( $content, $uid ); |
|
| 94 | + $subclient->setView($view); |
|
| 95 | + $content = $subclient->modifyHeader($content, $uid); |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | return $content; |
@@ -110,11 +110,11 @@ discard block |
||
| 110 | 110 | { |
| 111 | 111 | $view = $this->getView(); |
| 112 | 112 | |
| 113 | - foreach( $this->getSubClients() as $subclient ) |
|
| 113 | + foreach ($this->getSubClients() as $subclient) |
|
| 114 | 114 | { |
| 115 | - $subclient->setView( $view ); |
|
| 115 | + $subclient->setView($view); |
|
| 116 | 116 | |
| 117 | - if( $subclient->process() === false ) { |
|
| 117 | + if ($subclient->process() === false) { |
|
| 118 | 118 | return false; |
| 119 | 119 | } |
| 120 | 120 | } |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | * @param \Aimeos\MW\View\Iface $view The view object which generates the HTML output |
| 130 | 130 | * @return \Aimeos\Client\Html\Iface Reference to this object for fluent calls |
| 131 | 131 | */ |
| 132 | - public function setView( \Aimeos\MW\View\Iface $view ) |
|
| 132 | + public function setView(\Aimeos\MW\View\Iface $view) |
|
| 133 | 133 | { |
| 134 | 134 | $this->view = $view; |
| 135 | 135 | return $this; |
@@ -145,29 +145,29 @@ discard block |
||
| 145 | 145 | * @param string $classprefix Decorator class prefix, e.g. "\Aimeos\Client\Html\Catalog\Decorator\" |
| 146 | 146 | * @return \Aimeos\Client\Html\Iface Client object |
| 147 | 147 | */ |
| 148 | - protected function addDecorators( \Aimeos\Client\Html\Iface $client, array $templatePaths, |
|
| 149 | - array $decorators, $classprefix ) |
|
| 148 | + protected function addDecorators(\Aimeos\Client\Html\Iface $client, array $templatePaths, |
|
| 149 | + array $decorators, $classprefix) |
|
| 150 | 150 | { |
| 151 | 151 | $iface = '\\Aimeos\\Client\\Html\\Common\\Decorator\\Iface'; |
| 152 | 152 | |
| 153 | - foreach( $decorators as $name ) |
|
| 153 | + foreach ($decorators as $name) |
|
| 154 | 154 | { |
| 155 | - if( ctype_alnum( $name ) === false ) |
|
| 155 | + if (ctype_alnum($name) === false) |
|
| 156 | 156 | { |
| 157 | - $classname = is_string( $name ) ? $classprefix . $name : '<not a string>'; |
|
| 158 | - throw new \Aimeos\Client\Html\Exception( sprintf( 'Invalid class name "%1$s"', $classname ) ); |
|
| 157 | + $classname = is_string($name) ? $classprefix.$name : '<not a string>'; |
|
| 158 | + throw new \Aimeos\Client\Html\Exception(sprintf('Invalid class name "%1$s"', $classname)); |
|
| 159 | 159 | } |
| 160 | 160 | |
| 161 | - $classname = $classprefix . $name; |
|
| 161 | + $classname = $classprefix.$name; |
|
| 162 | 162 | |
| 163 | - if( class_exists( $classname ) === false ) { |
|
| 164 | - throw new \Aimeos\Client\Html\Exception( sprintf( 'Class "%1$s" not found', $classname ) ); |
|
| 163 | + if (class_exists($classname) === false) { |
|
| 164 | + throw new \Aimeos\Client\Html\Exception(sprintf('Class "%1$s" not found', $classname)); |
|
| 165 | 165 | } |
| 166 | 166 | |
| 167 | - $client = new $classname( $client, $this->context, $this->templatePaths ); |
|
| 167 | + $client = new $classname($client, $this->context, $this->templatePaths); |
|
| 168 | 168 | |
| 169 | - if( !( $client instanceof $iface ) ) { |
|
| 170 | - throw new \Aimeos\Client\Html\Exception( sprintf( 'Class "%1$s" does not implement "%2$s"', $classname, $iface ) ); |
|
| 169 | + if (!($client instanceof $iface)) { |
|
| 170 | + throw new \Aimeos\Client\Html\Exception(sprintf('Class "%1$s" does not implement "%2$s"', $classname, $iface)); |
|
| 171 | 171 | } |
| 172 | 172 | } |
| 173 | 173 | |
@@ -183,35 +183,35 @@ discard block |
||
| 183 | 183 | * @param string $path Client string in lower case, e.g. "catalog/detail/basic" |
| 184 | 184 | * @return \Aimeos\Client\Html\Iface Client object |
| 185 | 185 | */ |
| 186 | - protected function addClientDecorators( \Aimeos\Client\Html\Iface $client, array $templatePaths, $path ) |
|
| 186 | + protected function addClientDecorators(\Aimeos\Client\Html\Iface $client, array $templatePaths, $path) |
|
| 187 | 187 | { |
| 188 | - if( !is_string( $path ) || $path === '' ) { |
|
| 189 | - throw new \Aimeos\Client\Html\Exception( sprintf( 'Invalid domain "%1$s"', $path ) ); |
|
| 188 | + if (!is_string($path) || $path === '') { |
|
| 189 | + throw new \Aimeos\Client\Html\Exception(sprintf('Invalid domain "%1$s"', $path)); |
|
| 190 | 190 | } |
| 191 | 191 | |
| 192 | - $localClass = str_replace( ' ', '\\', ucwords( str_replace( '/', ' ', $path ) ) ); |
|
| 192 | + $localClass = str_replace(' ', '\\', ucwords(str_replace('/', ' ', $path))); |
|
| 193 | 193 | $config = $this->context->getConfig(); |
| 194 | 194 | |
| 195 | - $decorators = $config->get( 'client/html/common/decorators/default', array() ); |
|
| 196 | - $excludes = $config->get( 'client/html/' . $path . '/decorators/excludes', array() ); |
|
| 195 | + $decorators = $config->get('client/html/common/decorators/default', array()); |
|
| 196 | + $excludes = $config->get('client/html/'.$path.'/decorators/excludes', array()); |
|
| 197 | 197 | |
| 198 | - foreach( $decorators as $key => $name ) |
|
| 198 | + foreach ($decorators as $key => $name) |
|
| 199 | 199 | { |
| 200 | - if( in_array( $name, $excludes ) ) { |
|
| 201 | - unset( $decorators[$key] ); |
|
| 200 | + if (in_array($name, $excludes)) { |
|
| 201 | + unset($decorators[$key]); |
|
| 202 | 202 | } |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | $classprefix = '\\Aimeos\\Client\\Html\\Common\\Decorator\\'; |
| 206 | - $client = $this->addDecorators( $client, $templatePaths, $decorators, $classprefix ); |
|
| 206 | + $client = $this->addDecorators($client, $templatePaths, $decorators, $classprefix); |
|
| 207 | 207 | |
| 208 | 208 | $classprefix = '\\Aimeos\\Client\\Html\\Common\\Decorator\\'; |
| 209 | - $decorators = $config->get( 'client/html/' . $path . '/decorators/global', array() ); |
|
| 210 | - $client = $this->addDecorators( $client, $templatePaths, $decorators, $classprefix ); |
|
| 209 | + $decorators = $config->get('client/html/'.$path.'/decorators/global', array()); |
|
| 210 | + $client = $this->addDecorators($client, $templatePaths, $decorators, $classprefix); |
|
| 211 | 211 | |
| 212 | - $classprefix = '\\Aimeos\\Client\\Html\\' . $localClass . '\\Decorator\\'; |
|
| 213 | - $decorators = $config->get( 'client/html/' . $path . '/decorators/local', array() ); |
|
| 214 | - $client = $this->addDecorators( $client, $templatePaths, $decorators, $classprefix ); |
|
| 212 | + $classprefix = '\\Aimeos\\Client\\Html\\'.$localClass.'\\Decorator\\'; |
|
| 213 | + $decorators = $config->get('client/html/'.$path.'/decorators/local', array()); |
|
| 214 | + $client = $this->addDecorators($client, $templatePaths, $decorators, $classprefix); |
|
| 215 | 215 | |
| 216 | 216 | return $client; |
| 217 | 217 | } |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | * @param string|null &$expire Expiration date that will be overwritten if an earlier date is found |
| 226 | 226 | * @param array &$tags List of tags the new tags will be added to |
| 227 | 227 | */ |
| 228 | - protected function addMetaItem( $items, $domain, &$expire, array &$tags ) |
|
| 228 | + protected function addMetaItem($items, $domain, &$expire, array &$tags) |
|
| 229 | 229 | { |
| 230 | 230 | /** client/html/common/cache/tag-all |
| 231 | 231 | * Adds tags for all items used in a cache entry |
@@ -259,18 +259,18 @@ discard block |
||
| 259 | 259 | * @see madmin/cache/manager/name |
| 260 | 260 | * @see madmin/cache/name |
| 261 | 261 | */ |
| 262 | - $tagAll = $this->context->getConfig()->get( 'client/html/common/cache/tag-all', false ); |
|
| 262 | + $tagAll = $this->context->getConfig()->get('client/html/common/cache/tag-all', false); |
|
| 263 | 263 | |
| 264 | - if( !is_array( $items ) ) { |
|
| 265 | - $items = array( $items ); |
|
| 264 | + if (!is_array($items)) { |
|
| 265 | + $items = array($items); |
|
| 266 | 266 | } |
| 267 | 267 | |
| 268 | - if( $tagAll !== true && !empty( $items ) ) { |
|
| 268 | + if ($tagAll !== true && !empty($items)) { |
|
| 269 | 269 | $tags[] = $domain; |
| 270 | 270 | } |
| 271 | 271 | |
| 272 | - foreach( $items as $item ) { |
|
| 273 | - $this->addMetaItemSingle( $item, $domain, $expire, $tags, $tagAll ); |
|
| 272 | + foreach ($items as $item) { |
|
| 273 | + $this->addMetaItemSingle($item, $domain, $expire, $tags, $tagAll); |
|
| 274 | 274 | } |
| 275 | 275 | } |
| 276 | 276 | |
@@ -284,35 +284,35 @@ discard block |
||
| 284 | 284 | * @param array &$tags List of tags the new tags will be added to |
| 285 | 285 | * @param boolean $tagAll True of tags for all items should be added, false if only for the main item |
| 286 | 286 | */ |
| 287 | - private function addMetaItemSingle( \Aimeos\MShop\Common\Item\Iface $item, $domain, &$expire, array &$tags, $tagAll ) |
|
| 287 | + private function addMetaItemSingle(\Aimeos\MShop\Common\Item\Iface $item, $domain, &$expire, array &$tags, $tagAll) |
|
| 288 | 288 | { |
| 289 | 289 | $expires = array(); |
| 290 | - $domain = str_replace( '/', '_', $domain ); // maximum compatiblity |
|
| 290 | + $domain = str_replace('/', '_', $domain); // maximum compatiblity |
|
| 291 | 291 | |
| 292 | - if( $tagAll === true ) { |
|
| 293 | - $tags[] = $domain . '-' . $item->getId(); |
|
| 292 | + if ($tagAll === true) { |
|
| 293 | + $tags[] = $domain.'-'.$item->getId(); |
|
| 294 | 294 | } |
| 295 | 295 | |
| 296 | - if( $item instanceof \Aimeos\MShop\Common\Item\Time\Iface && ( $date = $item->getDateEnd() ) !== null ) { |
|
| 296 | + if ($item instanceof \Aimeos\MShop\Common\Item\Time\Iface && ($date = $item->getDateEnd()) !== null) { |
|
| 297 | 297 | $expires[] = $date; |
| 298 | 298 | } |
| 299 | 299 | |
| 300 | - if( $item instanceof \Aimeos\MShop\Common\Item\ListRef\Iface ) |
|
| 300 | + if ($item instanceof \Aimeos\MShop\Common\Item\ListRef\Iface) |
|
| 301 | 301 | { |
| 302 | - foreach( $item->getListItems() as $listitem ) |
|
| 302 | + foreach ($item->getListItems() as $listitem) |
|
| 303 | 303 | { |
| 304 | - if( $tagAll === true ) { |
|
| 305 | - $tags[] = str_replace( '/', '_', $listitem->getDomain() ) . '-' . $listitem->getRefId(); |
|
| 304 | + if ($tagAll === true) { |
|
| 305 | + $tags[] = str_replace('/', '_', $listitem->getDomain()).'-'.$listitem->getRefId(); |
|
| 306 | 306 | } |
| 307 | 307 | |
| 308 | - if( ( $date = $listitem->getDateEnd() ) !== null ) { |
|
| 308 | + if (($date = $listitem->getDateEnd()) !== null) { |
|
| 309 | 309 | $expires[] = $date; |
| 310 | 310 | } |
| 311 | 311 | } |
| 312 | 312 | } |
| 313 | 313 | |
| 314 | - if( !empty( $expires ) ) { |
|
| 315 | - $expire = min( $expires ); |
|
| 314 | + if (!empty($expires)) { |
|
| 315 | + $expire = min($expires); |
|
| 316 | 316 | } |
| 317 | 317 | } |
| 318 | 318 | |
@@ -324,21 +324,21 @@ discard block |
||
| 324 | 324 | * @param string $domain Name of the domain the item IDs are from |
| 325 | 325 | * @param string|null &$expire Expiration date that will be overwritten if an start date in the future is available |
| 326 | 326 | */ |
| 327 | - protected function addMetaList( $ids, $domain, &$expire ) |
|
| 327 | + protected function addMetaList($ids, $domain, &$expire) |
|
| 328 | 328 | { |
| 329 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), $domain . '/lists' ); |
|
| 329 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), $domain.'/lists'); |
|
| 330 | 330 | |
| 331 | 331 | $search = $manager->createSearch(); |
| 332 | 332 | $expr = array( |
| 333 | - $search->compare( '==', $domain . '.lists.parentid', $ids ), |
|
| 334 | - $search->compare( '>', $domain . '.lists.datestart', date( 'Y-m-d H:i:00' ) ), |
|
| 333 | + $search->compare('==', $domain.'.lists.parentid', $ids), |
|
| 334 | + $search->compare('>', $domain.'.lists.datestart', date('Y-m-d H:i:00')), |
|
| 335 | 335 | ); |
| 336 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
| 337 | - $search->setSortations( array( $search->sort( '+', $domain . '.lists.datestart' ) ) ); |
|
| 338 | - $search->setSlice( 0, 1 ); |
|
| 336 | + $search->setConditions($search->combine('&&', $expr)); |
|
| 337 | + $search->setSortations(array($search->sort('+', $domain.'.lists.datestart'))); |
|
| 338 | + $search->setSlice(0, 1); |
|
| 339 | 339 | |
| 340 | - foreach( $manager->searchItems( $search ) as $listItem ) { |
|
| 341 | - $expire = $this->expires( $expire, $listItem->getDateStart() ); |
|
| 340 | + foreach ($manager->searchItems($search) as $listItem) { |
|
| 341 | + $expire = $this->expires($expire, $listItem->getDateStart()); |
|
| 342 | 342 | } |
| 343 | 343 | } |
| 344 | 344 | |
@@ -350,34 +350,34 @@ discard block |
||
| 350 | 350 | * @param string|null $name Name of the implementation, will be from configuration (or Default) if null |
| 351 | 351 | * @return \Aimeos\Client\Html\Iface Sub-part object |
| 352 | 352 | */ |
| 353 | - protected function createSubClient( $path, $name ) |
|
| 353 | + protected function createSubClient($path, $name) |
|
| 354 | 354 | { |
| 355 | - $path = strtolower( $path ); |
|
| 355 | + $path = strtolower($path); |
|
| 356 | 356 | |
| 357 | - if( $name === null ) { |
|
| 358 | - $name = $this->context->getConfig()->get( 'client/html/' . $path . '/name', 'Standard' ); |
|
| 357 | + if ($name === null) { |
|
| 358 | + $name = $this->context->getConfig()->get('client/html/'.$path.'/name', 'Standard'); |
|
| 359 | 359 | } |
| 360 | 360 | |
| 361 | - if( empty( $name ) || ctype_alnum( $name ) === false ) { |
|
| 362 | - throw new \Aimeos\Client\Html\Exception( sprintf( 'Invalid characters in client name "%1$s"', $name ) ); |
|
| 361 | + if (empty($name) || ctype_alnum($name) === false) { |
|
| 362 | + throw new \Aimeos\Client\Html\Exception(sprintf('Invalid characters in client name "%1$s"', $name)); |
|
| 363 | 363 | } |
| 364 | 364 | |
| 365 | - $subnames = str_replace( ' ', '\\', ucwords( str_replace( '/', ' ', $path ) ) ); |
|
| 365 | + $subnames = str_replace(' ', '\\', ucwords(str_replace('/', ' ', $path))); |
|
| 366 | 366 | |
| 367 | - $classname = '\\Aimeos\\Client\\Html\\' . $subnames . '\\' . $name; |
|
| 367 | + $classname = '\\Aimeos\\Client\\Html\\'.$subnames.'\\'.$name; |
|
| 368 | 368 | $interface = '\\Aimeos\\Client\\Html\\Iface'; |
| 369 | 369 | |
| 370 | - if( class_exists( $classname ) === false ) { |
|
| 371 | - throw new \Aimeos\Client\Html\Exception( sprintf( 'Class "%1$s" not available', $classname ) ); |
|
| 370 | + if (class_exists($classname) === false) { |
|
| 371 | + throw new \Aimeos\Client\Html\Exception(sprintf('Class "%1$s" not available', $classname)); |
|
| 372 | 372 | } |
| 373 | 373 | |
| 374 | - $object = new $classname( $this->context, $this->templatePaths ); |
|
| 374 | + $object = new $classname($this->context, $this->templatePaths); |
|
| 375 | 375 | |
| 376 | - if( ( $object instanceof $interface ) === false ) { |
|
| 377 | - throw new \Aimeos\Client\Html\Exception( sprintf( 'Class "%1$s" does not implement interface "%2$s"', $classname, $interface ) ); |
|
| 376 | + if (($object instanceof $interface) === false) { |
|
| 377 | + throw new \Aimeos\Client\Html\Exception(sprintf('Class "%1$s" does not implement interface "%2$s"', $classname, $interface)); |
|
| 378 | 378 | } |
| 379 | 379 | |
| 380 | - return $this->addClientDecorators( $object, $this->templatePaths, $path ); |
|
| 380 | + return $this->addClientDecorators($object, $this->templatePaths, $path); |
|
| 381 | 381 | } |
| 382 | 382 | |
| 383 | 383 | |
@@ -388,9 +388,9 @@ discard block |
||
| 388 | 388 | * @param string|null $second Second expiration date or null |
| 389 | 389 | * @return string|null Expiration date |
| 390 | 390 | */ |
| 391 | - protected function expires( $first, $second ) |
|
| 391 | + protected function expires($first, $second) |
|
| 392 | 392 | { |
| 393 | - return ( $first !== null ? ( $second !== null ? min( $first, $second ) : $first ) : $second ); |
|
| 393 | + return ($first !== null ? ($second !== null ? min($first, $second) : $first) : $second); |
|
| 394 | 394 | } |
| 395 | 395 | |
| 396 | 396 | |
@@ -401,13 +401,13 @@ discard block |
||
| 401 | 401 | * @param array $prefixes List of prefixes the parameters must start with |
| 402 | 402 | * @return array Associative list of parameters used by the html client |
| 403 | 403 | */ |
| 404 | - protected function getClientParams( array $params, array $prefixes = array( 'f', 'l', 'd', 'a' ) ) |
|
| 404 | + protected function getClientParams(array $params, array $prefixes = array('f', 'l', 'd', 'a')) |
|
| 405 | 405 | { |
| 406 | 406 | $list = array(); |
| 407 | 407 | |
| 408 | - foreach( $params as $key => $value ) |
|
| 408 | + foreach ($params as $key => $value) |
|
| 409 | 409 | { |
| 410 | - if( in_array( $key[0], $prefixes ) && $key[1] === '_' ) { |
|
| 410 | + if (in_array($key[0], $prefixes) && $key[1] === '_') { |
|
| 411 | 411 | $list[$key] = $value; |
| 412 | 412 | } |
| 413 | 413 | } |
@@ -435,17 +435,17 @@ discard block |
||
| 435 | 435 | * @param array $config Multi-dimensional array of configuration options used by the client and sub-clients |
| 436 | 436 | * @return string Unique hash |
| 437 | 437 | */ |
| 438 | - protected function getParamHash( array $prefixes = array( 'f', 'l', 'd' ), $key = '', array $config = array() ) |
|
| 438 | + protected function getParamHash(array $prefixes = array('f', 'l', 'd'), $key = '', array $config = array()) |
|
| 439 | 439 | { |
| 440 | 440 | $locale = $this->getContext()->getLocale(); |
| 441 | - $params = $this->getClientParams( $this->getView()->param(), $prefixes ); |
|
| 442 | - ksort( $params ); |
|
| 441 | + $params = $this->getClientParams($this->getView()->param(), $prefixes); |
|
| 442 | + ksort($params); |
|
| 443 | 443 | |
| 444 | - if( ( $pstr = json_encode( $params ) ) === false || ( $cstr = json_encode( $config ) ) === false ) { |
|
| 445 | - throw new \Aimeos\Client\Html\Exception( 'Unable to encode parameters or configuration options' ); |
|
| 444 | + if (($pstr = json_encode($params)) === false || ($cstr = json_encode($config)) === false) { |
|
| 445 | + throw new \Aimeos\Client\Html\Exception('Unable to encode parameters or configuration options'); |
|
| 446 | 446 | } |
| 447 | 447 | |
| 448 | - return md5( $key . $pstr . $cstr . $locale->getLanguageId() . $locale->getCurrencyId() ); |
|
| 448 | + return md5($key.$pstr.$cstr.$locale->getLanguageId().$locale->getCurrencyId()); |
|
| 449 | 449 | } |
| 450 | 450 | |
| 451 | 451 | |
@@ -464,12 +464,12 @@ discard block |
||
| 464 | 464 | */ |
| 465 | 465 | protected function getSubClients() |
| 466 | 466 | { |
| 467 | - if( !isset( $this->subclients ) ) |
|
| 467 | + if (!isset($this->subclients)) |
|
| 468 | 468 | { |
| 469 | 469 | $this->subclients = array(); |
| 470 | 470 | |
| 471 | - foreach( $this->getSubClientNames() as $name ) { |
|
| 472 | - $this->subclients[] = $this->getSubClient( $name ); |
|
| 471 | + foreach ($this->getSubClientNames() as $name) { |
|
| 472 | + $this->subclients[] = $this->getSubClient($name); |
|
| 473 | 473 | } |
| 474 | 474 | } |
| 475 | 475 | |
@@ -498,23 +498,23 @@ discard block |
||
| 498 | 498 | * @return \Aimeos\MShop\Common\Item\Type\Iface Type item |
| 499 | 499 | * @throws \Aimeos\Controller\Jobs\Exception If no item is found |
| 500 | 500 | */ |
| 501 | - protected function getTypeItem( $prefix, $domain, $code ) |
|
| 501 | + protected function getTypeItem($prefix, $domain, $code) |
|
| 502 | 502 | { |
| 503 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), $prefix ); |
|
| 504 | - $prefix = str_replace( '/', '.', $prefix ); |
|
| 503 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), $prefix); |
|
| 504 | + $prefix = str_replace('/', '.', $prefix); |
|
| 505 | 505 | |
| 506 | 506 | $search = $manager->createSearch(); |
| 507 | 507 | $expr = array( |
| 508 | - $search->compare( '==', $prefix . '.domain', $domain ), |
|
| 509 | - $search->compare( '==', $prefix . '.code', $code ), |
|
| 508 | + $search->compare('==', $prefix.'.domain', $domain), |
|
| 509 | + $search->compare('==', $prefix.'.code', $code), |
|
| 510 | 510 | ); |
| 511 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
| 512 | - $result = $manager->searchItems( $search ); |
|
| 511 | + $search->setConditions($search->combine('&&', $expr)); |
|
| 512 | + $result = $manager->searchItems($search); |
|
| 513 | 513 | |
| 514 | - if( ( $item = reset( $result ) ) === false ) |
|
| 514 | + if (($item = reset($result)) === false) |
|
| 515 | 515 | { |
| 516 | - $msg = sprintf( 'No type item for "%1$s/%2$s" in "%3$s" found', $domain, $code, $prefix ); |
|
| 517 | - throw new \Aimeos\Controller\Jobs\Exception( $msg ); |
|
| 516 | + $msg = sprintf('No type item for "%1$s/%2$s" in "%3$s" found', $domain, $code, $prefix); |
|
| 517 | + throw new \Aimeos\Controller\Jobs\Exception($msg); |
|
| 518 | 518 | } |
| 519 | 519 | |
| 520 | 520 | return $item; |
@@ -530,9 +530,9 @@ discard block |
||
| 530 | 530 | * @param string $confkey Configuration key prefix that matches all relevant settings for the component |
| 531 | 531 | * @return string Cached entry or empty string if not available |
| 532 | 532 | */ |
| 533 | - protected function getCached( $type, $uid, array $prefixes, $confkey ) |
|
| 533 | + protected function getCached($type, $uid, array $prefixes, $confkey) |
|
| 534 | 534 | { |
| 535 | - if( !isset( $this->cache ) ) |
|
| 535 | + if (!isset($this->cache)) |
|
| 536 | 536 | { |
| 537 | 537 | $context = $this->getContext(); |
| 538 | 538 | $config = $context->getConfig(); |
@@ -555,28 +555,28 @@ discard block |
||
| 555 | 555 | * @category User |
| 556 | 556 | * @see client/html/common/cache/tag-all |
| 557 | 557 | */ |
| 558 | - $force = $config->get( 'client/html/common/cache/force', false ); |
|
| 558 | + $force = $config->get('client/html/common/cache/force', false); |
|
| 559 | 559 | |
| 560 | - if( $force == false && $context->getUserId() !== null ) { |
|
| 560 | + if ($force == false && $context->getUserId() !== null) { |
|
| 561 | 561 | return null; |
| 562 | 562 | } |
| 563 | 563 | |
| 564 | - $cfg = $config->get( $confkey, array() ); |
|
| 564 | + $cfg = $config->get($confkey, array()); |
|
| 565 | 565 | |
| 566 | 566 | $keys = array( |
| 567 | - 'body' => $this->getParamHash( $prefixes, $uid . ':' . $confkey . ':body', $cfg ), |
|
| 568 | - 'header' => $this->getParamHash( $prefixes, $uid . ':' . $confkey . ':header', $cfg ), |
|
| 567 | + 'body' => $this->getParamHash($prefixes, $uid.':'.$confkey.':body', $cfg), |
|
| 568 | + 'header' => $this->getParamHash($prefixes, $uid.':'.$confkey.':header', $cfg), |
|
| 569 | 569 | ); |
| 570 | 570 | |
| 571 | - $entries = $context->getCache()->getList( $keys ); |
|
| 571 | + $entries = $context->getCache()->getList($keys); |
|
| 572 | 572 | $this->cache = array(); |
| 573 | 573 | |
| 574 | - foreach( $keys as $key => $hash ) { |
|
| 575 | - $this->cache[$key] = ( array_key_exists( $hash, $entries ) ? $entries[$hash] : null ); |
|
| 574 | + foreach ($keys as $key => $hash) { |
|
| 575 | + $this->cache[$key] = (array_key_exists($hash, $entries) ? $entries[$hash] : null); |
|
| 576 | 576 | } |
| 577 | 577 | } |
| 578 | 578 | |
| 579 | - return ( array_key_exists( $type, $this->cache ) ? $this->cache[$type] : null ); |
|
| 579 | + return (array_key_exists($type, $this->cache) ? $this->cache[$type] : null); |
|
| 580 | 580 | } |
| 581 | 581 | |
| 582 | 582 | |
@@ -593,28 +593,28 @@ discard block |
||
| 593 | 593 | * @param string|null $expire Date/time string in "YYYY-MM-DD HH:mm:ss" |
| 594 | 594 | * format when the cache entry expires |
| 595 | 595 | */ |
| 596 | - protected function setCached( $type, $uid, array $prefixes, $confkey, $value, array $tags, $expire ) |
|
| 596 | + protected function setCached($type, $uid, array $prefixes, $confkey, $value, array $tags, $expire) |
|
| 597 | 597 | { |
| 598 | 598 | $context = $this->getContext(); |
| 599 | 599 | $config = $context->getConfig(); |
| 600 | 600 | |
| 601 | - $force = $config->get( 'client/html/common/cache/force', false ); |
|
| 601 | + $force = $config->get('client/html/common/cache/force', false); |
|
| 602 | 602 | |
| 603 | - if( $force == false && $context->getUserId() !== null ) { |
|
| 603 | + if ($force == false && $context->getUserId() !== null) { |
|
| 604 | 604 | return; |
| 605 | 605 | } |
| 606 | 606 | |
| 607 | 607 | try |
| 608 | 608 | { |
| 609 | - $cfg = $config->get( $confkey, array() ); |
|
| 610 | - $key = $this->getParamHash( $prefixes, $uid . ':' . $confkey . ':' . $type, $cfg ); |
|
| 609 | + $cfg = $config->get($confkey, array()); |
|
| 610 | + $key = $this->getParamHash($prefixes, $uid.':'.$confkey.':'.$type, $cfg); |
|
| 611 | 611 | |
| 612 | - $context->getCache()->set( $key, $value, array_unique( $tags ), $expire ); |
|
| 612 | + $context->getCache()->set($key, $value, array_unique($tags), $expire); |
|
| 613 | 613 | } |
| 614 | - catch( \Exception $e ) |
|
| 614 | + catch (\Exception $e) |
|
| 615 | 615 | { |
| 616 | - $msg = sprintf( 'Unable to set cache entry: %1$s', $e->getMessage() ); |
|
| 617 | - $context->getLogger()->log( $msg, \Aimeos\MW\Logger\Base::NOTICE ); |
|
| 616 | + $msg = sprintf('Unable to set cache entry: %1$s', $e->getMessage()); |
|
| 617 | + $context->getLogger()->log($msg, \Aimeos\MW\Logger\Base::NOTICE); |
|
| 618 | 618 | } |
| 619 | 619 | } |
| 620 | 620 | |
@@ -626,19 +626,19 @@ discard block |
||
| 626 | 626 | * @param string $section New section content |
| 627 | 627 | * @param string $marker Name of the section marker without "<!-- " and " -->" parts |
| 628 | 628 | */ |
| 629 | - protected function replaceSection( $content, $section, $marker ) |
|
| 629 | + protected function replaceSection($content, $section, $marker) |
|
| 630 | 630 | { |
| 631 | 631 | $start = 0; |
| 632 | - $len = strlen( $section ); |
|
| 633 | - $marker = '<!-- ' . $marker . ' -->'; |
|
| 632 | + $len = strlen($section); |
|
| 633 | + $marker = '<!-- '.$marker.' -->'; |
|
| 634 | 634 | |
| 635 | - while( ( $start = @strpos( $content, $marker, $start ) ) !== false ) |
|
| 635 | + while (($start = @strpos($content, $marker, $start)) !== false) |
|
| 636 | 636 | { |
| 637 | - if( ( $end = strpos( $content, $marker, $start + 1 ) ) !== false ) { |
|
| 638 | - $content = substr_replace( $content, $section, $start, $end - $start + strlen( $marker ) ); |
|
| 637 | + if (($end = strpos($content, $marker, $start + 1)) !== false) { |
|
| 638 | + $content = substr_replace($content, $section, $start, $end - $start + strlen($marker)); |
|
| 639 | 639 | } |
| 640 | 640 | |
| 641 | - $start += 2 * strlen( $marker ) + $len; |
|
| 641 | + $start += 2 * strlen($marker) + $len; |
|
| 642 | 642 | } |
| 643 | 643 | |
| 644 | 644 | return $content; |
@@ -653,7 +653,7 @@ discard block |
||
| 653 | 653 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 654 | 654 | * @return \Aimeos\MW\View\Iface Modified view object |
| 655 | 655 | */ |
| 656 | - protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null ) |
|
| 656 | + protected function setViewParams(\Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null) |
|
| 657 | 657 | { |
| 658 | 658 | return $view; |
| 659 | 659 | } |
@@ -665,17 +665,17 @@ discard block |
||
| 665 | 665 | * @param array $codes Associative list of scope and object as key and error code as value |
| 666 | 666 | * @return array List of translated error messages |
| 667 | 667 | */ |
| 668 | - protected function translatePluginErrorCodes( array $codes ) |
|
| 668 | + protected function translatePluginErrorCodes(array $codes) |
|
| 669 | 669 | { |
| 670 | 670 | $errors = array(); |
| 671 | 671 | $i18n = $this->context->getI18n(); |
| 672 | 672 | |
| 673 | - foreach( $codes as $scope => $list ) |
|
| 673 | + foreach ($codes as $scope => $list) |
|
| 674 | 674 | { |
| 675 | - foreach( $list as $object => $errcode ) |
|
| 675 | + foreach ($list as $object => $errcode) |
|
| 676 | 676 | { |
| 677 | - $key = $scope . ( $scope !== 'product' ? '.' . $object : '' ) . '.' . $errcode; |
|
| 678 | - $errors[] = $i18n->dt( 'mshop/code', $key ); |
|
| 677 | + $key = $scope.($scope !== 'product' ? '.'.$object : '').'.'.$errcode; |
|
| 678 | + $errors[] = $i18n->dt('mshop/code', $key); |
|
| 679 | 679 | } |
| 680 | 680 | } |
| 681 | 681 | |
@@ -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->breadcrumbBody = $html; |
| 79 | 79 | |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | $tplconf = 'client/html/catalog/stage/breadcrumb/standard/template-body'; |
| 101 | 101 | $default = 'catalog/stage/breadcrumb-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->breadcrumbHeader = $html; |
| 124 | 124 | |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | $tplconf = 'client/html/catalog/stage/breadcrumb/standard/template-header'; |
| 147 | 147 | $default = 'catalog/stage/breadcrumb-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/stage/breadcrumb/decorators/excludes |
| 163 | 163 | * Excludes decorators added by the "common" option from the catalog stage breadcrumb html client |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | * @see client/html/catalog/stage/breadcrumb/decorators/global |
| 234 | 234 | */ |
| 235 | 235 | |
| 236 | - return $this->createSubClient( 'catalog/stage/breadcrumb/' . $type, $name ); |
|
| 236 | + return $this->createSubClient('catalog/stage/breadcrumb/'.$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 |
@@ -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->navigatorBody = $html; |
| 80 | 80 | |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | $tplconf = 'client/html/catalog/stage/navigator/standard/template-body'; |
| 102 | 102 | $default = 'catalog/stage/navigator-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->navigatorHeader = $html; |
| 125 | 125 | |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | $tplconf = 'client/html/catalog/stage/navigator/standard/template-header'; |
| 148 | 148 | $default = 'catalog/stage/navigator-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/stage/navigator/decorators/excludes |
| 164 | 164 | * Excludes decorators added by the "common" option from the catalog stage navigator html client |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | * @see client/html/catalog/stage/navigator/decorators/global |
| 235 | 235 | */ |
| 236 | 236 | |
| 237 | - return $this->createSubClient( 'catalog/stage/navigator/' . $type, $name ); |
|
| 237 | + return $this->createSubClient('catalog/stage/navigator/'.$type, $name); |
|
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | |
@@ -245,9 +245,9 @@ discard block |
||
| 245 | 245 | * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
| 246 | 246 | * @return string Modified body content |
| 247 | 247 | */ |
| 248 | - public function modifyBody( $content, $uid ) |
|
| 248 | + public function modifyBody($content, $uid) |
|
| 249 | 249 | { |
| 250 | - return $this->replaceSection( $content, $this->getBody( $uid ), 'catalog.stage.navigator' ); |
|
| 250 | + return $this->replaceSection($content, $this->getBody($uid), 'catalog.stage.navigator'); |
|
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | |
@@ -258,9 +258,9 @@ 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 modifyHeader( $content, $uid ) |
|
| 261 | + public function modifyHeader($content, $uid) |
|
| 262 | 262 | { |
| 263 | - return $this->replaceSection( $content, $this->getHeader( $uid ), 'catalog.stage.navigator' ); |
|
| 263 | + return $this->replaceSection($content, $this->getHeader($uid), 'catalog.stage.navigator'); |
|
| 264 | 264 | } |
| 265 | 265 | |
| 266 | 266 | |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | */ |
| 272 | 272 | protected function getSubClientNames() |
| 273 | 273 | { |
| 274 | - return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 274 | + return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames); |
|
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | |
@@ -283,13 +283,13 @@ discard block |
||
| 283 | 283 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 284 | 284 | * @return \Aimeos\MW\View\Iface Modified view object |
| 285 | 285 | */ |
| 286 | - protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null ) |
|
| 286 | + protected function setViewParams(\Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null) |
|
| 287 | 287 | { |
| 288 | - if( !isset( $this->view ) ) |
|
| 288 | + if (!isset($this->view)) |
|
| 289 | 289 | { |
| 290 | - if( ( $pos = $view->param( 'l_pos' ) ) !== null && ( $pid = $view->param( 'd_prodid' ) ) !== null ) |
|
| 290 | + if (($pos = $view->param('l_pos')) !== null && ($pid = $view->param('d_prodid')) !== null) |
|
| 291 | 291 | { |
| 292 | - if( $pos < 1 ) { |
|
| 292 | + if ($pos < 1) { |
|
| 293 | 293 | $start = 0; $size = 2; |
| 294 | 294 | } else { |
| 295 | 295 | $start = $pos - 1; $size = 3; |
@@ -297,43 +297,43 @@ discard block |
||
| 297 | 297 | |
| 298 | 298 | $context = $this->getContext(); |
| 299 | 299 | $site = $context->getLocale()->getSite()->getCode(); |
| 300 | - $params = $context->getSession()->get( 'aimeos/catalog/lists/params/last/' . $site, array() ); |
|
| 300 | + $params = $context->getSession()->get('aimeos/catalog/lists/params/last/'.$site, array()); |
|
| 301 | 301 | |
| 302 | - $filter = $this->getProductListFilterByParam( $params ); |
|
| 303 | - $filter->setSlice( $start, $size ); |
|
| 302 | + $filter = $this->getProductListFilterByParam($params); |
|
| 303 | + $filter->setSlice($start, $size); |
|
| 304 | 304 | $total = null; |
| 305 | 305 | |
| 306 | - $controller = \Aimeos\Controller\Frontend\Factory::createController( $context, 'catalog' ); |
|
| 307 | - $products = $controller->getIndexItems( $filter, array( 'text' ), $total ); |
|
| 306 | + $controller = \Aimeos\Controller\Frontend\Factory::createController($context, 'catalog'); |
|
| 307 | + $products = $controller->getIndexItems($filter, array('text'), $total); |
|
| 308 | 308 | |
| 309 | - if( ( $count = count( $products ) ) > 1 ) |
|
| 309 | + if (($count = count($products)) > 1) |
|
| 310 | 310 | { |
| 311 | 311 | $enc = $view->encoder(); |
| 312 | - $listPos = array_search( $pid, array_keys( $products ) ); |
|
| 312 | + $listPos = array_search($pid, array_keys($products)); |
|
| 313 | 313 | |
| 314 | - $target = $view->config( 'client/html/catalog/detail/url/target' ); |
|
| 315 | - $controller = $view->config( 'client/html/catalog/detail/url/controller', 'catalog' ); |
|
| 316 | - $action = $view->config( 'client/html/catalog/detail/url/action', 'detail' ); |
|
| 317 | - $config = $view->config( 'client/html/catalog/detail/url/config', array() ); |
|
| 314 | + $target = $view->config('client/html/catalog/detail/url/target'); |
|
| 315 | + $controller = $view->config('client/html/catalog/detail/url/controller', 'catalog'); |
|
| 316 | + $action = $view->config('client/html/catalog/detail/url/action', 'detail'); |
|
| 317 | + $config = $view->config('client/html/catalog/detail/url/config', array()); |
|
| 318 | 318 | |
| 319 | - if( $listPos > 0 && ( $product = reset( $products ) ) !== false ) |
|
| 319 | + if ($listPos > 0 && ($product = reset($products)) !== false) |
|
| 320 | 320 | { |
| 321 | 321 | $param = array( |
| 322 | 322 | 'd_prodid' => $product->getId(), |
| 323 | - 'd_name' => $enc->url( $product->getName( 'url ' ) ), |
|
| 323 | + 'd_name' => $enc->url($product->getName('url ')), |
|
| 324 | 324 | 'l_pos' => $pos - 1 |
| 325 | 325 | ); |
| 326 | - $view->navigationPrev = $view->url( $target, $controller, $action, $param, array(), $config ); |
|
| 326 | + $view->navigationPrev = $view->url($target, $controller, $action, $param, array(), $config); |
|
| 327 | 327 | } |
| 328 | 328 | |
| 329 | - if( $listPos < $count - 1 && ( $product = end( $products ) ) !== false ) |
|
| 329 | + if ($listPos < $count - 1 && ($product = end($products)) !== false) |
|
| 330 | 330 | { |
| 331 | 331 | $param = array( |
| 332 | 332 | 'd_prodid' => $product->getId(), |
| 333 | - 'd_name' => $enc->url( $product->getName( 'url' ) ), |
|
| 333 | + 'd_name' => $enc->url($product->getName('url')), |
|
| 334 | 334 | 'l_pos' => $pos + 1 |
| 335 | 335 | ); |
| 336 | - $view->navigationNext = $view->url( $target, $controller, $action, $param, array(), $config ); |
|
| 336 | + $view->navigationNext = $view->url($target, $controller, $action, $param, array(), $config); |
|
| 337 | 337 | } |
| 338 | 338 | } |
| 339 | 339 | } |
@@ -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/stage/name |
| 37 | 37 | * Class name of the used catalog stage 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/stage/name', 'Standard' ); |
|
| 69 | + if ($name === null) { |
|
| 70 | + $name = $context->getConfig()->get('client/html/catalog/stage/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\\Stage\\' . $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\\Stage\\'.$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\\Stage\\' . $name; |
|
| 80 | + $classname = '\\Aimeos\\Client\\Html\\Catalog\\Stage\\'.$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/stage' ); |
|
| 84 | + return self::addClientDecorators($context, $client, $templatePaths, 'catalog/stage'); |
|
| 85 | 85 | } |
| 86 | 86 | } |
| 87 | 87 | |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | * @since 2014.09 |
| 90 | 90 | * @category Developer |
| 91 | 91 | */ |
| 92 | - private $subPartNames = array( 'image', 'breadcrumb', 'navigator' ); |
|
| 92 | + private $subPartNames = array('image', 'breadcrumb', 'navigator'); |
|
| 93 | 93 | |
| 94 | 94 | private $tags = array(); |
| 95 | 95 | private $expire; |
@@ -104,9 +104,9 @@ discard block |
||
| 104 | 104 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 105 | 105 | * @return string HTML code |
| 106 | 106 | */ |
| 107 | - public function getBody( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 107 | + public function getBody($uid = '', array &$tags = array(), &$expire = null) |
|
| 108 | 108 | { |
| 109 | - $prefixes = array( 'f' ); |
|
| 109 | + $prefixes = array('f'); |
|
| 110 | 110 | $context = $this->getContext(); |
| 111 | 111 | |
| 112 | 112 | /** client/html/catalog/stage |
@@ -121,41 +121,41 @@ discard block |
||
| 121 | 121 | */ |
| 122 | 122 | $confkey = 'client/html/catalog/stage'; |
| 123 | 123 | |
| 124 | - if( $context->getUserId() != null || ( $html = $this->getCached( 'body', $uid, $prefixes, $confkey ) ) === null ) |
|
| 124 | + if ($context->getUserId() != null || ($html = $this->getCached('body', $uid, $prefixes, $confkey)) === null) |
|
| 125 | 125 | { |
| 126 | 126 | $view = $this->getView(); |
| 127 | 127 | |
| 128 | 128 | try |
| 129 | 129 | { |
| 130 | - $view = $this->setViewParams( $view, $tags, $expire ); |
|
| 130 | + $view = $this->setViewParams($view, $tags, $expire); |
|
| 131 | 131 | |
| 132 | 132 | $output = ''; |
| 133 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 134 | - $output .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 133 | + foreach ($this->getSubClients() as $subclient) { |
|
| 134 | + $output .= $subclient->setView($view)->getBody($uid, $tags, $expire); |
|
| 135 | 135 | } |
| 136 | 136 | $view->stageBody = $output; |
| 137 | 137 | } |
| 138 | - catch( \Aimeos\Client\Html\Exception $e ) |
|
| 138 | + catch (\Aimeos\Client\Html\Exception $e) |
|
| 139 | 139 | { |
| 140 | - $error = array( $context->getI18n()->dt( 'client', $e->getMessage() ) ); |
|
| 141 | - $view->stageErrorList = $view->get( 'stageErrorList', array() ) + $error; |
|
| 140 | + $error = array($context->getI18n()->dt('client', $e->getMessage())); |
|
| 141 | + $view->stageErrorList = $view->get('stageErrorList', array()) + $error; |
|
| 142 | 142 | } |
| 143 | - catch( \Aimeos\Controller\Frontend\Exception $e ) |
|
| 143 | + catch (\Aimeos\Controller\Frontend\Exception $e) |
|
| 144 | 144 | { |
| 145 | - $error = array( $context->getI18n()->dt( 'controller/frontend', $e->getMessage() ) ); |
|
| 146 | - $view->stageErrorList = $view->get( 'stageErrorList', array() ) + $error; |
|
| 145 | + $error = array($context->getI18n()->dt('controller/frontend', $e->getMessage())); |
|
| 146 | + $view->stageErrorList = $view->get('stageErrorList', array()) + $error; |
|
| 147 | 147 | } |
| 148 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 148 | + catch (\Aimeos\MShop\Exception $e) |
|
| 149 | 149 | { |
| 150 | - $error = array( $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
| 151 | - $view->stageErrorList = $view->get( 'stageErrorList', array() ) + $error; |
|
| 150 | + $error = array($context->getI18n()->dt('mshop', $e->getMessage())); |
|
| 151 | + $view->stageErrorList = $view->get('stageErrorList', array()) + $error; |
|
| 152 | 152 | } |
| 153 | - catch( \Exception $e ) |
|
| 153 | + catch (\Exception $e) |
|
| 154 | 154 | { |
| 155 | - $context->getLogger()->log( $e->getMessage() . PHP_EOL . $e->getTraceAsString() ); |
|
| 155 | + $context->getLogger()->log($e->getMessage().PHP_EOL.$e->getTraceAsString()); |
|
| 156 | 156 | |
| 157 | - $error = array( $context->getI18n()->dt( 'client', 'A non-recoverable error occured' ) ); |
|
| 158 | - $view->stageErrorList = $view->get( 'stageErrorList', array() ) + $error; |
|
| 157 | + $error = array($context->getI18n()->dt('client', 'A non-recoverable error occured')); |
|
| 158 | + $view->stageErrorList = $view->get('stageErrorList', array()) + $error; |
|
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | /** client/html/catalog/stage/standard/template-body |
@@ -181,13 +181,13 @@ discard block |
||
| 181 | 181 | $tplconf = 'client/html/catalog/stage/standard/template-body'; |
| 182 | 182 | $default = 'catalog/stage/body-default.php'; |
| 183 | 183 | |
| 184 | - $html = $view->render( $view->config( $tplconf, $default ) ); |
|
| 184 | + $html = $view->render($view->config($tplconf, $default)); |
|
| 185 | 185 | |
| 186 | - $this->setCached( 'body', $uid, $prefixes, $confkey, $html, $tags, $expire ); |
|
| 186 | + $this->setCached('body', $uid, $prefixes, $confkey, $html, $tags, $expire); |
|
| 187 | 187 | } |
| 188 | 188 | else |
| 189 | 189 | { |
| 190 | - $html = $this->modifyBody( $html, $uid ); |
|
| 190 | + $html = $this->modifyBody($html, $uid); |
|
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | return $html; |
@@ -202,29 +202,29 @@ discard block |
||
| 202 | 202 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 203 | 203 | * @return string|null String including HTML tags for the header on error |
| 204 | 204 | */ |
| 205 | - public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 205 | + public function getHeader($uid = '', array &$tags = array(), &$expire = null) |
|
| 206 | 206 | { |
| 207 | - $prefixes = array( 'f' ); |
|
| 207 | + $prefixes = array('f'); |
|
| 208 | 208 | $context = $this->getContext(); |
| 209 | 209 | $confkey = 'client/html/catalog/stage'; |
| 210 | 210 | |
| 211 | - if( $context->getUserId() != null || ( $html = $this->getCached( 'header', $uid, $prefixes, $confkey ) ) === null ) |
|
| 211 | + if ($context->getUserId() != null || ($html = $this->getCached('header', $uid, $prefixes, $confkey)) === null) |
|
| 212 | 212 | { |
| 213 | 213 | $view = $this->getView(); |
| 214 | 214 | |
| 215 | 215 | try |
| 216 | 216 | { |
| 217 | - $view = $this->setViewParams( $view, $tags, $expire ); |
|
| 217 | + $view = $this->setViewParams($view, $tags, $expire); |
|
| 218 | 218 | |
| 219 | 219 | $html = ''; |
| 220 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 221 | - $html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 220 | + foreach ($this->getSubClients() as $subclient) { |
|
| 221 | + $html .= $subclient->setView($view)->getHeader($uid, $tags, $expire); |
|
| 222 | 222 | } |
| 223 | 223 | $view->stageHeader = $html; |
| 224 | 224 | } |
| 225 | - catch( \Exception $e ) |
|
| 225 | + catch (\Exception $e) |
|
| 226 | 226 | { |
| 227 | - $context->getLogger()->log( $e->getMessage() . PHP_EOL . $e->getTraceAsString() ); |
|
| 227 | + $context->getLogger()->log($e->getMessage().PHP_EOL.$e->getTraceAsString()); |
|
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | /** client/html/catalog/stage/standard/template-header |
@@ -251,13 +251,13 @@ discard block |
||
| 251 | 251 | $tplconf = 'client/html/catalog/stage/standard/template-header'; |
| 252 | 252 | $default = 'catalog/stage/header-default.php'; |
| 253 | 253 | |
| 254 | - $html = $view->render( $view->config( $tplconf, $default ) ); |
|
| 254 | + $html = $view->render($view->config($tplconf, $default)); |
|
| 255 | 255 | |
| 256 | - $this->setCached( 'header', $uid, $prefixes, $confkey, $html, $tags, $expire ); |
|
| 256 | + $this->setCached('header', $uid, $prefixes, $confkey, $html, $tags, $expire); |
|
| 257 | 257 | } |
| 258 | 258 | else |
| 259 | 259 | { |
| 260 | - $html = $this->modifyHeader( $html, $uid ); |
|
| 260 | + $html = $this->modifyHeader($html, $uid); |
|
| 261 | 261 | } |
| 262 | 262 | |
| 263 | 263 | return $html; |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | * @param string|null $name Name of the sub-client (Default if null) |
| 272 | 272 | * @return \Aimeos\Client\Html\Iface Sub-client object |
| 273 | 273 | */ |
| 274 | - public function getSubClient( $type, $name = null ) |
|
| 274 | + public function getSubClient($type, $name = null) |
|
| 275 | 275 | { |
| 276 | 276 | /** client/html/catalog/stage/decorators/excludes |
| 277 | 277 | * Excludes decorators added by the "common" option from the catalog stage html client |
@@ -346,7 +346,7 @@ discard block |
||
| 346 | 346 | * @see client/html/catalog/stage/decorators/excludes |
| 347 | 347 | * @see client/html/catalog/stage/decorators/global |
| 348 | 348 | */ |
| 349 | - return $this->createSubClient( 'catalog/stage/' . $type, $name ); |
|
| 349 | + return $this->createSubClient('catalog/stage/'.$type, $name); |
|
| 350 | 350 | } |
| 351 | 351 | |
| 352 | 352 | |
@@ -363,28 +363,28 @@ discard block |
||
| 363 | 363 | { |
| 364 | 364 | parent::process(); |
| 365 | 365 | } |
| 366 | - catch( \Aimeos\Client\Html\Exception $e ) |
|
| 366 | + catch (\Aimeos\Client\Html\Exception $e) |
|
| 367 | 367 | { |
| 368 | - $error = array( $this->getContext()->getI18n()->dt( 'client', $e->getMessage() ) ); |
|
| 369 | - $view->stageErrorList = $view->get( 'stageErrorList', array() ) + $error; |
|
| 368 | + $error = array($this->getContext()->getI18n()->dt('client', $e->getMessage())); |
|
| 369 | + $view->stageErrorList = $view->get('stageErrorList', array()) + $error; |
|
| 370 | 370 | } |
| 371 | - catch( \Aimeos\Controller\Frontend\Exception $e ) |
|
| 371 | + catch (\Aimeos\Controller\Frontend\Exception $e) |
|
| 372 | 372 | { |
| 373 | - $error = array( $this->getContext()->getI18n()->dt( 'controller/frontend', $e->getMessage() ) ); |
|
| 374 | - $view->stageErrorList = $view->get( 'stageErrorList', array() ) + $error; |
|
| 373 | + $error = array($this->getContext()->getI18n()->dt('controller/frontend', $e->getMessage())); |
|
| 374 | + $view->stageErrorList = $view->get('stageErrorList', array()) + $error; |
|
| 375 | 375 | } |
| 376 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 376 | + catch (\Aimeos\MShop\Exception $e) |
|
| 377 | 377 | { |
| 378 | - $error = array( $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
| 379 | - $view->stageErrorList = $view->get( 'stageErrorList', array() ) + $error; |
|
| 378 | + $error = array($this->getContext()->getI18n()->dt('mshop', $e->getMessage())); |
|
| 379 | + $view->stageErrorList = $view->get('stageErrorList', array()) + $error; |
|
| 380 | 380 | } |
| 381 | - catch( \Exception $e ) |
|
| 381 | + catch (\Exception $e) |
|
| 382 | 382 | { |
| 383 | 383 | $context = $this->getContext(); |
| 384 | - $context->getLogger()->log( $e->getMessage() . PHP_EOL . $e->getTraceAsString() ); |
|
| 384 | + $context->getLogger()->log($e->getMessage().PHP_EOL.$e->getTraceAsString()); |
|
| 385 | 385 | |
| 386 | - $error = array( $context->getI18n()->dt( 'client', 'A non-recoverable error occured' ) ); |
|
| 387 | - $view->stageErrorList = $view->get( 'stageErrorList', array() ) + $error; |
|
| 386 | + $error = array($context->getI18n()->dt('client', 'A non-recoverable error occured')); |
|
| 387 | + $view->stageErrorList = $view->get('stageErrorList', array()) + $error; |
|
| 388 | 388 | } |
| 389 | 389 | } |
| 390 | 390 | |
@@ -396,15 +396,15 @@ discard block |
||
| 396 | 396 | * @param array $prefixes List of prefixes the parameters must start with |
| 397 | 397 | * @return array Associative list of parameters used by the html client |
| 398 | 398 | */ |
| 399 | - protected function getClientParams( array $params, array $prefixes = array( 'f', 'l', 'd', 'a' ) ) |
|
| 399 | + protected function getClientParams(array $params, array $prefixes = array('f', 'l', 'd', 'a')) |
|
| 400 | 400 | { |
| 401 | - $list = parent::getClientParams( $params, array_merge( $prefixes, array( 'l', 'd' ) ) ); |
|
| 401 | + $list = parent::getClientParams($params, array_merge($prefixes, array('l', 'd'))); |
|
| 402 | 402 | |
| 403 | - if( isset( $list['l_pos'] ) && isset( $list['d_prodid'] ) ) |
|
| 403 | + if (isset($list['l_pos']) && isset($list['d_prodid'])) |
|
| 404 | 404 | { |
| 405 | 405 | $context = $this->getContext(); |
| 406 | 406 | $site = $context->getLocale()->getSite()->getCode(); |
| 407 | - $list += (array) $context->getSession()->get( 'aimeos/catalog/lists/params/last/' . $site, array() ); |
|
| 407 | + $list += (array) $context->getSession()->get('aimeos/catalog/lists/params/last/'.$site, array()); |
|
| 408 | 408 | } |
| 409 | 409 | |
| 410 | 410 | return $list; |
@@ -418,7 +418,7 @@ discard block |
||
| 418 | 418 | */ |
| 419 | 419 | protected function getSubClientNames() |
| 420 | 420 | { |
| 421 | - return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 421 | + return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames); |
|
| 422 | 422 | } |
| 423 | 423 | |
| 424 | 424 | |
@@ -430,26 +430,26 @@ discard block |
||
| 430 | 430 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 431 | 431 | * @return \Aimeos\MW\View\Iface Modified view object |
| 432 | 432 | */ |
| 433 | - protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null ) |
|
| 433 | + protected function setViewParams(\Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null) |
|
| 434 | 434 | { |
| 435 | - if( !isset( $this->cache ) ) |
|
| 435 | + if (!isset($this->cache)) |
|
| 436 | 436 | { |
| 437 | - $params = $this->getClientParams( $view->param(), array( 'f' ) ); |
|
| 437 | + $params = $this->getClientParams($view->param(), array('f')); |
|
| 438 | 438 | |
| 439 | - if( isset( $params['f_catid'] ) && $params['f_catid'] != '' ) |
|
| 439 | + if (isset($params['f_catid']) && $params['f_catid'] != '') |
|
| 440 | 440 | { |
| 441 | 441 | $context = $this->getContext(); |
| 442 | 442 | $config = $context->getConfig(); |
| 443 | - $controller = \Aimeos\Controller\Frontend\Factory::createController( $context, 'catalog' ); |
|
| 443 | + $controller = \Aimeos\Controller\Frontend\Factory::createController($context, 'catalog'); |
|
| 444 | 444 | |
| 445 | - $default = array( 'attribute', 'media', 'text' ); |
|
| 445 | + $default = array('attribute', 'media', 'text'); |
|
| 446 | 446 | |
| 447 | 447 | /** client/html/catalog/domains |
| 448 | 448 | * A list of domain names whose items should be available in the catalog view templates |
| 449 | 449 | * |
| 450 | 450 | * @see client/html/catalog/stage/domains |
| 451 | 451 | */ |
| 452 | - $domains = $config->get( 'client/html/catalog/domains', $default ); |
|
| 452 | + $domains = $config->get('client/html/catalog/domains', $default); |
|
| 453 | 453 | |
| 454 | 454 | /** client/html/catalog/stage/standard/domains |
| 455 | 455 | * A list of domain names whose items should be available in the catalog stage view template |
@@ -472,15 +472,15 @@ discard block |
||
| 472 | 472 | * @see client/html/catalog/detail/domains |
| 473 | 473 | * @see client/html/catalog/lists/domains |
| 474 | 474 | */ |
| 475 | - $domains = $config->get( 'client/html/catalog/stage/standard/domains', $domains ); |
|
| 476 | - $stageCatPath = $controller->getCatalogPath( $params['f_catid'], $domains ); |
|
| 475 | + $domains = $config->get('client/html/catalog/stage/standard/domains', $domains); |
|
| 476 | + $stageCatPath = $controller->getCatalogPath($params['f_catid'], $domains); |
|
| 477 | 477 | |
| 478 | - if( ( $categoryItem = end( $stageCatPath ) ) !== false ) { |
|
| 478 | + if (($categoryItem = end($stageCatPath)) !== false) { |
|
| 479 | 479 | $view->stageCurrentCatItem = $categoryItem; |
| 480 | 480 | } |
| 481 | 481 | |
| 482 | - $this->addMetaItem( $stageCatPath, 'catalog', $this->expire, $this->tags ); |
|
| 483 | - $this->addMetaList( array_keys( $stageCatPath ), 'catalog', $this->expire ); |
|
| 482 | + $this->addMetaItem($stageCatPath, 'catalog', $this->expire, $this->tags); |
|
| 483 | + $this->addMetaList(array_keys($stageCatPath), 'catalog', $this->expire); |
|
| 484 | 484 | |
| 485 | 485 | $view->stageCatPath = $stageCatPath; |
| 486 | 486 | } |
@@ -490,8 +490,8 @@ discard block |
||
| 490 | 490 | $this->cache = $view; |
| 491 | 491 | } |
| 492 | 492 | |
| 493 | - $expire = $this->expires( $this->expire, $expire ); |
|
| 494 | - $tags = array_merge( $tags, $this->tags ); |
|
| 493 | + $expire = $this->expires($this->expire, $expire); |
|
| 494 | + $tags = array_merge($tags, $this->tags); |
|
| 495 | 495 | |
| 496 | 496 | return $this->cache; |
| 497 | 497 | } |