@@ -28,7 +28,7 @@ |
||
| 28 | 28 | */ |
| 29 | 29 | public function indexAction() |
| 30 | 30 | { |
| 31 | - $params = $this->get( 'aimeos_page' )->getSections( 'basket-index' ); |
|
| 32 | - return $this->render( 'AimeosShopBundle:Basket:index.html.twig', $params ); |
|
| 31 | + $params = $this->get('aimeos_page')->getSections('basket-index'); |
|
| 32 | + return $this->render('AimeosShopBundle:Basket:index.html.twig', $params); |
|
| 33 | 33 | } |
| 34 | 34 | } |
@@ -30,54 +30,54 @@ discard block |
||
| 30 | 30 | * @param integer $tab Number of the currently active tab |
| 31 | 31 | * @return \Symfony\Component\HttpFoundation\Response HTML page for the admin interface |
| 32 | 32 | */ |
| 33 | - public function indexAction( $site, $lang, $tab ) |
|
| 33 | + public function indexAction($site, $lang, $tab) |
|
| 34 | 34 | { |
| 35 | - $context = $this->get( 'aimeos_context' )->get( false ); |
|
| 36 | - $context = $this->setLocale( $context, $site, $lang ); |
|
| 35 | + $context = $this->get('aimeos_context')->get(false); |
|
| 36 | + $context = $this->setLocale($context, $site, $lang); |
|
| 37 | 37 | |
| 38 | - $aimeos = $this->get( 'aimeos' )->get(); |
|
| 39 | - $cntlPaths = $aimeos->getCustomPaths( 'controller/extjs' ); |
|
| 40 | - $controller = new \Aimeos\Controller\ExtJS\JsonRpc( $context, $cntlPaths ); |
|
| 38 | + $aimeos = $this->get('aimeos')->get(); |
|
| 39 | + $cntlPaths = $aimeos->getCustomPaths('controller/extjs'); |
|
| 40 | + $controller = new \Aimeos\Controller\ExtJS\JsonRpc($context, $cntlPaths); |
|
| 41 | 41 | $cssFiles = array(); |
| 42 | 42 | |
| 43 | - foreach( $aimeos->getCustomPaths( 'admin/extjs' ) as $base => $paths ) |
|
| 43 | + foreach ($aimeos->getCustomPaths('admin/extjs') as $base => $paths) |
|
| 44 | 44 | { |
| 45 | - foreach( $paths as $path ) |
|
| 45 | + foreach ($paths as $path) |
|
| 46 | 46 | { |
| 47 | 47 | $jsbAbsPath = $base . '/' . $path; |
| 48 | 48 | |
| 49 | - if( !is_file( $jsbAbsPath ) ) { |
|
| 50 | - throw new \Exception( sprintf( 'JSB2 file "%1$s" not found', $jsbAbsPath ) ); |
|
| 49 | + if (!is_file($jsbAbsPath)) { |
|
| 50 | + throw new \Exception(sprintf('JSB2 file "%1$s" not found', $jsbAbsPath)); |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | - $jsb2 = new \Aimeos\MW\Jsb2\Standard( $jsbAbsPath, dirname( $path ) ); |
|
| 54 | - $cssFiles = array_merge( $cssFiles, $jsb2->getUrls( 'css' ) ); |
|
| 53 | + $jsb2 = new \Aimeos\MW\Jsb2\Standard($jsbAbsPath, dirname($path)); |
|
| 54 | + $cssFiles = array_merge($cssFiles, $jsb2->getUrls('css')); |
|
| 55 | 55 | } |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | - $params = array( 'site' => '{site}', 'lang' => '{lang}', 'tab' => '{tab}' ); |
|
| 59 | - $adminUrl = $this->generateUrl( 'aimeos_shop_admin', $params ); |
|
| 58 | + $params = array('site' => '{site}', 'lang' => '{lang}', 'tab' => '{tab}'); |
|
| 59 | + $adminUrl = $this->generateUrl('aimeos_shop_admin', $params); |
|
| 60 | 60 | |
| 61 | - $token = $this->get( 'security.csrf.token_manager' )->getToken( 'aimeos_admin_token' )->getValue(); |
|
| 62 | - $jsonUrl = $this->generateUrl( 'aimeos_shop_admin_json', array( '_token' => $token ) ); |
|
| 61 | + $token = $this->get('security.csrf.token_manager')->getToken('aimeos_admin_token')->getValue(); |
|
| 62 | + $jsonUrl = $this->generateUrl('aimeos_shop_admin_json', array('_token' => $token)); |
|
| 63 | 63 | |
| 64 | 64 | $vars = array( |
| 65 | 65 | 'lang' => $lang, |
| 66 | 66 | 'cssFiles' => $cssFiles, |
| 67 | - 'languages' => $this->getJsonLanguages( $context), |
|
| 68 | - 'config' => $this->getJsonClientConfig( $context ), |
|
| 69 | - 'site' => $this->getJsonSiteItem( $context, $site ), |
|
| 70 | - 'i18nContent' => $this->getJsonClientI18n( $aimeos->getI18nPaths(), $lang ), |
|
| 67 | + 'languages' => $this->getJsonLanguages($context), |
|
| 68 | + 'config' => $this->getJsonClientConfig($context), |
|
| 69 | + 'site' => $this->getJsonSiteItem($context, $site), |
|
| 70 | + 'i18nContent' => $this->getJsonClientI18n($aimeos->getI18nPaths(), $lang), |
|
| 71 | 71 | 'searchSchemas' => $controller->getJsonSearchSchemas(), |
| 72 | 72 | 'itemSchemas' => $controller->getJsonItemSchemas(), |
| 73 | - 'smd' => $controller->getJsonSmd( $jsonUrl ), |
|
| 74 | - 'urlTemplate' => urldecode( $adminUrl ), |
|
| 75 | - 'uploaddir' => $this->container->getParameter( 'aimeos_shop.uploaddir' ), |
|
| 73 | + 'smd' => $controller->getJsonSmd($jsonUrl), |
|
| 74 | + 'urlTemplate' => urldecode($adminUrl), |
|
| 75 | + 'uploaddir' => $this->container->getParameter('aimeos_shop.uploaddir'), |
|
| 76 | 76 | 'version' => $this->getVersion(), |
| 77 | 77 | 'activeTab' => $tab, |
| 78 | 78 | ); |
| 79 | 79 | |
| 80 | - return $this->render( 'AimeosShopBundle:Admin:index.html.twig', $vars ); |
|
| 80 | + return $this->render('AimeosShopBundle:Admin:index.html.twig', $vars); |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | |
@@ -87,22 +87,22 @@ discard block |
||
| 87 | 87 | * @param Request $request Symfony request object |
| 88 | 88 | * @return \Symfony\Component\HttpFoundation\Response 2.0 RPC message response |
| 89 | 89 | */ |
| 90 | - public function doAction( Request $request ) |
|
| 90 | + public function doAction(Request $request) |
|
| 91 | 91 | { |
| 92 | 92 | $csrfProvider = $this->get('security.csrf.token_manager'); |
| 93 | 93 | |
| 94 | - if( $csrfProvider->isTokenValid( new CsrfToken( 'aimeos_admin_token', $request->query->get( '_token' ) ) ) !== true ) { |
|
| 95 | - throw new \Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException( 'CSRF token is invalid' ); |
|
| 94 | + if ($csrfProvider->isTokenValid(new CsrfToken('aimeos_admin_token', $request->query->get('_token'))) !== true) { |
|
| 95 | + throw new \Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException('CSRF token is invalid'); |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | - $cntlPaths = $this->get( 'aimeos' )->get()->getCustomPaths( 'controller/extjs' ); |
|
| 99 | - $context = $this->get( 'aimeos_context' )->get( false ); |
|
| 100 | - $context = $this->setLocale( $context ); |
|
| 98 | + $cntlPaths = $this->get('aimeos')->get()->getCustomPaths('controller/extjs'); |
|
| 99 | + $context = $this->get('aimeos_context')->get(false); |
|
| 100 | + $context = $this->setLocale($context); |
|
| 101 | 101 | |
| 102 | - $controller = new \Aimeos\Controller\ExtJS\JsonRpc( $context, $cntlPaths ); |
|
| 102 | + $controller = new \Aimeos\Controller\ExtJS\JsonRpc($context, $cntlPaths); |
|
| 103 | 103 | |
| 104 | - $response = $controller->process( $request->request->all(), 'php://input' ); |
|
| 105 | - return $this->render( 'AimeosShopBundle:Admin:do.html.twig', array( 'output' => $response ) ); |
|
| 104 | + $response = $controller->process($request->request->all(), 'php://input'); |
|
| 105 | + return $this->render('AimeosShopBundle:Admin:do.html.twig', array('output' => $response)); |
|
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | |
@@ -115,27 +115,27 @@ discard block |
||
| 115 | 115 | { |
| 116 | 116 | $contents = ''; |
| 117 | 117 | $jsFiles = array(); |
| 118 | - $aimeos = $this->get( 'aimeos' )->get(); |
|
| 118 | + $aimeos = $this->get('aimeos')->get(); |
|
| 119 | 119 | |
| 120 | - foreach( $aimeos->getCustomPaths( 'admin/extjs' ) as $base => $paths ) |
|
| 120 | + foreach ($aimeos->getCustomPaths('admin/extjs') as $base => $paths) |
|
| 121 | 121 | { |
| 122 | - foreach( $paths as $path ) |
|
| 122 | + foreach ($paths as $path) |
|
| 123 | 123 | { |
| 124 | 124 | $jsbAbsPath = $base . '/' . $path; |
| 125 | - $jsb2 = new \Aimeos\MW\Jsb2\Standard( $jsbAbsPath, dirname( $jsbAbsPath ) ); |
|
| 126 | - $jsFiles = array_merge( $jsFiles, $jsb2->getUrls( 'js', '' ) ); |
|
| 125 | + $jsb2 = new \Aimeos\MW\Jsb2\Standard($jsbAbsPath, dirname($jsbAbsPath)); |
|
| 126 | + $jsFiles = array_merge($jsFiles, $jsb2->getUrls('js', '')); |
|
| 127 | 127 | } |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | - foreach( $jsFiles as $file ) |
|
| 130 | + foreach ($jsFiles as $file) |
|
| 131 | 131 | { |
| 132 | - if( ( $content = file_get_contents( $file ) ) !== false ) { |
|
| 132 | + if (($content = file_get_contents($file)) !== false) { |
|
| 133 | 133 | $contents .= $content; |
| 134 | 134 | } |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | - $response = new Response( $contents ); |
|
| 138 | - $response->headers->set( 'Content-Type', 'application/javascript' ); |
|
| 137 | + $response = new Response($contents); |
|
| 138 | + $response->headers->set('Content-Type', 'application/javascript'); |
|
| 139 | 139 | |
| 140 | 140 | return $response; |
| 141 | 141 | } |
@@ -147,30 +147,30 @@ discard block |
||
| 147 | 147 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object |
| 148 | 148 | * @return array List of language IDs with labels |
| 149 | 149 | */ |
| 150 | - protected function getJsonLanguages( \Aimeos\MShop\Context\Item\Iface $context ) |
|
| 150 | + protected function getJsonLanguages(\Aimeos\MShop\Context\Item\Iface $context) |
|
| 151 | 151 | { |
| 152 | - $paths = $this->get( 'aimeos' )->get()->getI18nPaths(); |
|
| 152 | + $paths = $this->get('aimeos')->get()->getI18nPaths(); |
|
| 153 | 153 | $langs = array(); |
| 154 | 154 | |
| 155 | - if( !isset( $paths['admin'] ) ) { |
|
| 156 | - return json_encode( array() ); |
|
| 155 | + if (!isset($paths['admin'])) { |
|
| 156 | + return json_encode(array()); |
|
| 157 | 157 | } |
| 158 | 158 | |
| 159 | - foreach( $paths['admin'] as $path ) |
|
| 159 | + foreach ($paths['admin'] as $path) |
|
| 160 | 160 | { |
| 161 | - $iter = new \DirectoryIterator( $path ); |
|
| 161 | + $iter = new \DirectoryIterator($path); |
|
| 162 | 162 | |
| 163 | - foreach( $iter as $file ) |
|
| 163 | + foreach ($iter as $file) |
|
| 164 | 164 | { |
| 165 | 165 | $name = $file->getFilename(); |
| 166 | 166 | |
| 167 | - if( preg_match('/^[a-z]{2,3}(_[A-Z]{2})?$/', $name ) ) { |
|
| 167 | + if (preg_match('/^[a-z]{2,3}(_[A-Z]{2})?$/', $name)) { |
|
| 168 | 168 | $langs[$name] = null; |
| 169 | 169 | } |
| 170 | 170 | } |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | - return json_encode( $this->getLanguages( $context, array_keys( $langs ) ) ); |
|
| 173 | + return json_encode($this->getLanguages($context, array_keys($langs))); |
|
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | |
@@ -180,10 +180,10 @@ discard block |
||
| 180 | 180 | * @param \Aimeos\MShop\Context\Item\Iface $context Context item object |
| 181 | 181 | * @return string JSON encoded configuration object |
| 182 | 182 | */ |
| 183 | - protected function getJsonClientConfig( \Aimeos\MShop\Context\Item\Iface $context ) |
|
| 183 | + protected function getJsonClientConfig(\Aimeos\MShop\Context\Item\Iface $context) |
|
| 184 | 184 | { |
| 185 | - $config = $context->getConfig()->get( 'admin/extjs', array() ); |
|
| 186 | - return json_encode( array( 'admin' => array( 'extjs' => $config ) ), JSON_FORCE_OBJECT ); |
|
| 185 | + $config = $context->getConfig()->get('admin/extjs', array()); |
|
| 186 | + return json_encode(array('admin' => array('extjs' => $config)), JSON_FORCE_OBJECT); |
|
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | |
@@ -194,16 +194,16 @@ discard block |
||
| 194 | 194 | * @param string $lang ISO language code like "en" or "en_GB" |
| 195 | 195 | * @return string JSON encoded translation object |
| 196 | 196 | */ |
| 197 | - protected function getJsonClientI18n( array $i18nPaths, $lang ) |
|
| 197 | + protected function getJsonClientI18n(array $i18nPaths, $lang) |
|
| 198 | 198 | { |
| 199 | - $i18n = new \Aimeos\MW\Translation\Zend2( $i18nPaths, 'gettext', $lang, array( 'disableNotices' => true ) ); |
|
| 199 | + $i18n = new \Aimeos\MW\Translation\Zend2($i18nPaths, 'gettext', $lang, array('disableNotices' => true)); |
|
| 200 | 200 | |
| 201 | 201 | $content = array( |
| 202 | - 'admin' => $i18n->getAll( 'admin' ), |
|
| 203 | - 'admin/ext' => $i18n->getAll( 'admin/ext' ), |
|
| 202 | + 'admin' => $i18n->getAll('admin'), |
|
| 203 | + 'admin/ext' => $i18n->getAll('admin/ext'), |
|
| 204 | 204 | ); |
| 205 | 205 | |
| 206 | - return json_encode( $content, JSON_FORCE_OBJECT ); |
|
| 206 | + return json_encode($content, JSON_FORCE_OBJECT); |
|
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 | |
@@ -215,19 +215,19 @@ discard block |
||
| 215 | 215 | * @return string JSON encoded site item object |
| 216 | 216 | * @throws Exception If no site item was found for the code |
| 217 | 217 | */ |
| 218 | - protected function getJsonSiteItem( \Aimeos\MShop\Context\Item\Iface $context, $site ) |
|
| 218 | + protected function getJsonSiteItem(\Aimeos\MShop\Context\Item\Iface $context, $site) |
|
| 219 | 219 | { |
| 220 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'locale/site' ); |
|
| 220 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'locale/site'); |
|
| 221 | 221 | |
| 222 | 222 | $criteria = $manager->createSearch(); |
| 223 | - $criteria->setConditions( $criteria->compare( '==', 'locale.site.code', $site ) ); |
|
| 224 | - $items = $manager->searchItems( $criteria ); |
|
| 223 | + $criteria->setConditions($criteria->compare('==', 'locale.site.code', $site)); |
|
| 224 | + $items = $manager->searchItems($criteria); |
|
| 225 | 225 | |
| 226 | - if( ( $item = reset( $items ) ) === false ) { |
|
| 227 | - throw new \Exception( sprintf( 'No site found for code "%1$s"', $site ) ); |
|
| 226 | + if (($item = reset($items)) === false) { |
|
| 227 | + throw new \Exception(sprintf('No site found for code "%1$s"', $site)); |
|
| 228 | 228 | } |
| 229 | 229 | |
| 230 | - return json_encode( $item->toArray() ); |
|
| 230 | + return json_encode($item->toArray()); |
|
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | |
@@ -238,18 +238,18 @@ discard block |
||
| 238 | 238 | * @param array $langIds List of language IDs |
| 239 | 239 | * @return array List of associative lists with "id" and "label" as keys |
| 240 | 240 | */ |
| 241 | - protected function getLanguages( \Aimeos\MShop\Context\Item\Iface $context, array $langIds ) |
|
| 241 | + protected function getLanguages(\Aimeos\MShop\Context\Item\Iface $context, array $langIds) |
|
| 242 | 242 | { |
| 243 | - $languageManager = \Aimeos\MShop\Factory::createManager( $context, 'locale/language' ); |
|
| 243 | + $languageManager = \Aimeos\MShop\Factory::createManager($context, 'locale/language'); |
|
| 244 | 244 | $result = array(); |
| 245 | 245 | |
| 246 | 246 | $search = $languageManager->createSearch(); |
| 247 | - $search->setConditions( $search->compare('==', 'locale.language.id', $langIds ) ); |
|
| 248 | - $search->setSortations( array( $search->sort( '-', 'locale.language.status' ), $search->sort( '+', 'locale.language.label' ) ) ); |
|
| 249 | - $langItems = $languageManager->searchItems( $search ); |
|
| 247 | + $search->setConditions($search->compare('==', 'locale.language.id', $langIds)); |
|
| 248 | + $search->setSortations(array($search->sort('-', 'locale.language.status'), $search->sort('+', 'locale.language.label'))); |
|
| 249 | + $langItems = $languageManager->searchItems($search); |
|
| 250 | 250 | |
| 251 | - foreach( $langItems as $id => $item ) { |
|
| 252 | - $result[] = array( 'id' => $id, 'label' => $item->getLabel() ); |
|
| 251 | + foreach ($langItems as $id => $item) { |
|
| 252 | + $result[] = array('id' => $id, 'label' => $item->getLabel()); |
|
| 253 | 253 | } |
| 254 | 254 | |
| 255 | 255 | return $result; |
@@ -263,14 +263,14 @@ discard block |
||
| 263 | 263 | */ |
| 264 | 264 | protected function getVersion() |
| 265 | 265 | { |
| 266 | - $filename = dirname( $this->get( 'kernel' )->getRootDir() ) . DIRECTORY_SEPARATOR . 'composer.lock'; |
|
| 266 | + $filename = dirname($this->get('kernel')->getRootDir()) . DIRECTORY_SEPARATOR . 'composer.lock'; |
|
| 267 | 267 | |
| 268 | - if( file_exists( $filename ) === true && ( $content = file_get_contents( $filename ) ) !== false |
|
| 269 | - && ( $content = json_decode( $content, true ) ) !== null && isset( $content['packages'] ) |
|
| 268 | + if (file_exists($filename) === true && ($content = file_get_contents($filename)) !== false |
|
| 269 | + && ($content = json_decode($content, true)) !== null && isset($content['packages']) |
|
| 270 | 270 | ) { |
| 271 | - foreach( (array) $content['packages'] as $item ) |
|
| 271 | + foreach ((array) $content['packages'] as $item) |
|
| 272 | 272 | { |
| 273 | - if( $item['name'] === 'aimeos/aimeos-symfony2' ) { |
|
| 273 | + if ($item['name'] === 'aimeos/aimeos-symfony2') { |
|
| 274 | 274 | return $item['version']; |
| 275 | 275 | } |
| 276 | 276 | } |
@@ -288,17 +288,17 @@ discard block |
||
| 288 | 288 | * @param string $locale ISO language code, e.g. "en" or "en_GB" |
| 289 | 289 | * @return \Aimeos\MShop\Context\Item\Iface Modified context object |
| 290 | 290 | */ |
| 291 | - protected function setLocale( \Aimeos\MShop\Context\Item\Iface $context, $sitecode = 'default', $locale = null ) |
|
| 291 | + protected function setLocale(\Aimeos\MShop\Context\Item\Iface $context, $sitecode = 'default', $locale = null) |
|
| 292 | 292 | { |
| 293 | - $localeManager = \Aimeos\MShop\Factory::createManager( $context, 'locale' ); |
|
| 293 | + $localeManager = \Aimeos\MShop\Factory::createManager($context, 'locale'); |
|
| 294 | 294 | |
| 295 | 295 | try { |
| 296 | - $localeItem = $localeManager->bootstrap( $sitecode, $locale, '', false ); |
|
| 297 | - } catch( \Aimeos\MShop\Locale\Exception $e ) { |
|
| 296 | + $localeItem = $localeManager->bootstrap($sitecode, $locale, '', false); |
|
| 297 | + } catch (\Aimeos\MShop\Locale\Exception $e) { |
|
| 298 | 298 | $localeItem = $localeManager->createItem(); |
| 299 | 299 | } |
| 300 | 300 | |
| 301 | - $context->setLocale( $localeItem ); |
|
| 301 | + $context->setLocale($localeItem); |
|
| 302 | 302 | |
| 303 | 303 | return $context; |
| 304 | 304 | } |
@@ -28,8 +28,8 @@ discard block |
||
| 28 | 28 | */ |
| 29 | 29 | public function countAction() |
| 30 | 30 | { |
| 31 | - $params = $this->get( 'aimeos_page' )->getSections( 'catalog-count' ); |
|
| 32 | - return $this->render( 'AimeosShopBundle:Catalog:count.html.twig', $params ); |
|
| 31 | + $params = $this->get('aimeos_page')->getSections('catalog-count'); |
|
| 32 | + return $this->render('AimeosShopBundle:Catalog:count.html.twig', $params); |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | |
@@ -40,8 +40,8 @@ discard block |
||
| 40 | 40 | */ |
| 41 | 41 | public function detailAction() |
| 42 | 42 | { |
| 43 | - $params = $this->get( 'aimeos_page' )->getSections( 'catalog-detail' ); |
|
| 44 | - return $this->render( 'AimeosShopBundle:Catalog:detail.html.twig', $params ); |
|
| 43 | + $params = $this->get('aimeos_page')->getSections('catalog-detail'); |
|
| 44 | + return $this->render('AimeosShopBundle:Catalog:detail.html.twig', $params); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | |
@@ -52,8 +52,8 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | public function listAction() |
| 54 | 54 | { |
| 55 | - $params = $this->get( 'aimeos_page' )->getSections( 'catalog-list' ); |
|
| 56 | - return $this->render( 'AimeosShopBundle:Catalog:list.html.twig', $params ); |
|
| 55 | + $params = $this->get('aimeos_page')->getSections('catalog-list'); |
|
| 56 | + return $this->render('AimeosShopBundle:Catalog:list.html.twig', $params); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | |
@@ -64,8 +64,8 @@ discard block |
||
| 64 | 64 | */ |
| 65 | 65 | public function stockAction() |
| 66 | 66 | { |
| 67 | - $params = $this->get( 'aimeos_page' )->getSections( 'catalog-stock' ); |
|
| 68 | - return $this->render( 'AimeosShopBundle:Catalog:stock.html.twig', $params ); |
|
| 67 | + $params = $this->get('aimeos_page')->getSections('catalog-stock'); |
|
| 68 | + return $this->render('AimeosShopBundle:Catalog:stock.html.twig', $params); |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | */ |
| 77 | 77 | public function suggestAction() |
| 78 | 78 | { |
| 79 | - $params = $this->get( 'aimeos_page' )->getSections( 'catalog-suggest' ); |
|
| 80 | - return $this->render( 'AimeosShopBundle:Catalog:suggest.html.twig', $params ); |
|
| 79 | + $params = $this->get('aimeos_page')->getSections('catalog-suggest'); |
|
| 80 | + return $this->render('AimeosShopBundle:Catalog:suggest.html.twig', $params); |
|
| 81 | 81 | } |
| 82 | 82 | } |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | */ |
| 29 | 29 | public function indexAction() |
| 30 | 30 | { |
| 31 | - $params = $this->get( 'aimeos_page' )->getSections( 'account-index' ); |
|
| 32 | - return $this->render( 'AimeosShopBundle:Account:index.html.twig', $params ); |
|
| 31 | + $params = $this->get('aimeos_page')->getSections('account-index'); |
|
| 32 | + return $this->render('AimeosShopBundle:Account:index.html.twig', $params); |
|
| 33 | 33 | } |
| 34 | 34 | } |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | */ |
| 29 | 29 | public function privacyAction() |
| 30 | 30 | { |
| 31 | - return $this->render( 'AimeosShopBundle:Page:privacy.html.twig' ); |
|
| 31 | + return $this->render('AimeosShopBundle:Page:privacy.html.twig'); |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | |
@@ -39,6 +39,6 @@ discard block |
||
| 39 | 39 | */ |
| 40 | 40 | public function termsAction() |
| 41 | 41 | { |
| 42 | - return $this->render( 'AimeosShopBundle:Page:terms.html.twig' ); |
|
| 42 | + return $this->render('AimeosShopBundle:Page:terms.html.twig'); |
|
| 43 | 43 | } |
| 44 | 44 | } |
@@ -25,22 +25,22 @@ |
||
| 25 | 25 | public function getConfigTreeBuilder() |
| 26 | 26 | { |
| 27 | 27 | $treeBuilder = new TreeBuilder(); |
| 28 | - $rootNode = $treeBuilder->root( 'aimeos_shop' ); |
|
| 28 | + $rootNode = $treeBuilder->root('aimeos_shop'); |
|
| 29 | 29 | |
| 30 | 30 | $rootNode |
| 31 | 31 | ->children() |
| 32 | - ->booleanNode('disable_sites')->defaultValue( true )->end() |
|
| 33 | - ->booleanNode('apc_enable')->defaultValue( false )->end() |
|
| 34 | - ->scalarNode('apc_prefix')->defaultValue( 'sf2:' )->end() |
|
| 32 | + ->booleanNode('disable_sites')->defaultValue(true)->end() |
|
| 33 | + ->booleanNode('apc_enable')->defaultValue(false)->end() |
|
| 34 | + ->scalarNode('apc_prefix')->defaultValue('sf2:')->end() |
|
| 35 | 35 | ->scalarNode('extdir')->end() |
| 36 | 36 | ->scalarNode('uploaddir')->end() |
| 37 | - ->variableNode('client')->defaultValue( array() )->end() |
|
| 38 | - ->variableNode('controller')->defaultValue( array() )->end() |
|
| 39 | - ->variableNode('i18n')->defaultValue( array() )->end() |
|
| 40 | - ->variableNode('madmin')->defaultValue( array() )->end() |
|
| 41 | - ->variableNode('mshop')->defaultValue( array() )->end() |
|
| 42 | - ->variableNode('resource')->defaultValue( array() )->end() |
|
| 43 | - ->variableNode('page')->defaultValue( array() )->end() |
|
| 37 | + ->variableNode('client')->defaultValue(array())->end() |
|
| 38 | + ->variableNode('controller')->defaultValue(array())->end() |
|
| 39 | + ->variableNode('i18n')->defaultValue(array())->end() |
|
| 40 | + ->variableNode('madmin')->defaultValue(array())->end() |
|
| 41 | + ->variableNode('mshop')->defaultValue(array())->end() |
|
| 42 | + ->variableNode('resource')->defaultValue(array())->end() |
|
| 43 | + ->variableNode('page')->defaultValue(array())->end() |
|
| 44 | 44 | ->end() |
| 45 | 45 | ; |
| 46 | 46 | |
@@ -27,21 +27,21 @@ discard block |
||
| 27 | 27 | /** |
| 28 | 28 | * {@inheritDoc} |
| 29 | 29 | */ |
| 30 | - public function load( array $configs, ContainerBuilder $container ) |
|
| 30 | + public function load(array $configs, ContainerBuilder $container) |
|
| 31 | 31 | { |
| 32 | 32 | $configuration = new Configuration(); |
| 33 | - $config = $this->processConfiguration( $configuration, $configs ); |
|
| 33 | + $config = $this->processConfiguration($configuration, $configs); |
|
| 34 | 34 | |
| 35 | - foreach( $configs as $list ) { |
|
| 36 | - $this->merge( $config, $list ); |
|
| 35 | + foreach ($configs as $list) { |
|
| 36 | + $this->merge($config, $list); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | - foreach( $config as $key => $value ) { |
|
| 40 | - $container->setParameter( 'aimeos_shop.' . $key, $value ); |
|
| 39 | + foreach ($config as $key => $value) { |
|
| 40 | + $container->setParameter('aimeos_shop.' . $key, $value); |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | - $loader = new Loader\YamlFileLoader( $container, new FileLocator( dirname( __DIR__ ) . '/Resources/config' ) ); |
|
| 44 | - $loader->load( 'services.yml' ); |
|
| 43 | + $loader = new Loader\YamlFileLoader($container, new FileLocator(dirname(__DIR__) . '/Resources/config')); |
|
| 44 | + $loader->load('services.yml'); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | |
@@ -50,13 +50,13 @@ discard block |
||
| 50 | 50 | * |
| 51 | 51 | * @param ContainerBuilder $container ContainerBuilder object |
| 52 | 52 | */ |
| 53 | - public function prepend( ContainerBuilder $container ) |
|
| 53 | + public function prepend(ContainerBuilder $container) |
|
| 54 | 54 | { |
| 55 | - $configFile = dirname( __DIR__ ) . '/Resources/config/aimeos_shop.yml'; |
|
| 56 | - $config = Yaml::parse( file_get_contents( $configFile ) ); |
|
| 55 | + $configFile = dirname(__DIR__) . '/Resources/config/aimeos_shop.yml'; |
|
| 56 | + $config = Yaml::parse(file_get_contents($configFile)); |
|
| 57 | 57 | |
| 58 | - $container->prependExtensionConfig( 'aimeos_shop', $config ); |
|
| 59 | - $container->addResource( new FileResource( $configFile ) ); |
|
| 58 | + $container->prependExtensionConfig('aimeos_shop', $config); |
|
| 59 | + $container->addResource(new FileResource($configFile)); |
|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | |
@@ -66,15 +66,15 @@ discard block |
||
| 66 | 66 | * @param array &$original Associative list of original values |
| 67 | 67 | * @param array $overrule Associative list of new values |
| 68 | 68 | */ |
| 69 | - protected function merge( array &$original, array $overrule ) |
|
| 69 | + protected function merge(array &$original, array $overrule) |
|
| 70 | 70 | { |
| 71 | - foreach( array_keys( $overrule ) as $key ) |
|
| 71 | + foreach (array_keys($overrule) as $key) |
|
| 72 | 72 | { |
| 73 | - if( isset( $original[$key] ) && is_array( $original[$key] ) ) { |
|
| 74 | - if( is_array( $overrule[$key] ) ) { |
|
| 75 | - $this->merge( $original[$key], $overrule[$key] ); |
|
| 73 | + if (isset($original[$key]) && is_array($original[$key])) { |
|
| 74 | + if (is_array($overrule[$key])) { |
|
| 75 | + $this->merge($original[$key], $overrule[$key]); |
|
| 76 | 76 | } |
| 77 | - } elseif( isset( $overrule[$key] ) ) { |
|
| 77 | + } elseif (isset($overrule[$key])) { |
|
| 78 | 78 | $original[$key] = $overrule[$key]; |
| 79 | 79 | } |
| 80 | 80 | } |
@@ -25,15 +25,15 @@ |
||
| 25 | 25 | * @param InputInterface $input Input object |
| 26 | 26 | * @return \Aimeos\MShop\Locale\Item\Site\Interface[] List of site items |
| 27 | 27 | */ |
| 28 | - protected function getSiteItems( \Aimeos\MShop\Context\Item\Iface $context, InputInterface $input ) |
|
| 28 | + protected function getSiteItems(\Aimeos\MShop\Context\Item\Iface $context, InputInterface $input) |
|
| 29 | 29 | { |
| 30 | - $manager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context )->getSubManager( 'site' ); |
|
| 30 | + $manager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context)->getSubManager('site'); |
|
| 31 | 31 | $search = $manager->createSearch(); |
| 32 | 32 | |
| 33 | - if( ( $codes = (string) $input->getArgument( 'site' ) ) !== '' ) { |
|
| 34 | - $search->setConditions( $search->compare( '==', 'locale.site.code', explode( ' ', $codes ) ) ); |
|
| 33 | + if (($codes = (string) $input->getArgument('site')) !== '') { |
|
| 34 | + $search->setConditions($search->compare('==', 'locale.site.code', explode(' ', $codes))); |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | - return $manager->searchItems( $search ); |
|
| 37 | + return $manager->searchItems($search); |
|
| 38 | 38 | } |
| 39 | 39 | } |
@@ -23,9 +23,9 @@ discard block |
||
| 23 | 23 | */ |
| 24 | 24 | protected function configure() |
| 25 | 25 | { |
| 26 | - $this->setName( 'aimeos:cache' ); |
|
| 27 | - $this->setDescription( 'Clears the content cache' ); |
|
| 28 | - $this->addArgument( 'site', InputArgument::OPTIONAL, 'Site codes to clear the cache like "default unittest" (none for all)' ); |
|
| 26 | + $this->setName('aimeos:cache'); |
|
| 27 | + $this->setDescription('Clears the content cache'); |
|
| 28 | + $this->addArgument('site', InputArgument::OPTIONAL, 'Site codes to clear the cache like "default unittest" (none for all)'); |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | |
@@ -35,26 +35,26 @@ discard block |
||
| 35 | 35 | * @param InputInterface $input Input object |
| 36 | 36 | * @param OutputInterface $output Output object |
| 37 | 37 | */ |
| 38 | - protected function execute( InputInterface $input, OutputInterface $output ) |
|
| 38 | + protected function execute(InputInterface $input, OutputInterface $output) |
|
| 39 | 39 | { |
| 40 | - $context = $this->getContainer()->get( 'aimeos_context' )->get( false ); |
|
| 41 | - $context->setEditor( 'aimeos:cache' ); |
|
| 40 | + $context = $this->getContainer()->get('aimeos_context')->get(false); |
|
| 41 | + $context->setEditor('aimeos:cache'); |
|
| 42 | 42 | |
| 43 | - $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context ); |
|
| 43 | + $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context); |
|
| 44 | 44 | |
| 45 | - foreach( $this->getSiteItems( $context, $input ) as $siteItem ) |
|
| 45 | + foreach ($this->getSiteItems($context, $input) as $siteItem) |
|
| 46 | 46 | { |
| 47 | - $localeItem = $localeManager->bootstrap( $siteItem->getCode(), '', '', false ); |
|
| 47 | + $localeItem = $localeManager->bootstrap($siteItem->getCode(), '', '', false); |
|
| 48 | 48 | |
| 49 | 49 | $lcontext = clone $context; |
| 50 | - $lcontext->setLocale( $localeItem ); |
|
| 50 | + $lcontext->setLocale($localeItem); |
|
| 51 | 51 | |
| 52 | - $cache = new \Aimeos\MAdmin\Cache\Proxy\Standard( $lcontext ); |
|
| 53 | - $lcontext->setCache( $cache ); |
|
| 52 | + $cache = new \Aimeos\MAdmin\Cache\Proxy\Standard($lcontext); |
|
| 53 | + $lcontext->setCache($cache); |
|
| 54 | 54 | |
| 55 | - $output->writeln( sprintf( 'Clearing the Aimeos cache for site <info>%1$s</info>', $siteItem->getCode() ) ); |
|
| 55 | + $output->writeln(sprintf('Clearing the Aimeos cache for site <info>%1$s</info>', $siteItem->getCode())); |
|
| 56 | 56 | |
| 57 | - \Aimeos\MAdmin\Cache\Manager\Factory::createManager( $lcontext )->getCache()->flush(); |
|
| 57 | + \Aimeos\MAdmin\Cache\Manager\Factory::createManager($lcontext)->getCache()->flush(); |
|
| 58 | 58 | } |
| 59 | 59 | } |
| 60 | 60 | } |