@@ -39,7 +39,6 @@ |
||
| 39 | 39 | /** |
| 40 | 40 | * Creates the view object for the HTML client. |
| 41 | 41 | * |
| 42 | - * @param \Aimeos\MW\Config\Iface $config Configuration object |
|
| 43 | 42 | * @param ServerRequestInterface $request Request object |
| 44 | 43 | * @param ResponseInterface $response Response object |
| 45 | 44 | * @param array $attr Associative list of URI parameters |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | * |
| 31 | 31 | * @param ContainerInterface $container Dependency container |
| 32 | 32 | */ |
| 33 | - public function __construct( ContainerInterface $container ) |
|
| 33 | + public function __construct(ContainerInterface $container) |
|
| 34 | 34 | { |
| 35 | 35 | $this->container = $container; |
| 36 | 36 | } |
@@ -47,53 +47,53 @@ discard block |
||
| 47 | 47 | * @param string|null $locale Code of the current language or null for no translation |
| 48 | 48 | * @return \Aimeos\MW\View\Iface View object |
| 49 | 49 | */ |
| 50 | - public function create( ServerRequestInterface $request, ResponseInterface $response, array $attr, array $templatePaths, $locale = null ) |
|
| 50 | + public function create(ServerRequestInterface $request, ResponseInterface $response, array $attr, array $templatePaths, $locale = null) |
|
| 51 | 51 | { |
| 52 | 52 | $params = $fixed = array(); |
| 53 | - $config = $this->container->get( 'aimeos_config' ); |
|
| 53 | + $config = $this->container->get('aimeos_config'); |
|
| 54 | 54 | |
| 55 | - if( $locale !== null ) |
|
| 55 | + if ($locale !== null) |
|
| 56 | 56 | { |
| 57 | 57 | $params = $attr + (array) $request->getParsedBody() + (array) $request->getQueryParams(); |
| 58 | - $fixed = $this->getFixedParams( $attr ); |
|
| 58 | + $fixed = $this->getFixedParams($attr); |
|
| 59 | 59 | |
| 60 | - $i18n = $this->container->get( 'aimeos_i18n' )->get( array( $locale ) ); |
|
| 60 | + $i18n = $this->container->get('aimeos_i18n')->get(array($locale)); |
|
| 61 | 61 | $translation = $i18n[$locale]; |
| 62 | 62 | } |
| 63 | 63 | else |
| 64 | 64 | { |
| 65 | - $translation = new \Aimeos\MW\Translation\None( 'en' ); |
|
| 65 | + $translation = new \Aimeos\MW\Translation\None('en'); |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | |
| 69 | - $view = new \Aimeos\MW\View\Standard( $templatePaths ); |
|
| 69 | + $view = new \Aimeos\MW\View\Standard($templatePaths); |
|
| 70 | 70 | |
| 71 | - $helper = new \Aimeos\MW\View\Helper\Translate\Standard( $view, $translation ); |
|
| 72 | - $view->addHelper( 'translate', $helper ); |
|
| 71 | + $helper = new \Aimeos\MW\View\Helper\Translate\Standard($view, $translation); |
|
| 72 | + $view->addHelper('translate', $helper); |
|
| 73 | 73 | |
| 74 | - $helper = new \Aimeos\MW\View\Helper\Url\Slim( $view, $this->container->get( 'router' ), $fixed ); |
|
| 75 | - $view->addHelper( 'url', $helper ); |
|
| 74 | + $helper = new \Aimeos\MW\View\Helper\Url\Slim($view, $this->container->get('router'), $fixed); |
|
| 75 | + $view->addHelper('url', $helper); |
|
| 76 | 76 | |
| 77 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $params ); |
|
| 78 | - $view->addHelper( 'param', $helper ); |
|
| 77 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $params); |
|
| 78 | + $view->addHelper('param', $helper); |
|
| 79 | 79 | |
| 80 | - $helper = new \Aimeos\MW\View\Helper\Config\Standard( $view, $config ); |
|
| 81 | - $view->addHelper( 'config', $helper ); |
|
| 80 | + $helper = new \Aimeos\MW\View\Helper\Config\Standard($view, $config); |
|
| 81 | + $view->addHelper('config', $helper); |
|
| 82 | 82 | |
| 83 | - $sepDec = $config->get( 'client/html/common/format/seperatorDecimal', '.' ); |
|
| 84 | - $sep1000 = $config->get( 'client/html/common/format/seperator1000', ' ' ); |
|
| 85 | - $helper = new \Aimeos\MW\View\Helper\Number\Standard( $view, $sepDec, $sep1000 ); |
|
| 86 | - $view->addHelper( 'number', $helper ); |
|
| 83 | + $sepDec = $config->get('client/html/common/format/seperatorDecimal', '.'); |
|
| 84 | + $sep1000 = $config->get('client/html/common/format/seperator1000', ' '); |
|
| 85 | + $helper = new \Aimeos\MW\View\Helper\Number\Standard($view, $sepDec, $sep1000); |
|
| 86 | + $view->addHelper('number', $helper); |
|
| 87 | 87 | |
| 88 | - $helper = new \Aimeos\MW\View\Helper\Request\Slim( $view, $request ); |
|
| 89 | - $view->addHelper( 'request', $helper ); |
|
| 88 | + $helper = new \Aimeos\MW\View\Helper\Request\Slim($view, $request); |
|
| 89 | + $view->addHelper('request', $helper); |
|
| 90 | 90 | |
| 91 | - $helper = new \Aimeos\MW\View\Helper\Response\Slim( $view, $response ); |
|
| 92 | - $view->addHelper( 'response', $helper ); |
|
| 91 | + $helper = new \Aimeos\MW\View\Helper\Response\Slim($view, $response); |
|
| 92 | + $view->addHelper('response', $helper); |
|
| 93 | 93 | |
| 94 | - $csrf = $request->getAttribute( 'csrf_name' ); |
|
| 95 | - $helper = new \Aimeos\MW\View\Helper\Csrf\Standard( $view, $csrf, $request->getAttribute( 'csrf_value ') ); |
|
| 96 | - $view->addHelper( 'csrf', $helper ); |
|
| 94 | + $csrf = $request->getAttribute('csrf_name'); |
|
| 95 | + $helper = new \Aimeos\MW\View\Helper\Csrf\Standard($view, $csrf, $request->getAttribute('csrf_value ')); |
|
| 96 | + $view->addHelper('csrf', $helper); |
|
| 97 | 97 | |
| 98 | 98 | return $view; |
| 99 | 99 | } |
@@ -105,19 +105,19 @@ discard block |
||
| 105 | 105 | * @param array $attributes Associative list of route attributes |
| 106 | 106 | * @return array Associative list of parameters with "site", "locale" and "currency" if available |
| 107 | 107 | */ |
| 108 | - protected function getFixedParams( array $attributes ) |
|
| 108 | + protected function getFixedParams(array $attributes) |
|
| 109 | 109 | { |
| 110 | 110 | $fixed = array(); |
| 111 | 111 | |
| 112 | - if( isset( $attributes['site'] ) ) { |
|
| 112 | + if (isset($attributes['site'])) { |
|
| 113 | 113 | $fixed['site'] = $attributes['site']; |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | - if( isset( $attributes['locale'] ) ) { |
|
| 116 | + if (isset($attributes['locale'])) { |
|
| 117 | 117 | $fixed['locale'] = $attributes['locale']; |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | - if( isset( $attributes['currency'] ) ) { |
|
| 120 | + if (isset($attributes['currency'])) { |
|
| 121 | 121 | $fixed['currency'] = $attributes['currency']; |
| 122 | 122 | } |
| 123 | 123 | |
@@ -59,8 +59,7 @@ |
||
| 59 | 59 | |
| 60 | 60 | $i18n = $this->container->get( 'aimeos_i18n' )->get( array( $locale ) ); |
| 61 | 61 | $translation = $i18n[$locale]; |
| 62 | - } |
|
| 63 | - else |
|
| 62 | + } else |
|
| 64 | 63 | { |
| 65 | 64 | $translation = new \Aimeos\MW\Translation\None( 'en' ); |
| 66 | 65 | } |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | * @param \Slim\App $app Slim application |
| 28 | 28 | * @param array $settings Multi-dimensional array of configuration settings |
| 29 | 29 | */ |
| 30 | - public function __construct( \Slim\App $app, array $settings ) |
|
| 30 | + public function __construct(\Slim\App $app, array $settings) |
|
| 31 | 31 | { |
| 32 | 32 | $this->app = $app; |
| 33 | 33 | $this->settings = $settings; |
@@ -40,16 +40,16 @@ discard block |
||
| 40 | 40 | * @param string $path Absolute or relative path to the Aimeos route file |
| 41 | 41 | * @return \Aimeos\Slim\Bootstrap Self instance |
| 42 | 42 | */ |
| 43 | - public function routes( $path ) |
|
| 43 | + public function routes($path) |
|
| 44 | 44 | { |
| 45 | 45 | $app = $this->app; |
| 46 | 46 | $settings = $this->settings; |
| 47 | 47 | |
| 48 | - $config = function( $key, $default ) use ( $settings ) |
|
| 48 | + $config = function($key, $default) use ($settings) |
|
| 49 | 49 | { |
| 50 | - foreach( explode( '/', trim( $key, '/' ) ) as $part ) |
|
| 50 | + foreach (explode('/', trim($key, '/')) as $part) |
|
| 51 | 51 | { |
| 52 | - if( isset( $settings[$part] ) ) { |
|
| 52 | + if (isset($settings[$part])) { |
|
| 53 | 53 | $settings = $settings[$part]; |
| 54 | 54 | } else { |
| 55 | 55 | return $default; |
@@ -71,46 +71,46 @@ discard block |
||
| 71 | 71 | * @param string $extdir Absolute or relative path to the Aimeos extension directory |
| 72 | 72 | * @return \Aimeos\Slim\Bootstrap Self instance |
| 73 | 73 | */ |
| 74 | - public function setup( $extdir = '../ext' ) |
|
| 74 | + public function setup($extdir = '../ext') |
|
| 75 | 75 | { |
| 76 | 76 | $settings = $this->settings; |
| 77 | 77 | $container = $this->app->getContainer(); |
| 78 | 78 | |
| 79 | - $container['aimeos'] = function( $c ) use ( $extdir ) { |
|
| 80 | - return new \Aimeos\Bootstrap( (array) $extdir, false ); |
|
| 79 | + $container['aimeos'] = function($c) use ($extdir) { |
|
| 80 | + return new \Aimeos\Bootstrap((array) $extdir, false); |
|
| 81 | 81 | }; |
| 82 | 82 | |
| 83 | - $container['aimeos_context'] = function( $c ) { |
|
| 84 | - return new \Aimeos\Slim\Base\Context( $c ); |
|
| 83 | + $container['aimeos_context'] = function($c) { |
|
| 84 | + return new \Aimeos\Slim\Base\Context($c); |
|
| 85 | 85 | }; |
| 86 | 86 | |
| 87 | - $container['aimeos_i18n'] = function( $c ) { |
|
| 88 | - return new \Aimeos\Slim\Base\I18n( $c ); |
|
| 87 | + $container['aimeos_i18n'] = function($c) { |
|
| 88 | + return new \Aimeos\Slim\Base\I18n($c); |
|
| 89 | 89 | }; |
| 90 | 90 | |
| 91 | - $container['aimeos_page'] = function( $c ) { |
|
| 92 | - return new \Aimeos\Slim\Base\Page( $c ); |
|
| 91 | + $container['aimeos_page'] = function($c) { |
|
| 92 | + return new \Aimeos\Slim\Base\Page($c); |
|
| 93 | 93 | }; |
| 94 | 94 | |
| 95 | - $container['aimeos_view'] = function( $c ) { |
|
| 96 | - return new \Aimeos\Slim\Base\View( $c ); |
|
| 95 | + $container['aimeos_view'] = function($c) { |
|
| 96 | + return new \Aimeos\Slim\Base\View($c); |
|
| 97 | 97 | }; |
| 98 | 98 | |
| 99 | 99 | |
| 100 | - $container['aimeos_config'] = function( $c ) use ( $settings ) { |
|
| 100 | + $container['aimeos_config'] = function($c) use ($settings) { |
|
| 101 | 101 | |
| 102 | - $config = new \Aimeos\MW\Config\PHPArray( $settings, $c['aimeos']->getConfigPaths() ); |
|
| 102 | + $config = new \Aimeos\MW\Config\PHPArray($settings, $c['aimeos']->getConfigPaths()); |
|
| 103 | 103 | |
| 104 | - if( function_exists( 'apc_store' ) === true && $config->get( 'apc_enabled', false ) == true ) { |
|
| 105 | - $config = new \Aimeos\MW\Config\Decorator\APC( $config, $config->get( 'apc_prefix', 'slim:' ) ); |
|
| 104 | + if (function_exists('apc_store') === true && $config->get('apc_enabled', false) == true) { |
|
| 105 | + $config = new \Aimeos\MW\Config\Decorator\APC($config, $config->get('apc_prefix', 'slim:')); |
|
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | return $config; |
| 109 | 109 | }; |
| 110 | 110 | |
| 111 | 111 | |
| 112 | - $container['mailer'] = function( $c ) { |
|
| 113 | - return \Swift_Mailer::newInstance( \Swift_SendmailTransport::newInstance() ); |
|
| 112 | + $container['mailer'] = function($c) { |
|
| 113 | + return \Swift_Mailer::newInstance(\Swift_SendmailTransport::newInstance()); |
|
| 114 | 114 | }; |
| 115 | 115 | |
| 116 | 116 | return $this; |
@@ -124,14 +124,14 @@ discard block |
||
| 124 | 124 | */ |
| 125 | 125 | public static function getVersion() |
| 126 | 126 | { |
| 127 | - $basedir = dirname( dirname( dirname( dirname( __DIR__ ) ) ) ) . DIRECTORY_SEPARATOR; |
|
| 127 | + $basedir = dirname(dirname(dirname(dirname(__DIR__)))) . DIRECTORY_SEPARATOR; |
|
| 128 | 128 | |
| 129 | - if( ( $content = @file_get_contents( $basedir . 'composer.lock' ) ) !== false |
|
| 130 | - && ( $content = json_decode( $content, true ) ) !== null && isset( $content['packages'] ) |
|
| 129 | + if (($content = @file_get_contents($basedir . 'composer.lock')) !== false |
|
| 130 | + && ($content = json_decode($content, true)) !== null && isset($content['packages']) |
|
| 131 | 131 | ) { |
| 132 | - foreach( (array) $content['packages'] as $item ) |
|
| 132 | + foreach ((array) $content['packages'] as $item) |
|
| 133 | 133 | { |
| 134 | - if( $item['name'] === 'aimeos/aimeos-slim' ) { |
|
| 134 | + if ($item['name'] === 'aimeos/aimeos-slim') { |
|
| 135 | 135 | return $item['version']; |
| 136 | 136 | } |
| 137 | 137 | } |
@@ -1,144 +1,144 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | |
| 4 | -$app->group( '/', function() { |
|
| 4 | +$app->group('/', function() { |
|
| 5 | 5 | |
| 6 | - $this->map(['GET'], 'extadm', function( $request, $response, $args ) { |
|
| 7 | - return \Aimeos\Slim\Controller\Extadm::indexAction( $this, $request, $response, $args ); |
|
| 8 | - })->setName( 'aimeos_shop_extadm' ); |
|
| 6 | + $this->map(['GET'], 'extadm', function($request, $response, $args) { |
|
| 7 | + return \Aimeos\Slim\Controller\Extadm::indexAction($this, $request, $response, $args); |
|
| 8 | + })->setName('aimeos_shop_extadm'); |
|
| 9 | 9 | |
| 10 | - $this->map(['GET'], 'extadm/file', function( $request, $response, $args ) { |
|
| 11 | - return \Aimeos\Slim\Controller\Extadm::fileAction( $this, $request, $response, $args ); |
|
| 12 | - })->setName( 'aimeos_shop_extadm_file' ); |
|
| 10 | + $this->map(['GET'], 'extadm/file', function($request, $response, $args) { |
|
| 11 | + return \Aimeos\Slim\Controller\Extadm::fileAction($this, $request, $response, $args); |
|
| 12 | + })->setName('aimeos_shop_extadm_file'); |
|
| 13 | 13 | |
| 14 | - $this->map(['POST'], 'extadm/do', function( $request, $response, $args ) { |
|
| 15 | - return \Aimeos\Slim\Controller\Extadm::doAction( $this, $request, $response, $args ); |
|
| 16 | - })->setName( 'aimeos_shop_extadm_json' ); |
|
| 14 | + $this->map(['POST'], 'extadm/do', function($request, $response, $args) { |
|
| 15 | + return \Aimeos\Slim\Controller\Extadm::doAction($this, $request, $response, $args); |
|
| 16 | + })->setName('aimeos_shop_extadm_json'); |
|
| 17 | 17 | |
| 18 | 18 | |
| 19 | - $this->map(['GET', 'POST'], 'jqadm/copy/{resource:[^0-9]+}/{id:[0-9]+}', function( $request, $response, $args ) { |
|
| 20 | - return \Aimeos\Slim\Controller\Jqadm::copyAction( $this, $request, $response, $args ); |
|
| 21 | - })->setName( 'aimeos_shop_jqadm_copy' ); |
|
| 19 | + $this->map(['GET', 'POST'], 'jqadm/copy/{resource:[^0-9]+}/{id:[0-9]+}', function($request, $response, $args) { |
|
| 20 | + return \Aimeos\Slim\Controller\Jqadm::copyAction($this, $request, $response, $args); |
|
| 21 | + })->setName('aimeos_shop_jqadm_copy'); |
|
| 22 | 22 | |
| 23 | - $this->map(['GET', 'POST'], 'jqadm/create/{resource:[^0-9]+}', function( $request, $response, $args ) { |
|
| 24 | - return \Aimeos\Slim\Controller\Jqadm::createAction( $this, $request, $response, $args ); |
|
| 25 | - })->setName( 'aimeos_shop_jqadm_create' ); |
|
| 23 | + $this->map(['GET', 'POST'], 'jqadm/create/{resource:[^0-9]+}', function($request, $response, $args) { |
|
| 24 | + return \Aimeos\Slim\Controller\Jqadm::createAction($this, $request, $response, $args); |
|
| 25 | + })->setName('aimeos_shop_jqadm_create'); |
|
| 26 | 26 | |
| 27 | - $this->map(['GET', 'POST'], 'jqadm/delete/{resource:[^0-9]+}/{id:[0-9]+}', function( $request, $response, $args ) { |
|
| 28 | - return \Aimeos\Slim\Controller\Jqadm::deleteAction( $this, $request, $response, $args ); |
|
| 29 | - })->setName( 'aimeos_shop_jqadm_delete' ); |
|
| 27 | + $this->map(['GET', 'POST'], 'jqadm/delete/{resource:[^0-9]+}/{id:[0-9]+}', function($request, $response, $args) { |
|
| 28 | + return \Aimeos\Slim\Controller\Jqadm::deleteAction($this, $request, $response, $args); |
|
| 29 | + })->setName('aimeos_shop_jqadm_delete'); |
|
| 30 | 30 | |
| 31 | - $this->map(['GET'], 'jqadm/get/{resource:[^0-9]+}/{id:[0-9]+}', function( $request, $response, $args ) { |
|
| 32 | - return \Aimeos\Slim\Controller\Jqadm::getAction( $this, $request, $response, $args ); |
|
| 33 | - })->setName( 'aimeos_shop_jqadm_get' ); |
|
| 31 | + $this->map(['GET'], 'jqadm/get/{resource:[^0-9]+}/{id:[0-9]+}', function($request, $response, $args) { |
|
| 32 | + return \Aimeos\Slim\Controller\Jqadm::getAction($this, $request, $response, $args); |
|
| 33 | + })->setName('aimeos_shop_jqadm_get'); |
|
| 34 | 34 | |
| 35 | - $this->map(['POST'], 'jqadm/save/{resource:[^0-9]+}[/{id:[0-9]+}]', function( $request, $response, $args ) { |
|
| 36 | - return \Aimeos\Slim\Controller\Jqadm::saveAction( $this, $request, $response, $args ); |
|
| 37 | - })->setName( 'aimeos_shop_jqadm_save' ); |
|
| 35 | + $this->map(['POST'], 'jqadm/save/{resource:[^0-9]+}[/{id:[0-9]+}]', function($request, $response, $args) { |
|
| 36 | + return \Aimeos\Slim\Controller\Jqadm::saveAction($this, $request, $response, $args); |
|
| 37 | + })->setName('aimeos_shop_jqadm_save'); |
|
| 38 | 38 | |
| 39 | - $this->map(['GET', 'POST'], 'jqadm/search/{resource:[^0-9]+}', function( $request, $response, $args ) { |
|
| 40 | - return \Aimeos\Slim\Controller\Jqadm::createAction( $this, $request, $response, $args ); |
|
| 41 | - })->setName( 'aimeos_shop_jqadm_search' ); |
|
| 39 | + $this->map(['GET', 'POST'], 'jqadm/search/{resource:[^0-9]+}', function($request, $response, $args) { |
|
| 40 | + return \Aimeos\Slim\Controller\Jqadm::createAction($this, $request, $response, $args); |
|
| 41 | + })->setName('aimeos_shop_jqadm_search'); |
|
| 42 | 42 | |
| 43 | 43 | |
| 44 | - $this->map(['DELETE'], 'jsonadm/{resource:[^0-9]+}[/{id:[0-9]+}]', function( $request, $response, $args ) { |
|
| 45 | - return \Aimeos\Slim\Controller\Jsonadm::deleteAction( $this, $request, $response, $args ); |
|
| 46 | - })->setName( 'aimeos_shop_jsonadm_delete' ); |
|
| 44 | + $this->map(['DELETE'], 'jsonadm/{resource:[^0-9]+}[/{id:[0-9]+}]', function($request, $response, $args) { |
|
| 45 | + return \Aimeos\Slim\Controller\Jsonadm::deleteAction($this, $request, $response, $args); |
|
| 46 | + })->setName('aimeos_shop_jsonadm_delete'); |
|
| 47 | 47 | |
| 48 | - $this->map(['GET'], 'jsonadm/{resource:[^0-9]+}[/{id:[0-9]+}]', function( $request, $response, $args ) { |
|
| 49 | - return \Aimeos\Slim\Controller\Jsonadm::getAction( $this, $request, $response, $args ); |
|
| 50 | - })->setName( 'aimeos_shop_jsonadm_get' ); |
|
| 48 | + $this->map(['GET'], 'jsonadm/{resource:[^0-9]+}[/{id:[0-9]+}]', function($request, $response, $args) { |
|
| 49 | + return \Aimeos\Slim\Controller\Jsonadm::getAction($this, $request, $response, $args); |
|
| 50 | + })->setName('aimeos_shop_jsonadm_get'); |
|
| 51 | 51 | |
| 52 | - $this->map(['PATCH'], 'jsonadm/{resource:[^0-9]+}[/{id:[0-9]+}]', function( $request, $response, $args ) { |
|
| 53 | - return \Aimeos\Slim\Controller\Jsonadm::patchAction( $this, $request, $response, $args ); |
|
| 54 | - })->setName( 'aimeos_shop_jsonadm_patch' ); |
|
| 52 | + $this->map(['PATCH'], 'jsonadm/{resource:[^0-9]+}[/{id:[0-9]+}]', function($request, $response, $args) { |
|
| 53 | + return \Aimeos\Slim\Controller\Jsonadm::patchAction($this, $request, $response, $args); |
|
| 54 | + })->setName('aimeos_shop_jsonadm_patch'); |
|
| 55 | 55 | |
| 56 | - $this->map(['POST'], 'jsonadm/{resource:[^0-9]+}[/{id:[0-9]+}]', function( $request, $response, $args ) { |
|
| 57 | - return \Aimeos\Slim\Controller\Jsonadm::postAction( $this, $request, $response, $args ); |
|
| 58 | - })->setName( 'aimeos_shop_jsonadm_post' ); |
|
| 56 | + $this->map(['POST'], 'jsonadm/{resource:[^0-9]+}[/{id:[0-9]+}]', function($request, $response, $args) { |
|
| 57 | + return \Aimeos\Slim\Controller\Jsonadm::postAction($this, $request, $response, $args); |
|
| 58 | + })->setName('aimeos_shop_jsonadm_post'); |
|
| 59 | 59 | |
| 60 | - $this->map(['PUT'], 'jsonadm/{resource:[^0-9]+}[/{id:[0-9]+}]', function( $request, $response, $args ) { |
|
| 61 | - return \Aimeos\Slim\Controller\Jsonadm::putAction( $this, $request, $response, $args ); |
|
| 62 | - })->setName( 'aimeos_shop_jsonadm_put' ); |
|
| 60 | + $this->map(['PUT'], 'jsonadm/{resource:[^0-9]+}[/{id:[0-9]+}]', function($request, $response, $args) { |
|
| 61 | + return \Aimeos\Slim\Controller\Jsonadm::putAction($this, $request, $response, $args); |
|
| 62 | + })->setName('aimeos_shop_jsonadm_put'); |
|
| 63 | 63 | |
| 64 | - $this->map(['OPTIONS'], 'jsonadm[/{resource}]', function( $request, $response, $args ) { |
|
| 65 | - return \Aimeos\Slim\Controller\Jsonadm::optionsAction( $this, $request, $response, $args ); |
|
| 66 | - })->setName( 'aimeos_shop_jsonadm_options' ); |
|
| 64 | + $this->map(['OPTIONS'], 'jsonadm[/{resource}]', function($request, $response, $args) { |
|
| 65 | + return \Aimeos\Slim\Controller\Jsonadm::optionsAction($this, $request, $response, $args); |
|
| 66 | + })->setName('aimeos_shop_jsonadm_options'); |
|
| 67 | 67 | |
| 68 | 68 | }); |
| 69 | 69 | |
| 70 | 70 | |
| 71 | -$app->group( $config( 'routes/account', '/' ), function() { |
|
| 71 | +$app->group($config('routes/account', '/'), function() { |
|
| 72 | 72 | |
| 73 | - $this->map(['GET', 'POST'], 'myaccount', function( $request, $response, $args ) { |
|
| 74 | - return \Aimeos\Slim\Controller\Account::indexAction( $this, $request, $response, $args ); |
|
| 75 | - })->setName( 'aimeos_shop_account' ); |
|
| 73 | + $this->map(['GET', 'POST'], 'myaccount', function($request, $response, $args) { |
|
| 74 | + return \Aimeos\Slim\Controller\Account::indexAction($this, $request, $response, $args); |
|
| 75 | + })->setName('aimeos_shop_account'); |
|
| 76 | 76 | |
| 77 | - $this->map(['GET', 'POST'], 'myaccount/favorite', function( $request, $response, $args ) { |
|
| 78 | - return \Aimeos\Slim\Controller\Account::indexAction( $this, $request, $response, $args ); |
|
| 79 | - })->setName( 'aimeos_shop_account_favorite' ); |
|
| 77 | + $this->map(['GET', 'POST'], 'myaccount/favorite', function($request, $response, $args) { |
|
| 78 | + return \Aimeos\Slim\Controller\Account::indexAction($this, $request, $response, $args); |
|
| 79 | + })->setName('aimeos_shop_account_favorite'); |
|
| 80 | 80 | |
| 81 | - $this->map(['GET', 'POST'], 'myaccount/watch', function( $request, $response, $args ) { |
|
| 82 | - return \Aimeos\Slim\Controller\Account::indexAction( $this, $request, $response, $args ); |
|
| 83 | - })->setName( 'aimeos_shop_account_watch' ); |
|
| 81 | + $this->map(['GET', 'POST'], 'myaccount/watch', function($request, $response, $args) { |
|
| 82 | + return \Aimeos\Slim\Controller\Account::indexAction($this, $request, $response, $args); |
|
| 83 | + })->setName('aimeos_shop_account_watch'); |
|
| 84 | 84 | |
| 85 | - $this->map(['GET', 'POST'], 'myaccount/download/{dl_id}', function( $request, $response, $args ) { |
|
| 86 | - return \Aimeos\Slim\Controller\Account::downloadAction( $this, $request, $response, $args ); |
|
| 87 | - })->setName( 'aimeos_shop_account_download' ); |
|
| 85 | + $this->map(['GET', 'POST'], 'myaccount/download/{dl_id}', function($request, $response, $args) { |
|
| 86 | + return \Aimeos\Slim\Controller\Account::downloadAction($this, $request, $response, $args); |
|
| 87 | + })->setName('aimeos_shop_account_download'); |
|
| 88 | 88 | |
| 89 | 89 | }); |
| 90 | 90 | |
| 91 | 91 | |
| 92 | -$app->group( $config( 'routes/default', '/' ), function() { |
|
| 92 | +$app->group($config('routes/default', '/'), function() { |
|
| 93 | 93 | |
| 94 | - $this->map(['GET', 'POST'], 'count', function( $request, $response, $args ) { |
|
| 95 | - return \Aimeos\Slim\Controller\Catalog::countAction( $this, $request, $response, $args ); |
|
| 96 | - })->setName( 'aimeos_shop_count' ); |
|
| 94 | + $this->map(['GET', 'POST'], 'count', function($request, $response, $args) { |
|
| 95 | + return \Aimeos\Slim\Controller\Catalog::countAction($this, $request, $response, $args); |
|
| 96 | + })->setName('aimeos_shop_count'); |
|
| 97 | 97 | |
| 98 | - $this->map(['GET', 'POST'], 'detail/{d_prodid:[0-9]+}[/{d_name}]', function( $request, $response, $args ) { |
|
| 99 | - return \Aimeos\Slim\Controller\Catalog::detailAction( $this, $request, $response, $args ); |
|
| 100 | - })->setName( 'aimeos_shop_detail' ); |
|
| 98 | + $this->map(['GET', 'POST'], 'detail/{d_prodid:[0-9]+}[/{d_name}]', function($request, $response, $args) { |
|
| 99 | + return \Aimeos\Slim\Controller\Catalog::detailAction($this, $request, $response, $args); |
|
| 100 | + })->setName('aimeos_shop_detail'); |
|
| 101 | 101 | |
| 102 | - $this->map(['GET', 'POST'], 'detail/pin', function( $request, $response, $args ) { |
|
| 103 | - return \Aimeos\Slim\Controller\Catalog::detailAction( $this, $request, $response, $args ); |
|
| 104 | - })->setName( 'aimeos_shop_session_pinned' ); |
|
| 102 | + $this->map(['GET', 'POST'], 'detail/pin', function($request, $response, $args) { |
|
| 103 | + return \Aimeos\Slim\Controller\Catalog::detailAction($this, $request, $response, $args); |
|
| 104 | + })->setName('aimeos_shop_session_pinned'); |
|
| 105 | 105 | |
| 106 | - $this->map(['GET', 'POST'], 'list', function( $request, $response, $args ) { |
|
| 107 | - return \Aimeos\Slim\Controller\Catalog::listAction( $this, $request, $response, $args ); |
|
| 108 | - })->setName( 'aimeos_shop_list' ); |
|
| 106 | + $this->map(['GET', 'POST'], 'list', function($request, $response, $args) { |
|
| 107 | + return \Aimeos\Slim\Controller\Catalog::listAction($this, $request, $response, $args); |
|
| 108 | + })->setName('aimeos_shop_list'); |
|
| 109 | 109 | |
| 110 | - $this->map(['GET', 'POST'], 'suggest', function( $request, $response, $args ) { |
|
| 111 | - return \Aimeos\Slim\Controller\Catalog::suggestAction( $this, $request, $response, $args ); |
|
| 112 | - })->setName( 'aimeos_shop_suggest' ); |
|
| 110 | + $this->map(['GET', 'POST'], 'suggest', function($request, $response, $args) { |
|
| 111 | + return \Aimeos\Slim\Controller\Catalog::suggestAction($this, $request, $response, $args); |
|
| 112 | + })->setName('aimeos_shop_suggest'); |
|
| 113 | 113 | |
| 114 | - $this->map(['GET', 'POST'], 'stock', function( $request, $response, $args ) { |
|
| 115 | - return \Aimeos\Slim\Controller\Catalog::stockAction( $this, $request, $response, $args ); |
|
| 116 | - })->setName( 'aimeos_shop_stock' ); |
|
| 114 | + $this->map(['GET', 'POST'], 'stock', function($request, $response, $args) { |
|
| 115 | + return \Aimeos\Slim\Controller\Catalog::stockAction($this, $request, $response, $args); |
|
| 116 | + })->setName('aimeos_shop_stock'); |
|
| 117 | 117 | |
| 118 | - $this->map(['GET', 'POST'], 'basket', function( $request, $response, $args ) { |
|
| 119 | - return \Aimeos\Slim\Controller\Basket::indexAction( $this, $request, $response, $args ); |
|
| 120 | - })->setName( 'aimeos_shop_basket' ); |
|
| 118 | + $this->map(['GET', 'POST'], 'basket', function($request, $response, $args) { |
|
| 119 | + return \Aimeos\Slim\Controller\Basket::indexAction($this, $request, $response, $args); |
|
| 120 | + })->setName('aimeos_shop_basket'); |
|
| 121 | 121 | |
| 122 | - $this->map(['GET', 'POST'], 'checkout[/{c_step}]', function( $request, $response, $args ) { |
|
| 123 | - return \Aimeos\Slim\Controller\Checkout::indexAction( $this, $request, $response, $args ); |
|
| 124 | - })->setName( 'aimeos_shop_checkout' ); |
|
| 122 | + $this->map(['GET', 'POST'], 'checkout[/{c_step}]', function($request, $response, $args) { |
|
| 123 | + return \Aimeos\Slim\Controller\Checkout::indexAction($this, $request, $response, $args); |
|
| 124 | + })->setName('aimeos_shop_checkout'); |
|
| 125 | 125 | |
| 126 | 126 | }); |
| 127 | 127 | |
| 128 | 128 | |
| 129 | -$app->group( $config( 'routes/confirm', '/' ), function() { |
|
| 129 | +$app->group($config('routes/confirm', '/'), function() { |
|
| 130 | 130 | |
| 131 | - $this->map(['GET', 'POST'], 'confirm', function( $request, $response, $args ) { |
|
| 132 | - return \Aimeos\Slim\Controller\Checkout::confirmAction( $this, $request, $response, $args ); |
|
| 133 | - })->setName( 'aimeos_shop_confirm' ); |
|
| 131 | + $this->map(['GET', 'POST'], 'confirm', function($request, $response, $args) { |
|
| 132 | + return \Aimeos\Slim\Controller\Checkout::confirmAction($this, $request, $response, $args); |
|
| 133 | + })->setName('aimeos_shop_confirm'); |
|
| 134 | 134 | |
| 135 | 135 | }); |
| 136 | 136 | |
| 137 | 137 | |
| 138 | -$app->group( $config( 'routes/update', '/' ), function() { |
|
| 138 | +$app->group($config('routes/update', '/'), function() { |
|
| 139 | 139 | |
| 140 | - $this->map(['GET', 'POST'], 'update', function( $request, $response, $args ) { |
|
| 141 | - return \Aimeos\Slim\Controller\Checkout::updateAction( $this, $request, $response, $args ); |
|
| 142 | - })->setName( 'aimeos_shop_update' ); |
|
| 140 | + $this->map(['GET', 'POST'], 'update', function($request, $response, $args) { |
|
| 141 | + return \Aimeos\Slim\Controller\Checkout::updateAction($this, $request, $response, $args); |
|
| 142 | + })->setName('aimeos_shop_update'); |
|
| 143 | 143 | |
| 144 | 144 | }); |
@@ -6,16 +6,16 @@ discard block |
||
| 6 | 6 | 'uploaddir' => '/', |
| 7 | 7 | |
| 8 | 8 | 'page' => array( |
| 9 | - 'account-index' => array( 'account/history','account/favorite','account/watch','basket/mini','catalog/session' ), |
|
| 10 | - 'basket-index' => array( 'basket/standard','basket/related' ), |
|
| 11 | - 'catalog-count' => array( 'catalog/count' ), |
|
| 12 | - 'catalog-detail' => array( 'basket/mini','catalog/stage','catalog/detail','catalog/session' ), |
|
| 13 | - 'catalog-list' => array( 'basket/mini','catalog/filter','catalog/stage','catalog/lists' ), |
|
| 14 | - 'catalog-stock' => array( 'catalog/stock' ), |
|
| 15 | - 'catalog-suggest' => array( 'catalog/suggest' ), |
|
| 16 | - 'checkout-confirm' => array( 'checkout/confirm' ), |
|
| 17 | - 'checkout-index' => array( 'checkout/standard' ), |
|
| 18 | - 'checkout-update' => array( 'checkout/update'), |
|
| 9 | + 'account-index' => array('account/history', 'account/favorite', 'account/watch', 'basket/mini', 'catalog/session'), |
|
| 10 | + 'basket-index' => array('basket/standard', 'basket/related'), |
|
| 11 | + 'catalog-count' => array('catalog/count'), |
|
| 12 | + 'catalog-detail' => array('basket/mini', 'catalog/stage', 'catalog/detail', 'catalog/session'), |
|
| 13 | + 'catalog-list' => array('basket/mini', 'catalog/filter', 'catalog/stage', 'catalog/lists'), |
|
| 14 | + 'catalog-stock' => array('catalog/stock'), |
|
| 15 | + 'catalog-suggest' => array('catalog/suggest'), |
|
| 16 | + 'checkout-confirm' => array('checkout/confirm'), |
|
| 17 | + 'checkout-index' => array('checkout/standard'), |
|
| 18 | + 'checkout-update' => array('checkout/update'), |
|
| 19 | 19 | ), |
| 20 | 20 | |
| 21 | 21 | 'routes' => array( |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | 'database' => 'slim', |
| 35 | 35 | 'username' => 'root', |
| 36 | 36 | 'password' => '', |
| 37 | - 'stmt' => array( "SET NAMES 'utf8'", "SET SESSION sql_mode='ANSI'" ), |
|
| 37 | + 'stmt' => array("SET NAMES 'utf8'", "SET SESSION sql_mode='ANSI'"), |
|
| 38 | 38 | 'opt-persistent' => 0, |
| 39 | 39 | 'limit' => 2, |
| 40 | 40 | ), |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | * |
| 31 | 31 | * @param ContainerInterface $container Dependency container |
| 32 | 32 | */ |
| 33 | - public function __construct( ContainerInterface $container ) |
|
| 33 | + public function __construct(ContainerInterface $container) |
|
| 34 | 34 | { |
| 35 | 35 | $this->container = $container; |
| 36 | 36 | } |
@@ -43,45 +43,45 @@ discard block |
||
| 43 | 43 | * @param array Associative list of URL parameter |
| 44 | 44 | * @return \Aimeos\MShop\Context\Item\Iface Context object |
| 45 | 45 | */ |
| 46 | - public function get( $locale = true, array $attributes = array() ) |
|
| 46 | + public function get($locale = true, array $attributes = array()) |
|
| 47 | 47 | { |
| 48 | - if( self::$context === null ) |
|
| 48 | + if (self::$context === null) |
|
| 49 | 49 | { |
| 50 | 50 | $context = new \Aimeos\MShop\Context\Item\Standard(); |
| 51 | 51 | |
| 52 | - $config = $this->container->get( 'aimeos_config' ); |
|
| 53 | - $context->setConfig( $config ); |
|
| 52 | + $config = $this->container->get('aimeos_config'); |
|
| 53 | + $context->setConfig($config); |
|
| 54 | 54 | |
| 55 | - $dbm = new \Aimeos\MW\DB\Manager\PDO( $config ); |
|
| 56 | - $context->setDatabaseManager( $dbm ); |
|
| 55 | + $dbm = new \Aimeos\MW\DB\Manager\PDO($config); |
|
| 56 | + $context->setDatabaseManager($dbm); |
|
| 57 | 57 | |
| 58 | - $fs = new \Aimeos\MW\Filesystem\Manager\Standard( $config ); |
|
| 59 | - $context->setFilesystemManager( $fs ); |
|
| 58 | + $fs = new \Aimeos\MW\Filesystem\Manager\Standard($config); |
|
| 59 | + $context->setFilesystemManager($fs); |
|
| 60 | 60 | |
| 61 | - $mail = new \Aimeos\MW\Mail\Swift( $this->container->get( 'mailer' ) ); |
|
| 62 | - $context->setMail( $mail ); |
|
| 61 | + $mail = new \Aimeos\MW\Mail\Swift($this->container->get('mailer')); |
|
| 62 | + $context->setMail($mail); |
|
| 63 | 63 | |
| 64 | - $logger = \Aimeos\MAdmin\Log\Manager\Factory::createManager( $context ); |
|
| 65 | - $context->setLogger( $logger ); |
|
| 64 | + $logger = \Aimeos\MAdmin\Log\Manager\Factory::createManager($context); |
|
| 65 | + $context->setLogger($logger); |
|
| 66 | 66 | |
| 67 | - $cache = new \Aimeos\MAdmin\Cache\Proxy\Standard( $context ); |
|
| 68 | - $context->setCache( $cache ); |
|
| 67 | + $cache = new \Aimeos\MAdmin\Cache\Proxy\Standard($context); |
|
| 68 | + $context->setCache($cache); |
|
| 69 | 69 | |
| 70 | 70 | $session = new \Aimeos\MW\Session\PHP(); |
| 71 | - $context->setSession( $session ); |
|
| 71 | + $context->setSession($session); |
|
| 72 | 72 | |
| 73 | 73 | self::$context = $context; |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | $context = self::$context; |
| 77 | 77 | |
| 78 | - if( $locale === true ) |
|
| 78 | + if ($locale === true) |
|
| 79 | 79 | { |
| 80 | - $localeItem = $this->getLocale( $context, $attributes ); |
|
| 80 | + $localeItem = $this->getLocale($context, $attributes); |
|
| 81 | 81 | $langid = $localeItem->getLanguageId(); |
| 82 | 82 | |
| 83 | - $context->setLocale( $localeItem ); |
|
| 84 | - $context->setI18n( $this->container->get( 'aimeos_i18n' )->get( array( $langid ) ) ); |
|
| 83 | + $context->setLocale($localeItem); |
|
| 84 | + $context->setI18n($this->container->get('aimeos_i18n')->get(array($langid))); |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | return $context; |
@@ -95,18 +95,18 @@ discard block |
||
| 95 | 95 | * @param array Associative list of URL parameter |
| 96 | 96 | * @return \Aimeos\MShop\Locale\Item\Iface Locale item object |
| 97 | 97 | */ |
| 98 | - protected function getLocale( \Aimeos\MShop\Context\Item\Iface $context, array $attr ) |
|
| 98 | + protected function getLocale(\Aimeos\MShop\Context\Item\Iface $context, array $attr) |
|
| 99 | 99 | { |
| 100 | - if( $this->locale === null ) |
|
| 100 | + if ($this->locale === null) |
|
| 101 | 101 | { |
| 102 | - $disableSites = $this->container->get( 'aimeos_config' )->get( 'disableSites', false ); |
|
| 102 | + $disableSites = $this->container->get('aimeos_config')->get('disableSites', false); |
|
| 103 | 103 | |
| 104 | - $site = ( isset( $attr['site'] ) ? $attr['site'] : 'default' ); |
|
| 105 | - $lang = ( isset( $attr['locale'] ) ? $attr['locale'] : '' ); |
|
| 106 | - $currency = ( isset( $attr['currency'] ) ? $attr['currency'] : '' ); |
|
| 104 | + $site = (isset($attr['site']) ? $attr['site'] : 'default'); |
|
| 105 | + $lang = (isset($attr['locale']) ? $attr['locale'] : ''); |
|
| 106 | + $currency = (isset($attr['currency']) ? $attr['currency'] : ''); |
|
| 107 | 107 | |
| 108 | - $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context ); |
|
| 109 | - $this->locale = $localeManager->bootstrap( $site, $lang, $currency, $disableSites ); |
|
| 108 | + $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context); |
|
| 109 | + $this->locale = $localeManager->bootstrap($site, $lang, $currency, $disableSites); |
|
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | return $this->locale; |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | * |
| 31 | 31 | * @param ContainerInterface $container Dependency container |
| 32 | 32 | */ |
| 33 | - public function __construct( ContainerInterface $container ) |
|
| 33 | + public function __construct(ContainerInterface $container) |
|
| 34 | 34 | { |
| 35 | 35 | $this->container = $container; |
| 36 | 36 | } |
@@ -45,24 +45,24 @@ discard block |
||
| 45 | 45 | * @param array Associative list of URI attributes |
| 46 | 46 | * @return array Associative list with body and header output separated by client name |
| 47 | 47 | */ |
| 48 | - public function getSections( $pageName, ServerRequestInterface $request, ResponseInterface $response, array $attr ) |
|
| 48 | + public function getSections($pageName, ServerRequestInterface $request, ResponseInterface $response, array $attr) |
|
| 49 | 49 | { |
| 50 | - $tmplPaths = $this->container->get( 'aimeos' )->getCustomPaths( 'client/html/templates' ); |
|
| 51 | - $context = $this->container->get( 'aimeos_context' )->get( true, $attr ); |
|
| 50 | + $tmplPaths = $this->container->get('aimeos')->getCustomPaths('client/html/templates'); |
|
| 51 | + $context = $this->container->get('aimeos_context')->get(true, $attr); |
|
| 52 | 52 | $langid = $context->getLocale()->getLanguageId(); |
| 53 | 53 | |
| 54 | - $view = $this->container->get( 'aimeos_view' )->create( $request, $response, $attr, $tmplPaths, $langid ); |
|
| 55 | - $context->setView( $view ); |
|
| 54 | + $view = $this->container->get('aimeos_view')->create($request, $response, $attr, $tmplPaths, $langid); |
|
| 55 | + $context->setView($view); |
|
| 56 | 56 | |
| 57 | - $pagesConfig = $this->container->get( 'aimeos_config' )->get( 'page', array() ); |
|
| 58 | - $result = array( 'aibody' => array(), 'aiheader' => array() ); |
|
| 57 | + $pagesConfig = $this->container->get('aimeos_config')->get('page', array()); |
|
| 58 | + $result = array('aibody' => array(), 'aiheader' => array()); |
|
| 59 | 59 | |
| 60 | - if( isset( $pagesConfig[$pageName] ) ) |
|
| 60 | + if (isset($pagesConfig[$pageName])) |
|
| 61 | 61 | { |
| 62 | - foreach( (array) $pagesConfig[$pageName] as $clientName ) |
|
| 62 | + foreach ((array) $pagesConfig[$pageName] as $clientName) |
|
| 63 | 63 | { |
| 64 | - $client = \Aimeos\Client\Html\Factory::createClient( $context, $tmplPaths, $clientName ); |
|
| 65 | - $client->setView( clone $view ); |
|
| 64 | + $client = \Aimeos\Client\Html\Factory::createClient($context, $tmplPaths, $clientName); |
|
| 65 | + $client->setView(clone $view); |
|
| 66 | 66 | $client->process(); |
| 67 | 67 | |
| 68 | 68 | $result['aibody'][$clientName] = $client->getBody(); |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | * |
| 30 | 30 | * @param ContainerInterface $container Dependency container |
| 31 | 31 | */ |
| 32 | - public function __construct( ContainerInterface $container ) |
|
| 32 | + public function __construct(ContainerInterface $container) |
|
| 33 | 33 | { |
| 34 | 34 | $this->container = $container; |
| 35 | 35 | } |
@@ -41,23 +41,23 @@ discard block |
||
| 41 | 41 | * @param array $languageIds List of two letter ISO language IDs |
| 42 | 42 | * @return \Aimeos\MW\Translation\Iface[] List of translation objects |
| 43 | 43 | */ |
| 44 | - public function get( array $languageIds ) |
|
| 44 | + public function get(array $languageIds) |
|
| 45 | 45 | { |
| 46 | - $config = $this->container->get( 'aimeos_config' ); |
|
| 47 | - $i18nPaths = $this->container->get( 'aimeos' )->getI18nPaths(); |
|
| 46 | + $config = $this->container->get('aimeos_config'); |
|
| 47 | + $i18nPaths = $this->container->get('aimeos')->getI18nPaths(); |
|
| 48 | 48 | |
| 49 | - foreach( $languageIds as $langid ) |
|
| 49 | + foreach ($languageIds as $langid) |
|
| 50 | 50 | { |
| 51 | - if( !isset( $this->i18n[$langid] ) ) |
|
| 51 | + if (!isset($this->i18n[$langid])) |
|
| 52 | 52 | { |
| 53 | - $i18n = new \Aimeos\MW\Translation\Gettext( $i18nPaths, $langid ); |
|
| 53 | + $i18n = new \Aimeos\MW\Translation\Gettext($i18nPaths, $langid); |
|
| 54 | 54 | |
| 55 | - if( function_exists( 'apc_store' ) === true && $config->get( 'apc_enabled', false ) == true ) { |
|
| 56 | - $i18n = new \Aimeos\MW\Translation\Decorator\APC( $i18n, $config->get( 'apc_prefix', 'slim:' ) ); |
|
| 55 | + if (function_exists('apc_store') === true && $config->get('apc_enabled', false) == true) { |
|
| 56 | + $i18n = new \Aimeos\MW\Translation\Decorator\APC($i18n, $config->get('apc_prefix', 'slim:')); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | - if( ( $cfg = $config->get( 'i18n/' . $langid, array() ) ) !== array() ) { |
|
| 60 | - $i18n = new \Aimeos\MW\Translation\Decorator\Memory( $i18n, $cfg ); |
|
| 59 | + if (($cfg = $config->get('i18n/' . $langid, array())) !== array()) { |
|
| 60 | + $i18n = new \Aimeos\MW\Translation\Decorator\Memory($i18n, $cfg); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | $this->i18n[$langid] = $i18n; |
@@ -30,10 +30,10 @@ discard block |
||
| 30 | 30 | * @param ResponseInterface $response Response object |
| 31 | 31 | * @return ResponseInterface $response Modified response object with generated output |
| 32 | 32 | */ |
| 33 | - public static function confirmAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args ) |
|
| 33 | + public static function confirmAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args) |
|
| 34 | 34 | { |
| 35 | - $contents = $container->get( 'aimeos_page' )->getSections( 'checkout-confirm', $request, $response, $args ); |
|
| 36 | - return $container->get( 'view' )->render( $response, 'Checkout/confirm.html.twig', $contents ); |
|
| 35 | + $contents = $container->get('aimeos_page')->getSections('checkout-confirm', $request, $response, $args); |
|
| 36 | + return $container->get('view')->render($response, 'Checkout/confirm.html.twig', $contents); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | |
@@ -45,10 +45,10 @@ discard block |
||
| 45 | 45 | * @param ResponseInterface $response Response object |
| 46 | 46 | * @return ResponseInterface $response Modified response object with generated output |
| 47 | 47 | */ |
| 48 | - public static function indexAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args ) |
|
| 48 | + public static function indexAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args) |
|
| 49 | 49 | { |
| 50 | - $contents = $container->get( 'aimeos_page' )->getSections( 'checkout-index', $request, $response, $args ); |
|
| 51 | - return $container->get( 'view' )->render( $response, 'Checkout/index.html.twig', $contents ); |
|
| 50 | + $contents = $container->get('aimeos_page')->getSections('checkout-index', $request, $response, $args); |
|
| 51 | + return $container->get('view')->render($response, 'Checkout/index.html.twig', $contents); |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | |
@@ -60,9 +60,9 @@ discard block |
||
| 60 | 60 | * @param ResponseInterface $response Response object |
| 61 | 61 | * @return ResponseInterface $response Modified response object with generated output |
| 62 | 62 | */ |
| 63 | - public static function updateAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args ) |
|
| 63 | + public static function updateAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args) |
|
| 64 | 64 | { |
| 65 | - $contents = $container->get( 'aimeos_page' )->getSections( 'checkout-update', $request, $response, $args ); |
|
| 66 | - return $container->get( 'view' )->render( $response, 'Checkout/update.html.twig', $contents ); |
|
| 65 | + $contents = $container->get('aimeos_page')->getSections('checkout-update', $request, $response, $args); |
|
| 66 | + return $container->get('view')->render($response, 'Checkout/update.html.twig', $contents); |
|
| 67 | 67 | } |
| 68 | 68 | } |
| 69 | 69 | \ No newline at end of file |
@@ -30,9 +30,9 @@ |
||
| 30 | 30 | * @param ResponseInterface $response Response object |
| 31 | 31 | * @return ResponseInterface $response Modified response object with generated output |
| 32 | 32 | */ |
| 33 | - public static function indexAction( ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args ) |
|
| 33 | + public static function indexAction(ContainerInterface $container, ServerRequestInterface $request, ResponseInterface $response, array $args) |
|
| 34 | 34 | { |
| 35 | - $contents = $container->get( 'aimeos_page' )->getSections( 'basket-index', $request, $response, $args ); |
|
| 36 | - return $container->get( 'view' )->render( $response, 'Basket/index.html.twig', $contents ); |
|
| 35 | + $contents = $container->get('aimeos_page')->getSections('basket-index', $request, $response, $args); |
|
| 36 | + return $container->get('view')->render($response, 'Basket/index.html.twig', $contents); |
|
| 37 | 37 | } |
| 38 | 38 | } |
| 39 | 39 | \ No newline at end of file |