@@ -327,7 +327,7 @@ |
||
| 327 | 327 | $config['count'] = 0; |
| 328 | 328 | } |
| 329 | 329 | |
| 330 | - if( $maxcnt === null || ((int) $config['count']) < $maxcnt ) |
|
| 330 | + if( $maxcnt === null || ( (int) $config['count'] ) < $maxcnt ) |
|
| 331 | 331 | { |
| 332 | 332 | $config['count']++; |
| 333 | 333 | $listItem->setConfig( $config ); |
@@ -249,13 +249,11 @@ |
||
| 249 | 249 | $response->withHeader( 'Expires', '0' ); |
| 250 | 250 | |
| 251 | 251 | $response->withBody( $response->createStream( $fs->reads( $value ) ) ); |
| 252 | - } |
|
| 253 | - elseif( filter_var( $value, FILTER_VALIDATE_URL ) !== false ) |
|
| 252 | + } elseif( filter_var( $value, FILTER_VALIDATE_URL ) !== false ) |
|
| 254 | 253 | { |
| 255 | 254 | $response->withHeader( 'Location', $value ); |
| 256 | 255 | $response->withStatus( 303 ); |
| 257 | - } |
|
| 258 | - else |
|
| 256 | + } else |
|
| 259 | 257 | { |
| 260 | 258 | $response->withStatus( 404 ); |
| 261 | 259 | } |
@@ -541,15 +541,15 @@ |
||
| 541 | 541 | |
| 542 | 542 | |
| 543 | 543 | /** |
| 544 | - * Returns the template for the given configuration key |
|
| 545 | - * |
|
| 546 | - * If the "l_type" parameter is present, a specific template for this given |
|
| 547 | - * type is used if available. |
|
| 548 | - * |
|
| 549 | - * @param string $confkey Key to the configuration setting for the template |
|
| 550 | - * @param string $default Default template if none is configured or not found |
|
| 551 | - * @return string Relative template path |
|
| 552 | - */ |
|
| 544 | + * Returns the template for the given configuration key |
|
| 545 | + * |
|
| 546 | + * If the "l_type" parameter is present, a specific template for this given |
|
| 547 | + * type is used if available. |
|
| 548 | + * |
|
| 549 | + * @param string $confkey Key to the configuration setting for the template |
|
| 550 | + * @param string $default Default template if none is configured or not found |
|
| 551 | + * @return string Relative template path |
|
| 552 | + */ |
|
| 553 | 553 | protected function getTemplatePath( $confkey, $default ) |
| 554 | 554 | { |
| 555 | 555 | if( ( $type = $this->view->param( 'l_type' ) ) !== null && ctype_alnum( $type ) !== false ) { |
@@ -340,7 +340,7 @@ discard block |
||
| 340 | 340 | if( $item instanceof \Aimeos\MShop\Common\Item\ListRef\Iface ) |
| 341 | 341 | { |
| 342 | 342 | $this->addMetaItemRef( $item, $expires, $tags, $tagAll ); |
| 343 | - $idMap[ $item->getResourceType() ][] = $item->getId(); |
|
| 343 | + $idMap[$item->getResourceType()][] = $item->getId(); |
|
| 344 | 344 | } |
| 345 | 345 | |
| 346 | 346 | $this->addMetaItemSingle( $item, $expires, $tags, $tagAll ); |
@@ -606,11 +606,11 @@ discard block |
||
| 606 | 606 | 'header' => $this->getParamHash( $prefixes, $uid . ':' . $confkey . ':header', $cfg ), |
| 607 | 607 | ); |
| 608 | 608 | |
| 609 | - if( !isset( $this->cache[ $keys[$type] ] ) ) { |
|
| 609 | + if( !isset( $this->cache[$keys[$type]] ) ) { |
|
| 610 | 610 | $this->cache = $context->getCache()->getMultiple( $keys ); |
| 611 | 611 | } |
| 612 | 612 | |
| 613 | - return ( isset( $this->cache[ $keys[$type] ] ) ? $this->cache[ $keys[$type] ] : null ); |
|
| 613 | + return ( isset( $this->cache[$keys[$type]] ) ? $this->cache[$keys[$type]] : null ); |
|
| 614 | 614 | } |
| 615 | 615 | |
| 616 | 616 | |
@@ -522,12 +522,10 @@ |
||
| 522 | 522 | { |
| 523 | 523 | throw new \Aimeos\Client\Html\Exception( $e->getMessage() ); |
| 524 | 524 | } |
| 525 | - } |
|
| 526 | - else if( function_exists( 'mime_content_type' ) ) |
|
| 525 | + } else if( function_exists( 'mime_content_type' ) ) |
|
| 527 | 526 | { |
| 528 | 527 | $mimetype = mime_content_type( $filename ); |
| 529 | - } |
|
| 530 | - else |
|
| 528 | + } else |
|
| 531 | 529 | { |
| 532 | 530 | $mimetype = 'application/binary'; |
| 533 | 531 | } |
@@ -301,7 +301,9 @@ |
||
| 301 | 301 | $controller = \Aimeos\Controller\Frontend::create( $context, 'customer' ); |
| 302 | 302 | $view->summaryCustomerId = $controller->findItem( $addr->getEmail() )->getId(); |
| 303 | 303 | } |
| 304 | - catch( \Exception $e ) {} |
|
| 304 | + catch( \Exception $e ) |
|
| 305 | + { |
|
| 306 | +} |
|
| 305 | 307 | } |
| 306 | 308 | |
| 307 | 309 | $view->summaryTaxRates = $this->getTaxRates( $view->standardBasket ); |
@@ -249,8 +249,7 @@ |
||
| 249 | 249 | { |
| 250 | 250 | $view->standardErrorList = $view->get( 'standardErrorList', [] ) + $errors; |
| 251 | 251 | throw new \Aimeos\Client\Html\Exception( sprintf( 'Please recheck your delivery choice' ) ); |
| 252 | - } |
|
| 253 | - else |
|
| 252 | + } else |
|
| 254 | 253 | { |
| 255 | 254 | $basketCtrl->addService( 'delivery', $serviceId, $attributes ); |
| 256 | 255 | } |
@@ -249,8 +249,7 @@ |
||
| 249 | 249 | { |
| 250 | 250 | $view->standardErrorList = $view->get( 'standardErrorList', [] ) + $errors; |
| 251 | 251 | throw new \Aimeos\Client\Html\Exception( sprintf( 'Please recheck your payment choice' ) ); |
| 252 | - } |
|
| 253 | - else |
|
| 252 | + } else |
|
| 254 | 253 | { |
| 255 | 254 | $basketCtrl->addService( 'payment', $serviceId, $attributes ); |
| 256 | 255 | } |
@@ -459,7 +459,7 @@ |
||
| 459 | 459 | * @see client/html/checkout/standard/address/delivery/mandatory |
| 460 | 460 | * @see client/html/checkout/standard/address/delivery/optional |
| 461 | 461 | * @see client/html/checkout/standard/address/delivery/hidden |
| 462 | - */ |
|
| 462 | + */ |
|
| 463 | 463 | $disable = $view->config( 'client/html/checkout/standard/address/delivery/disable-new', false ); |
| 464 | 464 | $type = \Aimeos\MShop\Order\Item\Base\Address\Base::TYPE_DELIVERY; |
| 465 | 465 | |
@@ -463,9 +463,11 @@ discard block |
||
| 463 | 463 | $disable = $view->config( 'client/html/checkout/standard/address/delivery/disable-new', false ); |
| 464 | 464 | $type = \Aimeos\MShop\Order\Item\Base\Address\Base::TYPE_DELIVERY; |
| 465 | 465 | |
| 466 | - if( ( $option = $view->param( 'ca_deliveryoption', 'null' ) ) === 'null' && $disable === false ) // new address |
|
| 466 | + if( ( $option = $view->param( 'ca_deliveryoption', 'null' ) ) === 'null' && $disable === false ) { |
|
| 467 | + // new address |
|
| 467 | 468 | { |
| 468 | 469 | $params = $view->param( 'ca_delivery', [] ); |
| 470 | + } |
|
| 469 | 471 | $invalid = $this->checkFields( $params ); |
| 470 | 472 | |
| 471 | 473 | if( count( $invalid ) > 0 ) |
@@ -475,10 +477,11 @@ discard block |
||
| 475 | 477 | } |
| 476 | 478 | |
| 477 | 479 | $basketCtrl->setAddress( $type, $params ); |
| 478 | - } |
|
| 479 | - else if( ( $option = $view->param( 'ca_deliveryoption', 'null' ) ) !== '-1' ) // existing address |
|
| 480 | + } else if( ( $option = $view->param( 'ca_deliveryoption', 'null' ) ) !== '-1' ) { |
|
| 481 | + // existing address |
|
| 480 | 482 | { |
| 481 | 483 | $list = []; |
| 484 | + } |
|
| 482 | 485 | $params = $view->param( 'ca_delivery_' . $option, [] ); |
| 483 | 486 | |
| 484 | 487 | if( !empty( $params ) && ( $invalid = $this->checkFields( $params ) ) !== [] ) |
@@ -495,8 +498,7 @@ discard block |
||
| 495 | 498 | $address = $controller->editAddressItem( $option, $list ); |
| 496 | 499 | |
| 497 | 500 | $basketCtrl->setAddress( $type, $address ); |
| 498 | - } |
|
| 499 | - else |
|
| 501 | + } else |
|
| 500 | 502 | { |
| 501 | 503 | $basketCtrl->setAddress( $type, null ); |
| 502 | 504 | } |
@@ -516,9 +518,12 @@ discard block |
||
| 516 | 518 | $context = $this->getContext(); |
| 517 | 519 | $basketCntl = \Aimeos\Controller\Frontend::create( $context, 'basket' ); |
| 518 | 520 | |
| 519 | - try { |
|
| 521 | + try |
|
| 522 | + { |
|
| 520 | 523 | $langid = $basketCntl->get()->getAddress( 'delivery' )->getLanguageId(); |
| 521 | - } catch( \Exception $e ) { |
|
| 524 | + } |
|
| 525 | + catch( \Exception $e ) |
|
| 526 | + { |
|
| 522 | 527 | $langid = $view->param( 'ca_delivery/order.base.address.languageid', $context->getLocale()->getLanguageId() ); |
| 523 | 528 | } |
| 524 | 529 | $view->deliveryLanguage = $langid; |
@@ -697,8 +702,7 @@ discard block |
||
| 697 | 702 | $invalid[$key] = $name; |
| 698 | 703 | unset( $params[$key] ); |
| 699 | 704 | } |
| 700 | - } |
|
| 701 | - else |
|
| 705 | + } else |
|
| 702 | 706 | { |
| 703 | 707 | unset( $params[$key] ); |
| 704 | 708 | } |
@@ -319,7 +319,9 @@ |
||
| 319 | 319 | $view->addressPaymentItem = $paymentAddressItem; |
| 320 | 320 | $view->addressDeliveryItems = $deliveryAddressItems; |
| 321 | 321 | } |
| 322 | - catch( \Exception $e ) {} // customer has no account yet |
|
| 322 | + catch( \Exception $e ) |
|
| 323 | + { |
|
| 324 | +} // customer has no account yet |
|
| 323 | 325 | |
| 324 | 326 | |
| 325 | 327 | $localeManager = \Aimeos\MShop::create( $context, 'locale' ); |
@@ -536,7 +536,7 @@ |
||
| 536 | 536 | * @see client/html/checkout/standard/address/billing/mandatory |
| 537 | 537 | * @see client/html/checkout/standard/address/billing/optional |
| 538 | 538 | * @see client/html/checkout/standard/address/billing/hidden |
| 539 | - */ |
|
| 539 | + */ |
|
| 540 | 540 | $disable = $view->config( 'client/html/checkout/standard/address/billing/disable-new', false ); |
| 541 | 541 | $type = \Aimeos\MShop\Order\Item\Base\Address\Base::TYPE_PAYMENT; |
| 542 | 542 | |
@@ -540,9 +540,11 @@ discard block |
||
| 540 | 540 | $disable = $view->config( 'client/html/checkout/standard/address/billing/disable-new', false ); |
| 541 | 541 | $type = \Aimeos\MShop\Order\Item\Base\Address\Base::TYPE_PAYMENT; |
| 542 | 542 | |
| 543 | - if( ( $option = $view->param( 'ca_billingoption', 'null' ) ) === 'null' && $disable === false ) // new address |
|
| 543 | + if( ( $option = $view->param( 'ca_billingoption', 'null' ) ) === 'null' && $disable === false ) { |
|
| 544 | + // new address |
|
| 544 | 545 | { |
| 545 | 546 | $params = $view->param( 'ca_billing', [] ); |
| 547 | + } |
|
| 546 | 548 | |
| 547 | 549 | if( ( $invalid = $this->checkFields( $params ) ) !== [] ) |
| 548 | 550 | { |
@@ -551,8 +553,7 @@ discard block |
||
| 551 | 553 | } |
| 552 | 554 | |
| 553 | 555 | $basketCtrl->setAddress( $type, $params ); |
| 554 | - } |
|
| 555 | - else // existing address |
|
| 556 | + } else // existing address |
|
| 556 | 557 | { |
| 557 | 558 | $list = []; |
| 558 | 559 | $params = $view->param( 'ca_billing_' . $option, [] ); |
@@ -588,9 +589,12 @@ discard block |
||
| 588 | 589 | $context = $this->getContext(); |
| 589 | 590 | $basketCntl = \Aimeos\Controller\Frontend::create( $context, 'basket' ); |
| 590 | 591 | |
| 591 | - try { |
|
| 592 | + try |
|
| 593 | + { |
|
| 592 | 594 | $langid = $basketCntl->get()->getAddress( 'payment' )->getLanguageId(); |
| 593 | - } catch( \Exception $e ) { |
|
| 595 | + } |
|
| 596 | + catch( \Exception $e ) |
|
| 597 | + { |
|
| 594 | 598 | $langid = $view->param( 'ca_billing/order.base.address.languageid', $context->getLocale()->getLanguageId() ); |
| 595 | 599 | } |
| 596 | 600 | $view->billingLanguage = $langid; |
@@ -769,8 +773,7 @@ discard block |
||
| 769 | 773 | $invalid[$key] = $name; |
| 770 | 774 | unset( $params[$key] ); |
| 771 | 775 | } |
| 772 | - } |
|
| 773 | - else |
|
| 776 | + } else |
|
| 774 | 777 | { |
| 775 | 778 | unset( $params[$key] ); |
| 776 | 779 | } |