@@ -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->attributeBody = $html; |
| 80 | 80 | |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | $tplconf = 'client/html/catalog/detail/basket/attribute/standard/template-body'; |
| 102 | 102 | $default = 'catalog/detail/basket-attribute-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->attributeHeader = $html; |
| 125 | 125 | |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | $tplconf = 'client/html/catalog/detail/basket/attribute/standard/template-header'; |
| 148 | 148 | $default = 'catalog/detail/basket-attribute-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/detail/basket/attribute/decorators/excludes |
| 164 | 164 | * Excludes decorators added by the "common" option from the catalog detail basket attribute html client |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | * @see client/html/catalog/detail/basket/attribute/attribute/decorators/global |
| 235 | 235 | */ |
| 236 | 236 | |
| 237 | - return $this->createSubClient( 'catalog/detail/basket/attribute/' . $type, $name ); |
|
| 237 | + return $this->createSubClient('catalog/detail/basket/attribute/'.$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,24 +257,24 @@ 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 | $attributeTypes = array(); |
| 265 | - $attrItems = $view->get( 'detailProductAttributeItems', array() ); |
|
| 266 | - $configAttributes = $view->detailProductItem->getRefItems( 'attribute', null, 'config' ); |
|
| 265 | + $attrItems = $view->get('detailProductAttributeItems', array()); |
|
| 266 | + $configAttributes = $view->detailProductItem->getRefItems('attribute', null, 'config'); |
|
| 267 | 267 | |
| 268 | - foreach( $configAttributes as $id => $attribute ) |
|
| 268 | + foreach ($configAttributes as $id => $attribute) |
|
| 269 | 269 | { |
| 270 | - if( isset( $attrItems[$id] ) ) { |
|
| 270 | + if (isset($attrItems[$id])) { |
|
| 271 | 271 | $attributeTypes[$attrItems[$id]->getType()][$id] = $attrItems[$id]; |
| 272 | 272 | } |
| 273 | 273 | } |
| 274 | 274 | |
| 275 | 275 | $view->attributeConfigItems = $attributeTypes; |
| 276 | - $view->attributeCustomItems = $view->detailProductItem->getRefItems( 'attribute', null, 'custom' ); |
|
| 277 | - $view->attributeHiddenItems = $view->detailProductItem->getRefItems( 'attribute', null, 'hidden' ); |
|
| 276 | + $view->attributeCustomItems = $view->detailProductItem->getRefItems('attribute', null, 'custom'); |
|
| 277 | + $view->attributeHiddenItems = $view->detailProductItem->getRefItems('attribute', null, 'hidden'); |
|
| 278 | 278 | |
| 279 | 279 | $this->cache = $view; |
| 280 | 280 | } |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | * @since 2014.03 |
| 79 | 79 | * @category Developer |
| 80 | 80 | */ |
| 81 | - private $subPartNames = array( 'service', 'selection', 'attribute' ); |
|
| 81 | + private $subPartNames = array('service', 'selection', 'attribute'); |
|
| 82 | 82 | private $cache; |
| 83 | 83 | |
| 84 | 84 | |
@@ -90,13 +90,13 @@ discard block |
||
| 90 | 90 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 91 | 91 | * @return string HTML code |
| 92 | 92 | */ |
| 93 | - public function getBody( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 93 | + public function getBody($uid = '', array &$tags = array(), &$expire = null) |
|
| 94 | 94 | { |
| 95 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 95 | + $view = $this->setViewParams($this->getView(), $tags, $expire); |
|
| 96 | 96 | |
| 97 | 97 | $html = ''; |
| 98 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 99 | - $html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 98 | + foreach ($this->getSubClients() as $subclient) { |
|
| 99 | + $html .= $subclient->setView($view)->getBody($uid, $tags, $expire); |
|
| 100 | 100 | } |
| 101 | 101 | $view->basketBody = $html; |
| 102 | 102 | |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | $tplconf = 'client/html/catalog/detail/basket/standard/template-body'; |
| 124 | 124 | $default = 'catalog/detail/basket-body-default.php'; |
| 125 | 125 | |
| 126 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 126 | + return $view->render($view->config($tplconf, $default)); |
|
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | |
@@ -135,13 +135,13 @@ discard block |
||
| 135 | 135 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 136 | 136 | * @return string|null String including HTML tags for the header on error |
| 137 | 137 | */ |
| 138 | - public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 138 | + public function getHeader($uid = '', array &$tags = array(), &$expire = null) |
|
| 139 | 139 | { |
| 140 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 140 | + $view = $this->setViewParams($this->getView(), $tags, $expire); |
|
| 141 | 141 | |
| 142 | 142 | $html = ''; |
| 143 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 144 | - $html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 143 | + foreach ($this->getSubClients() as $subclient) { |
|
| 144 | + $html .= $subclient->setView($view)->getHeader($uid, $tags, $expire); |
|
| 145 | 145 | } |
| 146 | 146 | $view->basketHeader = $html; |
| 147 | 147 | |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | $tplconf = 'client/html/catalog/detail/basket/standard/template-header'; |
| 170 | 170 | $default = 'catalog/detail/basket-header-default.php'; |
| 171 | 171 | |
| 172 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 172 | + return $view->render($view->config($tplconf, $default)); |
|
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | * @param string|null $name Name of the sub-client (Default if null) |
| 181 | 181 | * @return \Aimeos\Client\Html\Iface Sub-client object |
| 182 | 182 | */ |
| 183 | - public function getSubClient( $type, $name = null ) |
|
| 183 | + public function getSubClient($type, $name = null) |
|
| 184 | 184 | { |
| 185 | 185 | /** client/html/catalog/detail/basket/decorators/excludes |
| 186 | 186 | * Excludes decorators added by the "common" option from the catalog detail basket html client |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | * @see client/html/catalog/detail/basket/decorators/global |
| 257 | 257 | */ |
| 258 | 258 | |
| 259 | - return $this->createSubClient( 'catalog/detail/basket/' . $type, $name ); |
|
| 259 | + return $this->createSubClient('catalog/detail/basket/'.$type, $name); |
|
| 260 | 260 | } |
| 261 | 261 | |
| 262 | 262 | |
@@ -267,11 +267,11 @@ discard block |
||
| 267 | 267 | * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
| 268 | 268 | * @return string Modified body content |
| 269 | 269 | */ |
| 270 | - public function modifyBody( $content, $uid ) |
|
| 270 | + public function modifyBody($content, $uid) |
|
| 271 | 271 | { |
| 272 | - $content = parent::modifyBody( $content, $uid ); |
|
| 272 | + $content = parent::modifyBody($content, $uid); |
|
| 273 | 273 | |
| 274 | - return $this->replaceSection( $content, $this->getView()->csrf()->formfield(), 'catalog.detail.basket.csrf' ); |
|
| 274 | + return $this->replaceSection($content, $this->getView()->csrf()->formfield(), 'catalog.detail.basket.csrf'); |
|
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | */ |
| 283 | 283 | protected function getSubClientNames() |
| 284 | 284 | { |
| 285 | - return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 285 | + return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames); |
|
| 286 | 286 | } |
| 287 | 287 | |
| 288 | 288 | |
@@ -294,9 +294,9 @@ discard block |
||
| 294 | 294 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 295 | 295 | * @return \Aimeos\MW\View\Iface Modified view object |
| 296 | 296 | */ |
| 297 | - protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null ) |
|
| 297 | + protected function setViewParams(\Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null) |
|
| 298 | 298 | { |
| 299 | - if( !isset( $this->cache ) ) |
|
| 299 | + if (!isset($this->cache)) |
|
| 300 | 300 | { |
| 301 | 301 | $config = $this->getContext()->getConfig(); |
| 302 | 302 | |
@@ -321,18 +321,18 @@ discard block |
||
| 321 | 321 | * @see client/html/catalog/stock/url/action |
| 322 | 322 | * @see client/html/catalog/stock/url/config |
| 323 | 323 | */ |
| 324 | - if( isset( $view->detailProductItem ) && $config->get( 'client/html/catalog/detail/stock/enable', true ) === true ) |
|
| 324 | + if (isset($view->detailProductItem) && $config->get('client/html/catalog/detail/stock/enable', true) === true) |
|
| 325 | 325 | { |
| 326 | - $stockTarget = $config->get( 'client/html/catalog/stock/url/target' ); |
|
| 327 | - $stockController = $config->get( 'client/html/catalog/stock/url/controller', 'catalog' ); |
|
| 328 | - $stockAction = $config->get( 'client/html/catalog/stock/url/action', 'stock' ); |
|
| 329 | - $stockConfig = $config->get( 'client/html/catalog/stock/url/config', array() ); |
|
| 326 | + $stockTarget = $config->get('client/html/catalog/stock/url/target'); |
|
| 327 | + $stockController = $config->get('client/html/catalog/stock/url/controller', 'catalog'); |
|
| 328 | + $stockAction = $config->get('client/html/catalog/stock/url/action', 'stock'); |
|
| 329 | + $stockConfig = $config->get('client/html/catalog/stock/url/config', array()); |
|
| 330 | 330 | |
| 331 | - $prodIds = array_keys( $view->detailProductItem->getRefItems( 'product', null, 'default' ) ); |
|
| 332 | - array_unshift( $prodIds, $view->detailProductItem->getId() ); |
|
| 333 | - $params = array( 's_prodid' => $prodIds ); |
|
| 331 | + $prodIds = array_keys($view->detailProductItem->getRefItems('product', null, 'default')); |
|
| 332 | + array_unshift($prodIds, $view->detailProductItem->getId()); |
|
| 333 | + $params = array('s_prodid' => $prodIds); |
|
| 334 | 334 | |
| 335 | - $view->basketStockUrl = $view->url( $stockTarget, $stockController, $stockAction, $params, array(), $stockConfig ); |
|
| 335 | + $view->basketStockUrl = $view->url($stockTarget, $stockController, $stockAction, $params, array(), $stockConfig); |
|
| 336 | 336 | $view->basketProductIds = $prodIds; |
| 337 | 337 | } |
| 338 | 338 | |
@@ -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->selectionBody = $html; |
| 82 | 82 | |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | $tplconf = 'client/html/catalog/detail/basket/selection/standard/template-body'; |
| 104 | 104 | $default = 'catalog/detail/basket-selection-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->selectionHeader = $html; |
| 127 | 127 | |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | $tplconf = 'client/html/catalog/detail/basket/selection/standard/template-header'; |
| 150 | 150 | $default = 'catalog/detail/basket-selection-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/detail/basket/selection/decorators/excludes |
| 166 | 166 | * Excludes decorators added by the "common" option from the catalog detail basket selection html client |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | * @see client/html/catalog/detail/basket/selection/decorators/global |
| 237 | 237 | */ |
| 238 | 238 | |
| 239 | - return $this->createSubClient( 'catalog/detail/basket/selection/' . $type, $name ); |
|
| 239 | + return $this->createSubClient('catalog/detail/basket/selection/'.$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,16 +259,16 @@ 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 | - if( $view->detailProductItem->getType() === 'select' ) |
|
| 266 | + if ($view->detailProductItem->getType() === 'select') |
|
| 267 | 267 | { |
| 268 | 268 | $context = $this->getContext(); |
| 269 | 269 | $config = $context->getConfig(); |
| 270 | - $domains = array( 'text', 'price', 'media', 'attribute' ); |
|
| 271 | - $products = $view->detailProductItem->getRefItems( 'product', 'default', 'default' ); |
|
| 270 | + $domains = array('text', 'price', 'media', 'attribute'); |
|
| 271 | + $products = $view->detailProductItem->getRefItems('product', 'default', 'default'); |
|
| 272 | 272 | |
| 273 | 273 | /** client/html/catalog/detail/basket/selection/domains |
| 274 | 274 | * A list of domain names whose items should be available in the basket |
@@ -287,15 +287,15 @@ discard block |
||
| 287 | 287 | * @category Developer |
| 288 | 288 | * @see client/html/catalog/detail/basket/selection/domains-attributes |
| 289 | 289 | */ |
| 290 | - $domains = $config->get( 'client/html/catalog/detail/basket/selection/domains', $domains ); |
|
| 290 | + $domains = $config->get('client/html/catalog/detail/basket/selection/domains', $domains); |
|
| 291 | 291 | |
| 292 | - $controller = \Aimeos\Controller\Frontend\Factory::createController( $context, 'catalog' ); |
|
| 293 | - $subproducts = $controller->getProductItems( array_keys( $products ), $domains ); |
|
| 292 | + $controller = \Aimeos\Controller\Frontend\Factory::createController($context, 'catalog'); |
|
| 293 | + $subproducts = $controller->getProductItems(array_keys($products), $domains); |
|
| 294 | 294 | $attrIds = $prodDeps = $attrDeps = $attrTypeDeps = array(); |
| 295 | 295 | |
| 296 | - foreach( $subproducts as $subProdId => $subProduct ) |
|
| 296 | + foreach ($subproducts as $subProdId => $subProduct) |
|
| 297 | 297 | { |
| 298 | - foreach( $subProduct->getRefItems( 'attribute', null, 'variant' ) as $attrId => $attrItem ) |
|
| 298 | + foreach ($subProduct->getRefItems('attribute', null, 'variant') as $attrId => $attrItem) |
|
| 299 | 299 | { |
| 300 | 300 | $attrTypeDeps[$attrItem->getType()][$attrId] = $attrItem->getPosition(); |
| 301 | 301 | $attrDeps[$attrId][] = $subProdId; |
@@ -304,20 +304,20 @@ discard block |
||
| 304 | 304 | } |
| 305 | 305 | } |
| 306 | 306 | |
| 307 | - ksort( $attrTypeDeps ); |
|
| 307 | + ksort($attrTypeDeps); |
|
| 308 | 308 | |
| 309 | - $this->addMetaItem( $subproducts, 'product', $this->expire, $this->tags ); |
|
| 310 | - $this->addMetaList( array_keys( $subproducts ), 'product', $this->expire ); |
|
| 309 | + $this->addMetaItem($subproducts, 'product', $this->expire, $this->tags); |
|
| 310 | + $this->addMetaList(array_keys($subproducts), 'product', $this->expire); |
|
| 311 | 311 | |
| 312 | 312 | |
| 313 | - $attrManager = $controller->createManager( 'attribute' ); |
|
| 313 | + $attrManager = $controller->createManager('attribute'); |
|
| 314 | 314 | |
| 315 | - $search = $attrManager->createSearch( true ); |
|
| 315 | + $search = $attrManager->createSearch(true); |
|
| 316 | 316 | $expr = array( |
| 317 | - $search->compare( '==', 'attribute.id', $attrIds ), |
|
| 317 | + $search->compare('==', 'attribute.id', $attrIds), |
|
| 318 | 318 | $search->getConditions(), |
| 319 | 319 | ); |
| 320 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
| 320 | + $search->setConditions($search->combine('&&', $expr)); |
|
| 321 | 321 | |
| 322 | 322 | /** client/html/catalog/detail/basket/selection/domains-attributes |
| 323 | 323 | * A list of domain names whose items should be available for the attributes |
@@ -336,13 +336,13 @@ discard block |
||
| 336 | 336 | * @category Developer |
| 337 | 337 | * @see client/html/catalog/detail/basket/selection/domains |
| 338 | 338 | */ |
| 339 | - $domains = array( 'text', 'media' ); |
|
| 340 | - $domains = $config->get( 'client/html/catalog/detail/basket/selection/domains-attributes', $domains ); |
|
| 339 | + $domains = array('text', 'media'); |
|
| 340 | + $domains = $config->get('client/html/catalog/detail/basket/selection/domains-attributes', $domains); |
|
| 341 | 341 | |
| 342 | - $attributes = $attrManager->searchItems( $search, $domains ); |
|
| 342 | + $attributes = $attrManager->searchItems($search, $domains); |
|
| 343 | 343 | |
| 344 | - $this->addMetaItem( $attributes, 'attribute', $this->expire, $this->tags ); |
|
| 345 | - $this->addMetaList( array_keys( $attributes ), 'attribute', $this->expire ); |
|
| 344 | + $this->addMetaItem($attributes, 'attribute', $this->expire, $this->tags); |
|
| 345 | + $this->addMetaList(array_keys($attributes), 'attribute', $this->expire); |
|
| 346 | 346 | |
| 347 | 347 | |
| 348 | 348 | $view->selectionProducts = $subproducts; |
@@ -355,8 +355,8 @@ discard block |
||
| 355 | 355 | $this->cache = $view; |
| 356 | 356 | } |
| 357 | 357 | |
| 358 | - $expire = $this->expires( $this->expire, $expire ); |
|
| 359 | - $tags = array_merge( $tags, $this->tags ); |
|
| 358 | + $expire = $this->expires($this->expire, $expire); |
|
| 359 | + $tags = array_merge($tags, $this->tags); |
|
| 360 | 360 | |
| 361 | 361 | return $this->cache; |
| 362 | 362 | } |
@@ -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->imageBody = $html; |
| 79 | 79 | |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | $tplconf = 'client/html/catalog/detail/image/standard/template-body'; |
| 101 | 101 | $default = 'catalog/detail/image-body-bottom.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->imageHeader = $html; |
| 124 | 124 | |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | $tplconf = 'client/html/catalog/detail/image/standard/template-header'; |
| 147 | 147 | $default = 'catalog/detail/image-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/image/decorators/excludes |
| 163 | 163 | * Excludes decorators added by the "common" option from the catalog detail image html client |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | * @see client/html/catalog/detail/image/decorators/global |
| 234 | 234 | */ |
| 235 | 235 | |
| 236 | - return $this->createSubClient( 'catalog/detail/image/' . $type, $name ); |
|
| 236 | + return $this->createSubClient('catalog/detail/image/'.$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 |
@@ -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->suggestBody = $html; |
| 82 | 82 | |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | $tplconf = 'client/html/catalog/detail/suggest/standard/template-body'; |
| 104 | 104 | $default = 'catalog/detail/suggest-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->suggestHeader = $html; |
| 127 | 127 | |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | $tplconf = 'client/html/catalog/detail/suggest/standard/template-header'; |
| 150 | 150 | $default = 'catalog/detail/suggest-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/detail/suggest/decorators/excludes |
| 166 | 166 | * Excludes decorators added by the "common" option from the catalog detail suggest html client |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | * @see client/html/catalog/detail/suggest/decorators/global |
| 237 | 237 | */ |
| 238 | 238 | |
| 239 | - return $this->createSubClient( 'catalog/detail/suggest/' . $type, $name ); |
|
| 239 | + return $this->createSubClient('catalog/detail/suggest/'.$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,25 +259,25 @@ 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 | - if( isset( $view->detailProductItem ) ) |
|
| 266 | + if (isset($view->detailProductItem)) |
|
| 267 | 267 | { |
| 268 | 268 | $context = $this->getContext(); |
| 269 | 269 | $config = $context->getConfig(); |
| 270 | - $domains = array( 'text', 'price', 'media' ); |
|
| 271 | - $products = $view->detailProductItem->getRefItems( 'product', null, 'suggestion' ); |
|
| 270 | + $domains = array('text', 'price', 'media'); |
|
| 271 | + $products = $view->detailProductItem->getRefItems('product', null, 'suggestion'); |
|
| 272 | 272 | |
| 273 | - $controller = \Aimeos\Controller\Frontend\Factory::createController( $context, 'catalog' ); |
|
| 273 | + $controller = \Aimeos\Controller\Frontend\Factory::createController($context, 'catalog'); |
|
| 274 | 274 | |
| 275 | 275 | /** client/html/catalog/detail/domains |
| 276 | 276 | * A list of domain names whose items should be available in the catalog view templates |
| 277 | 277 | * |
| 278 | 278 | * @see client/html/catalog/detail/domains |
| 279 | 279 | */ |
| 280 | - $domains = $config->get( 'client/html/catalog/detail/domains', $domains ); |
|
| 280 | + $domains = $config->get('client/html/catalog/detail/domains', $domains); |
|
| 281 | 281 | |
| 282 | 282 | /** client/html/catalog/detail/suggest/domains |
| 283 | 283 | * A list of domain names whose items should be available in the suggestion part of the catalog detail view templates |
@@ -300,20 +300,20 @@ discard block |
||
| 300 | 300 | * @category Developer |
| 301 | 301 | * @see client/html/catalog/detail/domains |
| 302 | 302 | */ |
| 303 | - $domains = $config->get( 'client/html/catalog/detail/suggest/domains', $domains ); |
|
| 303 | + $domains = $config->get('client/html/catalog/detail/suggest/domains', $domains); |
|
| 304 | 304 | |
| 305 | - $view->suggestItems = $controller->getProductItems( array_keys( $products ), $domains ); |
|
| 305 | + $view->suggestItems = $controller->getProductItems(array_keys($products), $domains); |
|
| 306 | 306 | $view->suggestPosItems = $products; |
| 307 | 307 | |
| 308 | - $this->addMetaItem( $view->suggestItems, 'product', $this->expire, $this->tags ); |
|
| 309 | - $this->addMetaList( array_keys( $view->suggestItems ), 'product', $this->expire ); |
|
| 308 | + $this->addMetaItem($view->suggestItems, 'product', $this->expire, $this->tags); |
|
| 309 | + $this->addMetaList(array_keys($view->suggestItems), 'product', $this->expire); |
|
| 310 | 310 | } |
| 311 | 311 | |
| 312 | 312 | $this->cache = $view; |
| 313 | 313 | } |
| 314 | 314 | |
| 315 | - $expire = $this->expires( $this->expire, $expire ); |
|
| 316 | - $tags = array_merge( $tags, $this->tags ); |
|
| 315 | + $expire = $this->expires($this->expire, $expire); |
|
| 316 | + $tags = array_merge($tags, $this->tags); |
|
| 317 | 317 | |
| 318 | 318 | return $this->cache; |
| 319 | 319 | } |
@@ -67,7 +67,7 @@ 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 | 72 | return ''; |
| 73 | 73 | } |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 82 | 82 | * @return string|null String including HTML tags for the header on error |
| 83 | 83 | */ |
| 84 | - public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 84 | + public function getHeader($uid = '', array &$tags = array(), &$expire = null) |
|
| 85 | 85 | { |
| 86 | 86 | return ''; |
| 87 | 87 | } |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | * @param string|null $name Name of the sub-client (Default if null) |
| 95 | 95 | * @return \Aimeos\Client\Html\Iface Sub-client object |
| 96 | 96 | */ |
| 97 | - public function getSubClient( $type, $name = null ) |
|
| 97 | + public function getSubClient($type, $name = null) |
|
| 98 | 98 | { |
| 99 | 99 | /** client/html/catalog/detail/seen/decorators/excludes |
| 100 | 100 | * Excludes decorators added by the "common" option from the catalog detail seen html client |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | * @see client/html/catalog/detail/seen/decorators/global |
| 171 | 171 | */ |
| 172 | 172 | |
| 173 | - return $this->createSubClient( 'catalog/detail/seen/' . $type, $name ); |
|
| 173 | + return $this->createSubClient('catalog/detail/seen/'.$type, $name); |
|
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | */ |
| 182 | 182 | protected function getSubClientNames() |
| 183 | 183 | { |
| 184 | - return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 184 | + return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames); |
|
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | |
@@ -192,16 +192,16 @@ discard block |
||
| 192 | 192 | */ |
| 193 | 193 | public function process() |
| 194 | 194 | { |
| 195 | - if( ( $id = $this->getView()->param( 'd_prodid' ) ) !== null ) |
|
| 195 | + if (($id = $this->getView()->param('d_prodid')) !== null) |
|
| 196 | 196 | { |
| 197 | 197 | $context = $this->getContext(); |
| 198 | 198 | $session = $context->getSession(); |
| 199 | - $lastSeen = $session->get( 'aimeos/catalog/session/seen/list', array() ); |
|
| 199 | + $lastSeen = $session->get('aimeos/catalog/session/seen/list', array()); |
|
| 200 | 200 | |
| 201 | - if( isset( $lastSeen[$id] ) ) |
|
| 201 | + if (isset($lastSeen[$id])) |
|
| 202 | 202 | { |
| 203 | 203 | $html = $lastSeen[$id]; |
| 204 | - unset( $lastSeen[$id] ); |
|
| 204 | + unset($lastSeen[$id]); |
|
| 205 | 205 | $lastSeen[$id] = $html; |
| 206 | 206 | } |
| 207 | 207 | else |
@@ -218,16 +218,16 @@ discard block |
||
| 218 | 218 | * @category User |
| 219 | 219 | * @category Developer |
| 220 | 220 | */ |
| 221 | - $max = $this->getContext()->getConfig()->get( 'client/html/catalog/session/seen/standard/maxitems', 6 ); |
|
| 221 | + $max = $this->getContext()->getConfig()->get('client/html/catalog/session/seen/standard/maxitems', 6); |
|
| 222 | 222 | |
| 223 | - $lastSeen[$id] = $this->getHtml( $id ); |
|
| 224 | - $lastSeen = array_slice( $lastSeen, -$max, $max, true ); |
|
| 223 | + $lastSeen[$id] = $this->getHtml($id); |
|
| 224 | + $lastSeen = array_slice($lastSeen, -$max, $max, true); |
|
| 225 | 225 | } |
| 226 | 226 | |
| 227 | - $session->set( 'aimeos/catalog/session/seen/list', $lastSeen ); |
|
| 227 | + $session->set('aimeos/catalog/session/seen/list', $lastSeen); |
|
| 228 | 228 | |
| 229 | - foreach( $session->get( 'aimeos/catalog/session/seen/cache', array() ) as $key => $value ) { |
|
| 230 | - $session->set( $key, null ); |
|
| 229 | + foreach ($session->get('aimeos/catalog/session/seen/cache', array()) as $key => $value) { |
|
| 230 | + $session->set($key, null); |
|
| 231 | 231 | } |
| 232 | 232 | } |
| 233 | 233 | |
@@ -241,21 +241,21 @@ discard block |
||
| 241 | 241 | * @param string $id Product ID |
| 242 | 242 | * @return string HTML of the last seen item for the given product ID |
| 243 | 243 | */ |
| 244 | - protected function getHtml( $id ) |
|
| 244 | + protected function getHtml($id) |
|
| 245 | 245 | { |
| 246 | 246 | $context = $this->getContext(); |
| 247 | 247 | $cache = $context->getCache(); |
| 248 | - $key = md5( $id . 'product:detail-seen' ); |
|
| 248 | + $key = md5($id.'product:detail-seen'); |
|
| 249 | 249 | |
| 250 | - if( ( $html = $cache->get( $key ) ) === null ) |
|
| 250 | + if (($html = $cache->get($key)) === null) |
|
| 251 | 251 | { |
| 252 | 252 | $expire = null; |
| 253 | 253 | $tags = array(); |
| 254 | 254 | $view = $this->getView(); |
| 255 | 255 | $config = $context->getConfig(); |
| 256 | 256 | |
| 257 | - $default = array( 'media', 'price', 'text' ); |
|
| 258 | - $domains = $config->get( 'client/html/catalog/domains', $default ); |
|
| 257 | + $default = array('media', 'price', 'text'); |
|
| 258 | + $domains = $config->get('client/html/catalog/domains', $default); |
|
| 259 | 259 | |
| 260 | 260 | /** client/html/catalog/detail/seen/domains |
| 261 | 261 | * A list of domain names whose items should be available in the last seen view template for the product |
@@ -275,16 +275,16 @@ discard block |
||
| 275 | 275 | * @see client/html/catalog/lists/domains |
| 276 | 276 | * @see client/html/catalog/detail/domains |
| 277 | 277 | */ |
| 278 | - $domains = $config->get( 'client/html/catalog/detail/seen/domains', $domains ); |
|
| 278 | + $domains = $config->get('client/html/catalog/detail/seen/domains', $domains); |
|
| 279 | 279 | |
| 280 | - $view->seenProductItem = \Aimeos\MShop\Factory::createManager( $context, 'product' )->getItem( $id, $domains ); |
|
| 280 | + $view->seenProductItem = \Aimeos\MShop\Factory::createManager($context, 'product')->getItem($id, $domains); |
|
| 281 | 281 | |
| 282 | - $this->addMetaItem( $view->seenProductItem, 'product', $expire, $tags ); |
|
| 283 | - $this->addMetaList( $view->seenProductItem->getId(), 'product', $expire ); |
|
| 282 | + $this->addMetaItem($view->seenProductItem, 'product', $expire, $tags); |
|
| 283 | + $this->addMetaList($view->seenProductItem->getId(), 'product', $expire); |
|
| 284 | 284 | |
| 285 | 285 | $output = ''; |
| 286 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 287 | - $output .= $subclient->setView( $view )->getBody( '', $tags, $expire ); |
|
| 286 | + foreach ($this->getSubClients() as $subclient) { |
|
| 287 | + $output .= $subclient->setView($view)->getBody('', $tags, $expire); |
|
| 288 | 288 | } |
| 289 | 289 | $view->seenBody = $output; |
| 290 | 290 | |
@@ -311,9 +311,9 @@ discard block |
||
| 311 | 311 | $tplconf = 'client/html/catalog/detail/seen/standard/template-body'; |
| 312 | 312 | $default = 'catalog/detail/seen-body-default.php'; |
| 313 | 313 | |
| 314 | - $html = $view->render( $view->config( $tplconf, $default ) ); |
|
| 314 | + $html = $view->render($view->config($tplconf, $default)); |
|
| 315 | 315 | |
| 316 | - $cache->set( $key, $html, $tags, $expire ); |
|
| 316 | + $cache->set($key, $html, $tags, $expire); |
|
| 317 | 317 | } |
| 318 | 318 | |
| 319 | 319 | return $html; |
@@ -32,18 +32,18 @@ discard block |
||
| 32 | 32 | * @param array $params Associative list of parameters that should be used for filtering |
| 33 | 33 | * @param \Aimeos\MW\Criteria\Iface $filter Criteria object for searching |
| 34 | 34 | */ |
| 35 | - protected function addAttributeFilterByParam( array $params, \Aimeos\MW\Criteria\Iface $filter ) |
|
| 35 | + protected function addAttributeFilterByParam(array $params, \Aimeos\MW\Criteria\Iface $filter) |
|
| 36 | 36 | { |
| 37 | - $attrids = ( isset( $params['f_attrid'] ) ? (array) $params['f_attrid'] : array() ); |
|
| 37 | + $attrids = (isset($params['f_attrid']) ? (array) $params['f_attrid'] : array()); |
|
| 38 | 38 | |
| 39 | - if( !empty( $attrids ) ) |
|
| 39 | + if (!empty($attrids)) |
|
| 40 | 40 | { |
| 41 | - $func = $filter->createFunction( 'index.attributeaggregate', array( array_keys( $attrids ) ) ); |
|
| 41 | + $func = $filter->createFunction('index.attributeaggregate', array(array_keys($attrids))); |
|
| 42 | 42 | $expr = array( |
| 43 | 43 | $filter->getConditions(), |
| 44 | - $filter->compare( '==', $func, count( $attrids ) ), |
|
| 44 | + $filter->compare('==', $func, count($attrids)), |
|
| 45 | 45 | ); |
| 46 | - $filter->setConditions( $filter->combine( '&&', $expr ) ); |
|
| 46 | + $filter->setConditions($filter->combine('&&', $expr)); |
|
| 47 | 47 | } |
| 48 | 48 | } |
| 49 | 49 | |
@@ -54,9 +54,9 @@ discard block |
||
| 54 | 54 | * @param \Aimeos\MW\View\Iface $view View instance with helper for retrieving the required parameters |
| 55 | 55 | * @param \Aimeos\MW\Criteria\Iface $filter Criteria object for searching |
| 56 | 56 | */ |
| 57 | - protected function addAttributeFilter( \Aimeos\MW\View\Iface $view, \Aimeos\MW\Criteria\Iface $filter ) |
|
| 57 | + protected function addAttributeFilter(\Aimeos\MW\View\Iface $view, \Aimeos\MW\Criteria\Iface $filter) |
|
| 58 | 58 | { |
| 59 | - $this->addAttributeFilterByParam( $view->param(), $filter ); |
|
| 59 | + $this->addAttributeFilterByParam($view->param(), $filter); |
|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | |
@@ -73,28 +73,28 @@ discard block |
||
| 73 | 73 | * @param boolean $textfilter True to include text criteria in product filter, false if not |
| 74 | 74 | * @return \Aimeos\MW\Criteria\Iface Search criteria object |
| 75 | 75 | */ |
| 76 | - protected function createProductListFilter( $text, $catid, $sort, $sortdir, $page, $size, $catfilter, $textfilter ) |
|
| 76 | + protected function createProductListFilter($text, $catid, $sort, $sortdir, $page, $size, $catfilter, $textfilter) |
|
| 77 | 77 | { |
| 78 | 78 | $controller = $this->getCatalogController(); |
| 79 | 79 | |
| 80 | - if( $text !== '' && $textfilter === true ) |
|
| 80 | + if ($text !== '' && $textfilter === true) |
|
| 81 | 81 | { |
| 82 | - $filter = $controller->createIndexFilterText( $text, $sort, $sortdir, ( $page - 1 ) * $size, $size ); |
|
| 82 | + $filter = $controller->createIndexFilterText($text, $sort, $sortdir, ($page - 1) * $size, $size); |
|
| 83 | 83 | |
| 84 | - if( $catid !== '' && $catfilter === true ) { |
|
| 85 | - $filter = $controller->addIndexFilterCategory( $filter, $this->getCatalogIds( $catid ) ); |
|
| 84 | + if ($catid !== '' && $catfilter === true) { |
|
| 85 | + $filter = $controller->addIndexFilterCategory($filter, $this->getCatalogIds($catid)); |
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | return $filter; |
| 89 | 89 | } |
| 90 | - elseif( $catid !== '' && $catfilter === true ) |
|
| 90 | + elseif ($catid !== '' && $catfilter === true) |
|
| 91 | 91 | { |
| 92 | - $catIds = $this->getCatalogIds( $catid ); |
|
| 93 | - return $controller->createIndexFilterCategory( $catIds, $sort, $sortdir, ( $page - 1 ) * $size, $size ); |
|
| 92 | + $catIds = $this->getCatalogIds($catid); |
|
| 93 | + return $controller->createIndexFilterCategory($catIds, $sort, $sortdir, ($page - 1) * $size, $size); |
|
| 94 | 94 | } |
| 95 | 95 | else |
| 96 | 96 | { |
| 97 | - return $controller->createIndexFilter( $sort, $sortdir, ( $page - 1 ) * $size, $size ); |
|
| 97 | + return $controller->createIndexFilter($sort, $sortdir, ($page - 1) * $size, $size); |
|
| 98 | 98 | } |
| 99 | 99 | } |
| 100 | 100 | |
@@ -106,10 +106,10 @@ discard block |
||
| 106 | 106 | */ |
| 107 | 107 | protected function getCatalogController() |
| 108 | 108 | { |
| 109 | - if( !isset( $this->controller ) ) |
|
| 109 | + if (!isset($this->controller)) |
|
| 110 | 110 | { |
| 111 | 111 | $context = $this->getContext(); |
| 112 | - $this->controller = \Aimeos\Controller\Frontend\Factory::createController( $context, 'catalog' ); |
|
| 112 | + $this->controller = \Aimeos\Controller\Frontend\Factory::createController($context, 'catalog'); |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | return $this->controller; |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | * @param string $catId Category ID |
| 123 | 123 | * @return string|array Cateogory ID or list of catetory IDs |
| 124 | 124 | */ |
| 125 | - protected function getCatalogIds( $catId ) |
|
| 125 | + protected function getCatalogIds($catId) |
|
| 126 | 126 | { |
| 127 | 127 | $config = $this->getContext()->getConfig(); |
| 128 | 128 | $default = \Aimeos\MW\Tree\Manager\Base::LEVEL_ONE; |
@@ -156,12 +156,12 @@ discard block |
||
| 156 | 156 | * @see client/html/catalog/lists/domains |
| 157 | 157 | * @see client/html/catalog/lists/size |
| 158 | 158 | */ |
| 159 | - $level = $config->get( 'client/html/catalog/lists/levels', $default ); |
|
| 159 | + $level = $config->get('client/html/catalog/lists/levels', $default); |
|
| 160 | 160 | |
| 161 | - if( $level != $default ) |
|
| 161 | + if ($level != $default) |
|
| 162 | 162 | { |
| 163 | - $tree = $this->getCatalogController()->getCatalogTree( $catId, array(), $level ); |
|
| 164 | - $catId = $this->getCatalogIdsFromTree( $tree ); |
|
| 163 | + $tree = $this->getCatalogController()->getCatalogTree($catId, array(), $level); |
|
| 164 | + $catId = $this->getCatalogIdsFromTree($tree); |
|
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | return $catId; |
@@ -174,12 +174,12 @@ discard block |
||
| 174 | 174 | * @param \Aimeos\MShop\Catalog\Item\Iface $item Catalog item with children |
| 175 | 175 | * @return array List of catalog IDs |
| 176 | 176 | */ |
| 177 | - protected function getCatalogIdsFromTree( \Aimeos\MShop\Catalog\Item\Iface $item ) |
|
| 177 | + protected function getCatalogIdsFromTree(\Aimeos\MShop\Catalog\Item\Iface $item) |
|
| 178 | 178 | { |
| 179 | - $list = array( $item->getId() ); |
|
| 179 | + $list = array($item->getId()); |
|
| 180 | 180 | |
| 181 | - foreach( $item->getChildren() as $child ) { |
|
| 182 | - $list = array_merge( $list, $this->getCatalogIdsFromTree( $child ) ); |
|
| 181 | + foreach ($item->getChildren() as $child) { |
|
| 182 | + $list = array_merge($list, $this->getCatalogIdsFromTree($child)); |
|
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | return $list; |
@@ -192,10 +192,10 @@ discard block |
||
| 192 | 192 | * @param \Aimeos\MW\View\Iface $view View instance with helper for retrieving the required parameters |
| 193 | 193 | * @return array List of products implementing \Aimeos\MShop\Product\Item\Iface |
| 194 | 194 | */ |
| 195 | - protected function getProductList( \Aimeos\MW\View\Iface $view ) |
|
| 195 | + protected function getProductList(\Aimeos\MW\View\Iface $view) |
|
| 196 | 196 | { |
| 197 | - if( $this->productList === null ) { |
|
| 198 | - $this->searchProducts( $view ); |
|
| 197 | + if ($this->productList === null) { |
|
| 198 | + $this->searchProducts($view); |
|
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | return $this->productList; |
@@ -211,16 +211,16 @@ discard block |
||
| 211 | 211 | * @param boolean $attrfilter True to include attribute criteria in product filter, false if not |
| 212 | 212 | * @return \Aimeos\MW\Criteria\Iface Search criteria object |
| 213 | 213 | */ |
| 214 | - protected function getProductListFilterByParam( array $params, $catfilter = true, $textfilter = true, $attrfilter = true ) |
|
| 214 | + protected function getProductListFilterByParam(array $params, $catfilter = true, $textfilter = true, $attrfilter = true) |
|
| 215 | 215 | { |
| 216 | 216 | $sortdir = '+'; |
| 217 | 217 | $context = $this->getContext(); |
| 218 | 218 | $config = $context->getConfig(); |
| 219 | 219 | |
| 220 | - $text = ( isset( $params['f_search'] ) ? (string) $params['f_search'] : '' ); |
|
| 221 | - $catid = ( isset( $params['f_catid'] ) ? (string) $params['f_catid'] : '' ); |
|
| 220 | + $text = (isset($params['f_search']) ? (string) $params['f_search'] : ''); |
|
| 221 | + $catid = (isset($params['f_catid']) ? (string) $params['f_catid'] : ''); |
|
| 222 | 222 | |
| 223 | - if( $catid == '' && $catfilter === true ) |
|
| 223 | + if ($catid == '' && $catfilter === true) |
|
| 224 | 224 | { |
| 225 | 225 | /** client/html/catalog/lists/catid-default |
| 226 | 226 | * The default category ID used if none is given as parameter |
@@ -241,17 +241,17 @@ discard block |
||
| 241 | 241 | * @see client/html/catalog/lists/levels |
| 242 | 242 | * @see client/html/catalog/detail/prodid-default |
| 243 | 243 | */ |
| 244 | - $catid = $config->get( 'client/html/catalog/lists/catid-default', '' ); |
|
| 244 | + $catid = $config->get('client/html/catalog/lists/catid-default', ''); |
|
| 245 | 245 | } |
| 246 | 246 | |
| 247 | - $page = $this->getProductListPageByParam( $params ); |
|
| 248 | - $size = $this->getProductListSizeByParam( $params ); |
|
| 249 | - $sort = $this->getProductListSortByParam( $params, $sortdir ); |
|
| 247 | + $page = $this->getProductListPageByParam($params); |
|
| 248 | + $size = $this->getProductListSizeByParam($params); |
|
| 249 | + $sort = $this->getProductListSortByParam($params, $sortdir); |
|
| 250 | 250 | |
| 251 | - $filter = $this->createProductListFilter( $text, $catid, $sort, $sortdir, $page, $size, $catfilter, $textfilter ); |
|
| 251 | + $filter = $this->createProductListFilter($text, $catid, $sort, $sortdir, $page, $size, $catfilter, $textfilter); |
|
| 252 | 252 | |
| 253 | - if( $attrfilter === true ) { |
|
| 254 | - $this->addAttributeFilterByParam( $params, $filter ); |
|
| 253 | + if ($attrfilter === true) { |
|
| 254 | + $this->addAttributeFilterByParam($params, $filter); |
|
| 255 | 255 | } |
| 256 | 256 | |
| 257 | 257 | |
@@ -268,9 +268,9 @@ discard block |
||
| 268 | 268 | * @param boolean $attrfilter True to include attribute criteria in product filter, false if not |
| 269 | 269 | * @return \Aimeos\MW\Criteria\Iface Search criteria object |
| 270 | 270 | */ |
| 271 | - protected function getProductListFilter( \Aimeos\MW\View\Iface $view, $catfilter = true, $textfilter = true, $attrfilter = true ) |
|
| 271 | + protected function getProductListFilter(\Aimeos\MW\View\Iface $view, $catfilter = true, $textfilter = true, $attrfilter = true) |
|
| 272 | 272 | { |
| 273 | - return $this->getProductListFilterByParam( $view->param(), $catfilter, $textfilter, $attrfilter ); |
|
| 273 | + return $this->getProductListFilterByParam($view->param(), $catfilter, $textfilter, $attrfilter); |
|
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 | |
@@ -280,10 +280,10 @@ discard block |
||
| 280 | 280 | * @param \Aimeos\MW\View\Iface $view View instance with helper for retrieving the required parameters |
| 281 | 281 | * @return integer Total number of products |
| 282 | 282 | */ |
| 283 | - protected function getProductListTotal( \Aimeos\MW\View\Iface $view ) |
|
| 283 | + protected function getProductListTotal(\Aimeos\MW\View\Iface $view) |
|
| 284 | 284 | { |
| 285 | - if( $this->productList === null ) { |
|
| 286 | - $this->searchProducts( $view ); |
|
| 285 | + if ($this->productList === null) { |
|
| 286 | + $this->searchProducts($view); |
|
| 287 | 287 | } |
| 288 | 288 | |
| 289 | 289 | return $this->productTotal; |
@@ -296,9 +296,9 @@ discard block |
||
| 296 | 296 | * @param array $params Associative list of parameters that should be used for filtering |
| 297 | 297 | * @return integer Page number starting from 1 |
| 298 | 298 | */ |
| 299 | - protected function getProductListPageByParam( array $params ) |
|
| 299 | + protected function getProductListPageByParam(array $params) |
|
| 300 | 300 | { |
| 301 | - return ( isset( $params['l_page'] ) && $params['l_page'] > 0 ? (int) $params['l_page'] : 1 ); |
|
| 301 | + return (isset($params['l_page']) && $params['l_page'] > 0 ? (int) $params['l_page'] : 1); |
|
| 302 | 302 | } |
| 303 | 303 | |
| 304 | 304 | |
@@ -308,9 +308,9 @@ discard block |
||
| 308 | 308 | * @param \Aimeos\MW\View\Iface $view View instance with helper for retrieving the required parameters |
| 309 | 309 | * @return integer Page number starting from 1 |
| 310 | 310 | */ |
| 311 | - protected function getProductListPage( \Aimeos\MW\View\Iface $view ) |
|
| 311 | + protected function getProductListPage(\Aimeos\MW\View\Iface $view) |
|
| 312 | 312 | { |
| 313 | - return $this->getProductListPageByParam( $view->param() ); |
|
| 313 | + return $this->getProductListPageByParam($view->param()); |
|
| 314 | 314 | } |
| 315 | 315 | |
| 316 | 316 | |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | * @param array $params Associative list of parameters that should be used for filtering |
| 321 | 321 | * @return integer Page size |
| 322 | 322 | */ |
| 323 | - protected function getProductListSizeByParam( array $params ) |
|
| 323 | + protected function getProductListSizeByParam(array $params) |
|
| 324 | 324 | { |
| 325 | 325 | /** client/html/catalog/lists/size |
| 326 | 326 | * The number of products shown in a list page |
@@ -343,10 +343,10 @@ discard block |
||
| 343 | 343 | * @see client/html/catalog/lists/domains |
| 344 | 344 | * @see client/html/catalog/lists/levels |
| 345 | 345 | */ |
| 346 | - $defaultSize = $this->getContext()->getConfig()->get( 'client/html/catalog/lists/size', 48 ); |
|
| 346 | + $defaultSize = $this->getContext()->getConfig()->get('client/html/catalog/lists/size', 48); |
|
| 347 | 347 | |
| 348 | - $size = ( isset( $params['l_size'] ) ? (int) $params['l_size'] : $defaultSize ); |
|
| 349 | - return ( $size < 1 || $size > 100 ? $defaultSize : $size ); |
|
| 348 | + $size = (isset($params['l_size']) ? (int) $params['l_size'] : $defaultSize); |
|
| 349 | + return ($size < 1 || $size > 100 ? $defaultSize : $size); |
|
| 350 | 350 | } |
| 351 | 351 | |
| 352 | 352 | |
@@ -356,9 +356,9 @@ discard block |
||
| 356 | 356 | * @param \Aimeos\MW\View\Iface $view View instance with helper for retrieving the required parameters |
| 357 | 357 | * @return integer Page size |
| 358 | 358 | */ |
| 359 | - protected function getProductListSize( \Aimeos\MW\View\Iface $view ) |
|
| 359 | + protected function getProductListSize(\Aimeos\MW\View\Iface $view) |
|
| 360 | 360 | { |
| 361 | - return $this->getProductListSizeByParam( $view->param() ); |
|
| 361 | + return $this->getProductListSizeByParam($view->param()); |
|
| 362 | 362 | } |
| 363 | 363 | |
| 364 | 364 | |
@@ -369,14 +369,14 @@ discard block |
||
| 369 | 369 | * @param string &$sortdir Value-result parameter where the sort direction will be stored |
| 370 | 370 | * @return string Sortation string (relevance, name, price) |
| 371 | 371 | */ |
| 372 | - protected function getProductListSortByParam( array $params, &$sortdir ) |
|
| 372 | + protected function getProductListSortByParam(array $params, &$sortdir) |
|
| 373 | 373 | { |
| 374 | - $sortation = ( isset( $params['f_sort'] ) ? (string) $params['f_sort'] : 'relevance' ); |
|
| 374 | + $sortation = (isset($params['f_sort']) ? (string) $params['f_sort'] : 'relevance'); |
|
| 375 | 375 | |
| 376 | - $sortdir = ( $sortation[0] === '-' ? '-' : '+' ); |
|
| 377 | - $sort = ltrim( $sortation, '-' ); |
|
| 376 | + $sortdir = ($sortation[0] === '-' ? '-' : '+'); |
|
| 377 | + $sort = ltrim($sortation, '-'); |
|
| 378 | 378 | |
| 379 | - return ( strlen( $sort ) > 0 ? $sort : 'relevance' ); |
|
| 379 | + return (strlen($sort) > 0 ? $sort : 'relevance'); |
|
| 380 | 380 | } |
| 381 | 381 | |
| 382 | 382 | |
@@ -387,9 +387,9 @@ discard block |
||
| 387 | 387 | * @param string &$sortdir Value-result parameter where the sort direction will be stored |
| 388 | 388 | * @return string Sortation string (relevance, name, price) |
| 389 | 389 | */ |
| 390 | - protected function getProductListSort( \Aimeos\MW\View\Iface $view, &$sortdir ) |
|
| 390 | + protected function getProductListSort(\Aimeos\MW\View\Iface $view, &$sortdir) |
|
| 391 | 391 | { |
| 392 | - return $this->getProductListSortByParam( $view->param(), $sortdir ); |
|
| 392 | + return $this->getProductListSortByParam($view->param(), $sortdir); |
|
| 393 | 393 | } |
| 394 | 394 | |
| 395 | 395 | |
@@ -401,7 +401,7 @@ discard block |
||
| 401 | 401 | * |
| 402 | 402 | * @param \Aimeos\MW\View\Iface $view View instance with helper for retrieving the required parameters |
| 403 | 403 | */ |
| 404 | - protected function searchProducts( \Aimeos\MW\View\Iface $view ) |
|
| 404 | + protected function searchProducts(\Aimeos\MW\View\Iface $view) |
|
| 405 | 405 | { |
| 406 | 406 | $context = $this->getContext(); |
| 407 | 407 | $config = $context->getConfig(); |
@@ -429,7 +429,7 @@ discard block |
||
| 429 | 429 | * @see client/html/catalog/lists/size |
| 430 | 430 | * @see client/html/catalog/lists/levels |
| 431 | 431 | */ |
| 432 | - $domains = $config->get( 'client/html/catalog/domains', array( 'media', 'price', 'text' ) ); |
|
| 432 | + $domains = $config->get('client/html/catalog/domains', array('media', 'price', 'text')); |
|
| 433 | 433 | |
| 434 | 434 | /** client/html/catalog/lists/domains |
| 435 | 435 | * A list of domain names whose items should be available in the product list view template |
@@ -456,11 +456,11 @@ discard block |
||
| 456 | 456 | * @see client/html/catalog/lists/size |
| 457 | 457 | * @see client/html/catalog/lists/levels |
| 458 | 458 | */ |
| 459 | - $domains = $config->get( 'client/html/catalog/lists/domains', $domains ); |
|
| 459 | + $domains = $config->get('client/html/catalog/lists/domains', $domains); |
|
| 460 | 460 | |
| 461 | 461 | $controller = $this->getCatalogController(); |
| 462 | - $productFilter = $this->getProductListFilter( $view ); |
|
| 462 | + $productFilter = $this->getProductListFilter($view); |
|
| 463 | 463 | |
| 464 | - $this->productList = $controller->getIndexItems( $productFilter, $domains, $this->productTotal ); |
|
| 464 | + $this->productList = $controller->getIndexItems($productFilter, $domains, $this->productTotal); |
|
| 465 | 465 | } |
| 466 | 466 | } |
@@ -68,7 +68,7 @@ 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 | 73 | $context = $this->getContext(); |
| 74 | 74 | $session = $context->getSession(); |
@@ -83,16 +83,16 @@ discard block |
||
| 83 | 83 | * @category Developer |
| 84 | 84 | * @see client/html/catalog/session#pinned |
| 85 | 85 | */ |
| 86 | - $config = $context->getConfig()->get( 'client/html/catalog/session/pinned', array() ); |
|
| 87 | - $key = $this->getParamHash( array(), $uid . ':catalog:session-pinned-body', $config ); |
|
| 86 | + $config = $context->getConfig()->get('client/html/catalog/session/pinned', array()); |
|
| 87 | + $key = $this->getParamHash(array(), $uid.':catalog:session-pinned-body', $config); |
|
| 88 | 88 | |
| 89 | - if( ( $html = $session->get( $key ) ) === null ) |
|
| 89 | + if (($html = $session->get($key)) === null) |
|
| 90 | 90 | { |
| 91 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 91 | + $view = $this->setViewParams($this->getView(), $tags, $expire); |
|
| 92 | 92 | |
| 93 | 93 | $output = ''; |
| 94 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 95 | - $output .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 94 | + foreach ($this->getSubClients() as $subclient) { |
|
| 95 | + $output .= $subclient->setView($view)->getBody($uid, $tags, $expire); |
|
| 96 | 96 | } |
| 97 | 97 | $view->pinnedBody = $output; |
| 98 | 98 | |
@@ -119,11 +119,11 @@ discard block |
||
| 119 | 119 | $tplconf = 'client/html/catalog/session/pinned/standard/template-body'; |
| 120 | 120 | $default = 'catalog/session/pinned-body-default.php'; |
| 121 | 121 | |
| 122 | - $html = $view->render( $view->config( $tplconf, $default ) ); |
|
| 122 | + $html = $view->render($view->config($tplconf, $default)); |
|
| 123 | 123 | |
| 124 | - $cached = $session->get( 'aimeos/catalog/session/pinned/cache', array() ) + array( $key => true ); |
|
| 125 | - $session->set( 'aimeos/catalog/session/pinned/cache', $cached ); |
|
| 126 | - $session->set( $key, $html ); |
|
| 124 | + $cached = $session->get('aimeos/catalog/session/pinned/cache', array()) + array($key => true); |
|
| 125 | + $session->set('aimeos/catalog/session/pinned/cache', $cached); |
|
| 126 | + $session->set($key, $html); |
|
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | return $html; |
@@ -138,21 +138,21 @@ discard block |
||
| 138 | 138 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 139 | 139 | * @return string|null String including HTML tags for the header on error |
| 140 | 140 | */ |
| 141 | - public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 141 | + public function getHeader($uid = '', array &$tags = array(), &$expire = null) |
|
| 142 | 142 | { |
| 143 | 143 | $context = $this->getContext(); |
| 144 | 144 | $session = $context->getSession(); |
| 145 | 145 | |
| 146 | - $config = $context->getConfig()->get( 'client/html/catalog/session/pinned', array() ); |
|
| 147 | - $key = $this->getParamHash( array(), $uid . ':catalog:session-pinned-header', $config ); |
|
| 146 | + $config = $context->getConfig()->get('client/html/catalog/session/pinned', array()); |
|
| 147 | + $key = $this->getParamHash(array(), $uid.':catalog:session-pinned-header', $config); |
|
| 148 | 148 | |
| 149 | - if( ( $html = $session->get( $key ) ) === null ) |
|
| 149 | + if (($html = $session->get($key)) === null) |
|
| 150 | 150 | { |
| 151 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 151 | + $view = $this->setViewParams($this->getView(), $tags, $expire); |
|
| 152 | 152 | |
| 153 | 153 | $output = ''; |
| 154 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 155 | - $output .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 154 | + foreach ($this->getSubClients() as $subclient) { |
|
| 155 | + $output .= $subclient->setView($view)->getHeader($uid, $tags, $expire); |
|
| 156 | 156 | } |
| 157 | 157 | $view->pinnedHeader = $output; |
| 158 | 158 | |
@@ -180,11 +180,11 @@ discard block |
||
| 180 | 180 | $tplconf = 'client/html/catalog/session/pinned/standard/template-header'; |
| 181 | 181 | $default = 'catalog/session/pinned-header-default.php'; |
| 182 | 182 | |
| 183 | - $html = $view->render( $view->config( $tplconf, $default ) ); |
|
| 183 | + $html = $view->render($view->config($tplconf, $default)); |
|
| 184 | 184 | |
| 185 | - $cached = $session->get( 'aimeos/catalog/session/pinned/cache', array() ) + array( $key => true ); |
|
| 186 | - $session->set( 'aimeos/catalog/session/pinned/cache', $cached ); |
|
| 187 | - $session->set( $key, $html ); |
|
| 185 | + $cached = $session->get('aimeos/catalog/session/pinned/cache', array()) + array($key => true); |
|
| 186 | + $session->set('aimeos/catalog/session/pinned/cache', $cached); |
|
| 187 | + $session->set($key, $html); |
|
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | return $html; |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | * @param string|null $name Name of the sub-client (Default if null) |
| 199 | 199 | * @return \Aimeos\Client\Html\Iface Sub-client object |
| 200 | 200 | */ |
| 201 | - public function getSubClient( $type, $name = null ) |
|
| 201 | + public function getSubClient($type, $name = null) |
|
| 202 | 202 | { |
| 203 | 203 | /** client/html/catalog/session/pinned/decorators/excludes |
| 204 | 204 | * Excludes decorators added by the "common" option from the catalog session pinned html client |
@@ -274,7 +274,7 @@ discard block |
||
| 274 | 274 | * @see client/html/catalog/session/pinned/decorators/global |
| 275 | 275 | */ |
| 276 | 276 | |
| 277 | - return $this->createSubClient( 'catalog/session/pinned/' . $type, $name ); |
|
| 277 | + return $this->createSubClient('catalog/session/pinned/'.$type, $name); |
|
| 278 | 278 | } |
| 279 | 279 | |
| 280 | 280 | |
@@ -289,13 +289,13 @@ discard block |
||
| 289 | 289 | $view = $this->getView(); |
| 290 | 290 | $context = $this->getContext(); |
| 291 | 291 | $session = $context->getSession(); |
| 292 | - $pinned = $session->get( 'aimeos/catalog/session/pinned/list', array() ); |
|
| 292 | + $pinned = $session->get('aimeos/catalog/session/pinned/list', array()); |
|
| 293 | 293 | |
| 294 | - switch( $view->param( 'pin_action' ) ) |
|
| 294 | + switch ($view->param('pin_action')) |
|
| 295 | 295 | { |
| 296 | 296 | case 'add': |
| 297 | 297 | |
| 298 | - foreach( (array) $view->param( 'pin_id', array() ) as $id ) { |
|
| 298 | + foreach ((array) $view->param('pin_id', array()) as $id) { |
|
| 299 | 299 | $pinned[$id] = $id; |
| 300 | 300 | } |
| 301 | 301 | |
@@ -316,16 +316,16 @@ discard block |
||
| 316 | 316 | * @category User |
| 317 | 317 | * @category Developer |
| 318 | 318 | */ |
| 319 | - $max = $context->getConfig()->get( 'client/html/catalog/session/pinned/standard/maxitems', 50 ); |
|
| 319 | + $max = $context->getConfig()->get('client/html/catalog/session/pinned/standard/maxitems', 50); |
|
| 320 | 320 | |
| 321 | - $pinned = array_slice( $pinned, -$max, $max, true ); |
|
| 321 | + $pinned = array_slice($pinned, -$max, $max, true); |
|
| 322 | 322 | $refresh = true; |
| 323 | 323 | break; |
| 324 | 324 | |
| 325 | 325 | case 'delete': |
| 326 | 326 | |
| 327 | - foreach( (array) $view->param( 'pin_id', array() ) as $id ) { |
|
| 328 | - unset( $pinned[$id] ); |
|
| 327 | + foreach ((array) $view->param('pin_id', array()) as $id) { |
|
| 328 | + unset($pinned[$id]); |
|
| 329 | 329 | } |
| 330 | 330 | |
| 331 | 331 | $refresh = true; |
@@ -333,12 +333,12 @@ discard block |
||
| 333 | 333 | } |
| 334 | 334 | |
| 335 | 335 | |
| 336 | - if( $refresh ) |
|
| 336 | + if ($refresh) |
|
| 337 | 337 | { |
| 338 | - $session->set( 'aimeos/catalog/session/pinned/list', $pinned ); |
|
| 338 | + $session->set('aimeos/catalog/session/pinned/list', $pinned); |
|
| 339 | 339 | |
| 340 | - foreach( $session->get( 'aimeos/catalog/session/pinned/cache', array() ) as $key => $value ) { |
|
| 341 | - $session->set( $key, null ); |
|
| 340 | + foreach ($session->get('aimeos/catalog/session/pinned/cache', array()) as $key => $value) { |
|
| 341 | + $session->set($key, null); |
|
| 342 | 342 | } |
| 343 | 343 | } |
| 344 | 344 | |
@@ -353,7 +353,7 @@ discard block |
||
| 353 | 353 | */ |
| 354 | 354 | protected function getSubClientNames() |
| 355 | 355 | { |
| 356 | - return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 356 | + return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames); |
|
| 357 | 357 | } |
| 358 | 358 | |
| 359 | 359 | |
@@ -365,9 +365,9 @@ discard block |
||
| 365 | 365 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 366 | 366 | * @return \Aimeos\MW\View\Iface Modified view object |
| 367 | 367 | */ |
| 368 | - protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null ) |
|
| 368 | + protected function setViewParams(\Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null) |
|
| 369 | 369 | { |
| 370 | - if( !isset( $this->cache ) ) |
|
| 370 | + if (!isset($this->cache)) |
|
| 371 | 371 | { |
| 372 | 372 | $expire = null; |
| 373 | 373 | $tags = $items = array(); |
@@ -375,8 +375,8 @@ discard block |
||
| 375 | 375 | $config = $context->getConfig(); |
| 376 | 376 | $session = $context->getSession(); |
| 377 | 377 | |
| 378 | - $default = array( 'media', 'price', 'text' ); |
|
| 379 | - $domains = $config->get( 'client/html/catalog/domains', $default ); |
|
| 378 | + $default = array('media', 'price', 'text'); |
|
| 379 | + $domains = $config->get('client/html/catalog/domains', $default); |
|
| 380 | 380 | |
| 381 | 381 | /** client/html/catalog/session/pinned/domains |
| 382 | 382 | * A list of domain names whose items should be available in the pinned view template for the product |
@@ -399,22 +399,22 @@ discard block |
||
| 399 | 399 | * @see client/html/catalog/lists/domains |
| 400 | 400 | * @see client/html/catalog/detail/domains |
| 401 | 401 | */ |
| 402 | - $domains = $config->get( 'client/html/catalog/session/pinned/domains', $domains ); |
|
| 402 | + $domains = $config->get('client/html/catalog/session/pinned/domains', $domains); |
|
| 403 | 403 | |
| 404 | - $pinned = $session->get( 'aimeos/catalog/session/pinned/list', array() ); |
|
| 404 | + $pinned = $session->get('aimeos/catalog/session/pinned/list', array()); |
|
| 405 | 405 | |
| 406 | - $controller = \Aimeos\Controller\Frontend\Factory::createController( $context, 'catalog' ); |
|
| 407 | - $result = $controller->getProductItems( $pinned, $domains ); |
|
| 406 | + $controller = \Aimeos\Controller\Frontend\Factory::createController($context, 'catalog'); |
|
| 407 | + $result = $controller->getProductItems($pinned, $domains); |
|
| 408 | 408 | |
| 409 | - foreach( array_reverse( $pinned ) as $id ) |
|
| 409 | + foreach (array_reverse($pinned) as $id) |
|
| 410 | 410 | { |
| 411 | - if( isset( $result[$id] ) ) { |
|
| 411 | + if (isset($result[$id])) { |
|
| 412 | 412 | $items[$id] = $result[$id]; |
| 413 | 413 | } |
| 414 | 414 | } |
| 415 | 415 | |
| 416 | 416 | $view->pinnedProductItems = $items; |
| 417 | - $view->pinnedParams = $this->getClientParams( $view->param() ); |
|
| 417 | + $view->pinnedParams = $this->getClientParams($view->param()); |
|
| 418 | 418 | |
| 419 | 419 | $this->cache = $view; |
| 420 | 420 | } |
@@ -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/session/name |
| 37 | 37 | * Class name of the used catalog session 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/session/name', 'Standard' ); |
|
| 69 | + if ($name === null) { |
|
| 70 | + $name = $context->getConfig()->get('client/html/catalog/session/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\\Session\\' . $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\\Session\\'.$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\\Session\\' . $name; |
|
| 80 | + $classname = '\\Aimeos\\Client\\Html\\Catalog\\Session\\'.$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/session' ); |
|
| 84 | + return self::addClientDecorators($context, $client, $templatePaths, 'catalog/session'); |
|
| 85 | 85 | } |
| 86 | 86 | } |
| 87 | 87 | |