@@ -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 @@ 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,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 | } |
@@ -14,13 +14,13 @@ |
||
| 14 | 14 | $kernel = $this->createKernel(); |
| 15 | 15 | $kernel->boot(); |
| 16 | 16 | |
| 17 | - $application = new Application( $kernel ); |
|
| 18 | - $application->add( new Command\JobsCommand() ); |
|
| 17 | + $application = new Application($kernel); |
|
| 18 | + $application->add(new Command\JobsCommand()); |
|
| 19 | 19 | |
| 20 | - $command = $application->find( 'aimeos:jobs' ); |
|
| 21 | - $commandTester = new CommandTester( $command ); |
|
| 22 | - $commandTester->execute( array( 'command' => $command->getName(), 'site' => 'unittest', 'jobs' => 'index/rebuild' ) ); |
|
| 20 | + $command = $application->find('aimeos:jobs'); |
|
| 21 | + $commandTester = new CommandTester($command); |
|
| 22 | + $commandTester->execute(array('command' => $command->getName(), 'site' => 'unittest', 'jobs' => 'index/rebuild')); |
|
| 23 | 23 | |
| 24 | - $this->assertEquals( 0, $commandTester->getStatusCode() ); |
|
| 24 | + $this->assertEquals(0, $commandTester->getStatusCode()); |
|
| 25 | 25 | } |
| 26 | 26 | } |
@@ -14,13 +14,13 @@ |
||
| 14 | 14 | $kernel = $this->createKernel(); |
| 15 | 15 | $kernel->boot(); |
| 16 | 16 | |
| 17 | - $application = new Application( $kernel ); |
|
| 18 | - $application->add( new Command\CacheCommand() ); |
|
| 17 | + $application = new Application($kernel); |
|
| 18 | + $application->add(new Command\CacheCommand()); |
|
| 19 | 19 | |
| 20 | - $command = $application->find( 'aimeos:cache' ); |
|
| 21 | - $commandTester = new CommandTester( $command ); |
|
| 22 | - $commandTester->execute( array( 'command' => $command->getName(), 'site' => 'unittest' ) ); |
|
| 20 | + $command = $application->find('aimeos:cache'); |
|
| 21 | + $commandTester = new CommandTester($command); |
|
| 22 | + $commandTester->execute(array('command' => $command->getName(), 'site' => 'unittest')); |
|
| 23 | 23 | |
| 24 | - $this->assertEquals( 0, $commandTester->getStatusCode() ); |
|
| 24 | + $this->assertEquals(0, $commandTester->getStatusCode()); |
|
| 25 | 25 | } |
| 26 | 26 | } |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | */ |
| 210 | 210 | public function getRoles() |
| 211 | 211 | { |
| 212 | - return array( 'ROLE_USER' ); |
|
| 212 | + return array('ROLE_USER'); |
|
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | |
@@ -226,23 +226,23 @@ discard block |
||
| 226 | 226 | */ |
| 227 | 227 | public function serialize() |
| 228 | 228 | { |
| 229 | - return serialize( array( |
|
| 229 | + return serialize(array( |
|
| 230 | 230 | $this->id, |
| 231 | 231 | $this->username, |
| 232 | 232 | $this->password, |
| 233 | - ) ); |
|
| 233 | + )); |
|
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | |
| 237 | 237 | /** |
| 238 | 238 | * @see \Serializable::unserialize() |
| 239 | 239 | */ |
| 240 | - public function unserialize( $serialized ) |
|
| 240 | + public function unserialize($serialized) |
|
| 241 | 241 | { |
| 242 | 242 | list ( |
| 243 | 243 | $this->id, |
| 244 | 244 | $this->username, |
| 245 | 245 | $this->password, |
| 246 | - ) = unserialize( $serialized ); |
|
| 246 | + ) = unserialize($serialized); |
|
| 247 | 247 | } |
| 248 | 248 | } |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | */ |
| 210 | 210 | public function getSalutation() |
| 211 | 211 | { |
| 212 | - return ( isset( $this->salutation ) ? (string) $this->salutation : \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_UNKNOWN ); |
|
| 212 | + return (isset($this->salutation) ? (string) $this->salutation : \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_UNKNOWN); |
|
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | */ |
| 221 | 221 | public function setSalutation($salutation) |
| 222 | 222 | { |
| 223 | - switch( $salutation ) |
|
| 223 | + switch ($salutation) |
|
| 224 | 224 | { |
| 225 | 225 | case \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_UNKNOWN: |
| 226 | 226 | case \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_COMPANY: |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | case \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MR: |
| 230 | 230 | break; |
| 231 | 231 | default: |
| 232 | - throw new \Exception( sprintf( 'Address salutation "%1$s" is unknown', $value ) ); |
|
| 232 | + throw new \Exception(sprintf('Address salutation "%1$s" is unknown', $value)); |
|
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | $this->salutation = (string) $salutation; |
@@ -441,7 +441,7 @@ discard block |
||
| 441 | 441 | */ |
| 442 | 442 | public function setCountryId($countryid) |
| 443 | 443 | { |
| 444 | - $this->countryid = strtoupper( (string) $countryid ); |
|
| 444 | + $this->countryid = strtoupper((string) $countryid); |
|
| 445 | 445 | } |
| 446 | 446 | |
| 447 | 447 | |
@@ -463,7 +463,7 @@ discard block |
||
| 463 | 463 | */ |
| 464 | 464 | public function setLanguageId($langid) |
| 465 | 465 | { |
| 466 | - $this->langid = strtolower( (string) $langid ); |
|
| 466 | + $this->langid = strtolower((string) $langid); |
|
| 467 | 467 | } |
| 468 | 468 | |
| 469 | 469 | |
@@ -542,8 +542,8 @@ discard block |
||
| 542 | 542 | { |
| 543 | 543 | $pattern = '#^([a-z]+://)?[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]+)+(:[0-9]+)?(/.*)?$#'; |
| 544 | 544 | |
| 545 | - if( $website !== '' && preg_match( $pattern, $website ) !== 1 ) { |
|
| 546 | - throw new \Exception( sprintf( 'Invalid web site URL "%1$s"', $website ) ); |
|
| 545 | + if ($website !== '' && preg_match($pattern, $website) !== 1) { |
|
| 546 | + throw new \Exception(sprintf('Invalid web site URL "%1$s"', $website)); |
|
| 547 | 547 | } |
| 548 | 548 | |
| 549 | 549 | $this->website = (string) $website; |
@@ -210,8 +210,7 @@ |
||
| 210 | 210 | $localeItem = $localeManager->bootstrap( $sitecode, '', '', false ); |
| 211 | 211 | $localeItem->setLanguageId( null ); |
| 212 | 212 | $localeItem->setCurrencyId( null ); |
| 213 | - } |
|
| 214 | - catch( \Aimeos\MShop\Locale\Exception $e ) |
|
| 213 | + } catch( \Aimeos\MShop\Locale\Exception $e ) |
|
| 215 | 214 | { |
| 216 | 215 | $localeItem = $localeManager->createItem(); |
| 217 | 216 | } |
@@ -29,35 +29,35 @@ discard block |
||
| 29 | 29 | * @param $type File type, i.e. "css" or "js" |
| 30 | 30 | * @return Response Response object |
| 31 | 31 | */ |
| 32 | - public function fileAction( $type ) |
|
| 32 | + public function fileAction($type) |
|
| 33 | 33 | { |
| 34 | 34 | $contents = ''; |
| 35 | 35 | $files = array(); |
| 36 | - $aimeos = $this->get( 'aimeos' )->get(); |
|
| 36 | + $aimeos = $this->get('aimeos')->get(); |
|
| 37 | 37 | |
| 38 | - foreach( $aimeos->getCustomPaths( 'admin/jqadm' ) as $base => $paths ) |
|
| 38 | + foreach ($aimeos->getCustomPaths('admin/jqadm') as $base => $paths) |
|
| 39 | 39 | { |
| 40 | - foreach( $paths as $path ) |
|
| 40 | + foreach ($paths as $path) |
|
| 41 | 41 | { |
| 42 | - $jsbAbsPath = $base . '/' . $path; |
|
| 43 | - $jsb2 = new \Aimeos\MW\Jsb2\Standard( $jsbAbsPath, dirname( $jsbAbsPath ) ); |
|
| 44 | - $files = array_merge( $files, $jsb2->getFiles( $type ) ); |
|
| 42 | + $jsbAbsPath = $base.'/'.$path; |
|
| 43 | + $jsb2 = new \Aimeos\MW\Jsb2\Standard($jsbAbsPath, dirname($jsbAbsPath)); |
|
| 44 | + $files = array_merge($files, $jsb2->getFiles($type)); |
|
| 45 | 45 | } |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | - foreach( $files as $file ) |
|
| 48 | + foreach ($files as $file) |
|
| 49 | 49 | { |
| 50 | - if( ( $content = file_get_contents( $file ) ) !== false ) { |
|
| 50 | + if (($content = file_get_contents($file)) !== false) { |
|
| 51 | 51 | $contents .= $content; |
| 52 | 52 | } |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - $response = new Response( $contents ); |
|
| 55 | + $response = new Response($contents); |
|
| 56 | 56 | |
| 57 | - if( $type === 'js' ) { |
|
| 58 | - $response->headers->set( 'Content-Type', 'application/javascript' ); |
|
| 59 | - } elseif( $type === 'css' ) { |
|
| 60 | - $response->headers->set( 'Content-Type', 'text/css' ); |
|
| 57 | + if ($type === 'js') { |
|
| 58 | + $response->headers->set('Content-Type', 'application/javascript'); |
|
| 59 | + } elseif ($type === 'css') { |
|
| 60 | + $response->headers->set('Content-Type', 'text/css'); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | return $response; |
@@ -72,10 +72,10 @@ discard block |
||
| 72 | 72 | * @param string $site Unique site code |
| 73 | 73 | * @return Response Generated output |
| 74 | 74 | */ |
| 75 | - public function copyAction( Request $request, $resource, $site = 'default' ) |
|
| 75 | + public function copyAction(Request $request, $resource, $site = 'default') |
|
| 76 | 76 | { |
| 77 | - $cntl = $this->createClient( $request, $site, $resource ); |
|
| 78 | - return $this->getHtml( $cntl->copy() ); |
|
| 77 | + $cntl = $this->createClient($request, $site, $resource); |
|
| 78 | + return $this->getHtml($cntl->copy()); |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | |
@@ -87,10 +87,10 @@ discard block |
||
| 87 | 87 | * @param string $site Unique site code |
| 88 | 88 | * @return Response Generated output |
| 89 | 89 | */ |
| 90 | - public function createAction( Request $request, $resource, $site = 'default' ) |
|
| 90 | + public function createAction(Request $request, $resource, $site = 'default') |
|
| 91 | 91 | { |
| 92 | - $cntl = $this->createClient( $request, $site, $resource ); |
|
| 93 | - return $this->getHtml( $cntl->create() ); |
|
| 92 | + $cntl = $this->createClient($request, $site, $resource); |
|
| 93 | + return $this->getHtml($cntl->create()); |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | |
@@ -102,10 +102,10 @@ discard block |
||
| 102 | 102 | * @param string $site Unique site code |
| 103 | 103 | * @return Response Generated output |
| 104 | 104 | */ |
| 105 | - public function deleteAction( Request $request, $resource, $site = 'default' ) |
|
| 105 | + public function deleteAction(Request $request, $resource, $site = 'default') |
|
| 106 | 106 | { |
| 107 | - $cntl = $this->createClient( $request, $site, $resource ); |
|
| 108 | - return $this->getHtml( $cntl->delete() . $cntl->search() ); |
|
| 107 | + $cntl = $this->createClient($request, $site, $resource); |
|
| 108 | + return $this->getHtml($cntl->delete().$cntl->search()); |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | |
@@ -117,10 +117,10 @@ discard block |
||
| 117 | 117 | * @param string $site Unique site code |
| 118 | 118 | * @return Response Generated output |
| 119 | 119 | */ |
| 120 | - public function getAction( Request $request, $resource, $site = 'default' ) |
|
| 120 | + public function getAction(Request $request, $resource, $site = 'default') |
|
| 121 | 121 | { |
| 122 | - $cntl = $this->createClient( $request, $site, $resource ); |
|
| 123 | - return $this->getHtml( $cntl->get() ); |
|
| 122 | + $cntl = $this->createClient($request, $site, $resource); |
|
| 123 | + return $this->getHtml($cntl->get()); |
|
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | |
@@ -132,10 +132,10 @@ discard block |
||
| 132 | 132 | * @param string $site Unique site code |
| 133 | 133 | * @return Response Generated output |
| 134 | 134 | */ |
| 135 | - public function saveAction( Request $request, $resource, $site = 'default' ) |
|
| 135 | + public function saveAction(Request $request, $resource, $site = 'default') |
|
| 136 | 136 | { |
| 137 | - $cntl = $this->createClient( $request, $site, $resource ); |
|
| 138 | - return $this->getHtml( ( $cntl->save() ? : $cntl->search() ) ); |
|
| 137 | + $cntl = $this->createClient($request, $site, $resource); |
|
| 138 | + return $this->getHtml(($cntl->save() ?: $cntl->search())); |
|
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | |
@@ -147,10 +147,10 @@ discard block |
||
| 147 | 147 | * @param string $site Unique site code |
| 148 | 148 | * @return Response Generated output |
| 149 | 149 | */ |
| 150 | - public function searchAction( Request $request, $resource, $site = 'default' ) |
|
| 150 | + public function searchAction(Request $request, $resource, $site = 'default') |
|
| 151 | 151 | { |
| 152 | - $cntl = $this->createClient( $request, $site, $resource ); |
|
| 153 | - return $this->getHtml( $cntl->search() ); |
|
| 152 | + $cntl = $this->createClient($request, $site, $resource); |
|
| 153 | + return $this->getHtml($cntl->search()); |
|
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | |
@@ -162,20 +162,20 @@ discard block |
||
| 162 | 162 | * @param string $resource Resource location, e.g. "product" |
| 163 | 163 | * @return \Aimeos\Admin\JQAdm\Iface Context item |
| 164 | 164 | */ |
| 165 | - protected function createClient( Request $request, $site, $resource ) |
|
| 165 | + protected function createClient(Request $request, $site, $resource) |
|
| 166 | 166 | { |
| 167 | - $lang = $request->get( 'lang', 'en' ); |
|
| 167 | + $lang = $request->get('lang', 'en'); |
|
| 168 | 168 | |
| 169 | - $aimeos = $this->get( 'aimeos' )->get(); |
|
| 170 | - $templatePaths = $aimeos->getCustomPaths( 'admin/jqadm/templates' ); |
|
| 169 | + $aimeos = $this->get('aimeos')->get(); |
|
| 170 | + $templatePaths = $aimeos->getCustomPaths('admin/jqadm/templates'); |
|
| 171 | 171 | |
| 172 | - $context = $this->get( 'aimeos_context' )->get( false ); |
|
| 173 | - $context = $this->setLocale( $context, $site, $lang ); |
|
| 172 | + $context = $this->get('aimeos_context')->get(false); |
|
| 173 | + $context = $this->setLocale($context, $site, $lang); |
|
| 174 | 174 | |
| 175 | - $view = $this->get( 'aimeos_view' )->create( $context, $templatePaths, $lang ); |
|
| 176 | - $context->setView( $view ); |
|
| 175 | + $view = $this->get('aimeos_view')->create($context, $templatePaths, $lang); |
|
| 176 | + $context->setView($view); |
|
| 177 | 177 | |
| 178 | - return \Aimeos\Admin\JQAdm\Factory::createClient( $context, $templatePaths, $resource ); |
|
| 178 | + return \Aimeos\Admin\JQAdm\Factory::createClient($context, $templatePaths, $resource); |
|
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | |
@@ -185,12 +185,12 @@ discard block |
||
| 185 | 185 | * @param string $content Content from admin client |
| 186 | 186 | * @return Response View for rendering the output |
| 187 | 187 | */ |
| 188 | - protected function getHtml( $content ) |
|
| 188 | + protected function getHtml($content) |
|
| 189 | 189 | { |
| 190 | - $version = $this->get( 'aimeos' )->getVersion(); |
|
| 191 | - $content = str_replace( array( '{type}', '{version}' ), array( 'Symfony', $version ), $content ); |
|
| 190 | + $version = $this->get('aimeos')->getVersion(); |
|
| 191 | + $content = str_replace(array('{type}', '{version}'), array('Symfony', $version), $content); |
|
| 192 | 192 | |
| 193 | - return $this->render( 'AimeosShopBundle:Jqadm:index.html.twig', array( 'content' => $content ) ); |
|
| 193 | + return $this->render('AimeosShopBundle:Jqadm:index.html.twig', array('content' => $content)); |
|
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | |
@@ -202,23 +202,23 @@ discard block |
||
| 202 | 202 | * @param string $lang ISO language code, e.g. "en" or "en_GB" |
| 203 | 203 | * @return \Aimeos\MShop\Context\Item\Iface Modified context object |
| 204 | 204 | */ |
| 205 | - protected function setLocale( \Aimeos\MShop\Context\Item\Iface $context, $site, $lang ) |
|
| 205 | + protected function setLocale(\Aimeos\MShop\Context\Item\Iface $context, $site, $lang) |
|
| 206 | 206 | { |
| 207 | - $localeManager = \Aimeos\MShop\Factory::createManager( $context, 'locale' ); |
|
| 207 | + $localeManager = \Aimeos\MShop\Factory::createManager($context, 'locale'); |
|
| 208 | 208 | |
| 209 | 209 | try |
| 210 | 210 | { |
| 211 | - $localeItem = $localeManager->bootstrap( $site, '', '', false ); |
|
| 212 | - $localeItem->setLanguageId( null ); |
|
| 213 | - $localeItem->setCurrencyId( null ); |
|
| 211 | + $localeItem = $localeManager->bootstrap($site, '', '', false); |
|
| 212 | + $localeItem->setLanguageId(null); |
|
| 213 | + $localeItem->setCurrencyId(null); |
|
| 214 | 214 | } |
| 215 | - catch( \Aimeos\MShop\Locale\Exception $e ) |
|
| 215 | + catch (\Aimeos\MShop\Locale\Exception $e) |
|
| 216 | 216 | { |
| 217 | 217 | $localeItem = $localeManager->createItem(); |
| 218 | 218 | } |
| 219 | 219 | |
| 220 | - $context->setLocale( $localeItem ); |
|
| 221 | - $context->setI18n( $this->get( 'aimeos_i18n' )->get( array( $lang, 'en' ) ) ); |
|
| 220 | + $context->setLocale($localeItem); |
|
| 221 | + $context->setI18n($this->get('aimeos_i18n')->get(array($lang, 'en'))); |
|
| 222 | 222 | |
| 223 | 223 | return $context; |
| 224 | 224 | } |