@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | * Returns the initial HTML view for the admin interface. |
27 | 27 | * |
28 | 28 | * @param Request $request Symfony request object |
29 | - * @return Response Generated HTML page for the admin interface |
|
29 | + * @return \Symfony\Component\HttpFoundation\Response Generated HTML page for the admin interface |
|
30 | 30 | */ |
31 | 31 | public function indexAction( Request $request ) |
32 | 32 | { |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | /** |
59 | 59 | * Checks if the used is authenticated and has the admin role |
60 | 60 | * |
61 | - * @param array $roles List of role names where at least one must match |
|
61 | + * @param string[] $roles List of role names where at least one must match |
|
62 | 62 | * @return boolean True if authenticated and is admin, false if not |
63 | 63 | */ |
64 | 64 | protected function hasRole( array $roles ) |
@@ -28,30 +28,30 @@ discard block |
||
28 | 28 | * @param Request $request Symfony request object |
29 | 29 | * @return Response Generated HTML page for the admin interface |
30 | 30 | */ |
31 | - public function indexAction( Request $request ) |
|
31 | + public function indexAction(Request $request) |
|
32 | 32 | { |
33 | - if( $this->hasRole( ['ROLE_ADMIN'] ) ) |
|
33 | + if ($this->hasRole(['ROLE_ADMIN'])) |
|
34 | 34 | { |
35 | - $context = $this->get( 'aimeos_context' )->get( false ); |
|
36 | - $siteManager = \Aimeos\MShop\Factory::createManager( $context, 'locale/site' ); |
|
37 | - $siteItem = $siteManager->getItem( $this->getUser()->getSiteId() ); |
|
35 | + $context = $this->get('aimeos_context')->get(false); |
|
36 | + $siteManager = \Aimeos\MShop\Factory::createManager($context, 'locale/site'); |
|
37 | + $siteItem = $siteManager->getItem($this->getUser()->getSiteId()); |
|
38 | 38 | |
39 | - $params = array( 'site' => $siteItem->getCode(), 'resource' => 'dashboard' ); |
|
40 | - return $this->redirect( $this->generateUrl( 'aimeos_shop_jqadm_search', $params ) ); |
|
39 | + $params = array('site' => $siteItem->getCode(), 'resource' => 'dashboard'); |
|
40 | + return $this->redirect($this->generateUrl('aimeos_shop_jqadm_search', $params)); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | |
44 | - $param = array( 'error' => '', 'username' => '' ); |
|
44 | + $param = array('error' => '', 'username' => ''); |
|
45 | 45 | |
46 | - if( $this->has( 'security.authentication_utils' ) ) |
|
46 | + if ($this->has('security.authentication_utils')) |
|
47 | 47 | { |
48 | - $auth = $this->get( 'security.authentication_utils' ); |
|
48 | + $auth = $this->get('security.authentication_utils'); |
|
49 | 49 | |
50 | 50 | $param['error'] = $auth->getLastAuthenticationError(); |
51 | 51 | $param['username'] = $auth->getLastUsername(); |
52 | 52 | } |
53 | 53 | |
54 | - return $this->render( 'AimeosShopBundle:Admin:index.html.twig', $param ); |
|
54 | + return $this->render('AimeosShopBundle:Admin:index.html.twig', $param); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | |
@@ -61,15 +61,15 @@ discard block |
||
61 | 61 | * @param array $roles List of role names where at least one must match |
62 | 62 | * @return boolean True if authenticated and is admin, false if not |
63 | 63 | */ |
64 | - protected function hasRole( array $roles ) |
|
64 | + protected function hasRole(array $roles) |
|
65 | 65 | { |
66 | - if( $this->has( 'security.authorization_checker' ) && $this->get( 'security.token_storage' )->getToken() ) |
|
66 | + if ($this->has('security.authorization_checker') && $this->get('security.token_storage')->getToken()) |
|
67 | 67 | { |
68 | - $checker = $this->get( 'security.authorization_checker' ); |
|
68 | + $checker = $this->get('security.authorization_checker'); |
|
69 | 69 | |
70 | - foreach( $roles as $role ) |
|
70 | + foreach ($roles as $role) |
|
71 | 71 | { |
72 | - if( $checker->isGranted( $role ) ) { |
|
72 | + if ($checker->isGranted($role)) { |
|
73 | 73 | return true; |
74 | 74 | } |
75 | 75 | } |
@@ -29,13 +29,13 @@ discard block |
||
29 | 29 | */ |
30 | 30 | protected function configure() |
31 | 31 | { |
32 | - $this->setName( 'aimeos:account'); |
|
33 | - $this->setDescription( 'Creates new (admin) accounts' ); |
|
34 | - $this->addArgument( 'email', InputArgument::REQUIRED, 'E-mail address of the account that should be created' ); |
|
35 | - $this->addArgument( 'site', InputArgument::OPTIONAL, 'Site codes to create accounts for like "default"', 'default' ); |
|
36 | - $this->addOption( 'password', null, InputOption::VALUE_REQUIRED, 'Optional password for the account (will ask for if not given)' ); |
|
37 | - $this->addOption( 'admin', null, InputOption::VALUE_NONE, 'If account should have administrator privileges' ); |
|
38 | - $this->addOption( 'editor', null, InputOption::VALUE_NONE, 'If account should have limited editor privileges' ); |
|
32 | + $this->setName('aimeos:account'); |
|
33 | + $this->setDescription('Creates new (admin) accounts'); |
|
34 | + $this->addArgument('email', InputArgument::REQUIRED, 'E-mail address of the account that should be created'); |
|
35 | + $this->addArgument('site', InputArgument::OPTIONAL, 'Site codes to create accounts for like "default"', 'default'); |
|
36 | + $this->addOption('password', null, InputOption::VALUE_REQUIRED, 'Optional password for the account (will ask for if not given)'); |
|
37 | + $this->addOption('admin', null, InputOption::VALUE_NONE, 'If account should have administrator privileges'); |
|
38 | + $this->addOption('editor', null, InputOption::VALUE_NONE, 'If account should have limited editor privileges'); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | |
@@ -45,33 +45,33 @@ discard block |
||
45 | 45 | * @param InputInterface $input Input object |
46 | 46 | * @param OutputInterface $output Output object |
47 | 47 | */ |
48 | - protected function execute( InputInterface $input, OutputInterface $output ) |
|
48 | + protected function execute(InputInterface $input, OutputInterface $output) |
|
49 | 49 | { |
50 | - $code = $input->getArgument( 'email' ); |
|
51 | - if( ( $password = $input->getOption( 'password' ) ) === null ) |
|
50 | + $code = $input->getArgument('email'); |
|
51 | + if (($password = $input->getOption('password')) === null) |
|
52 | 52 | { |
53 | - $helper = $this->getHelper( 'question' ); |
|
54 | - $question = new Question( 'Password' ); |
|
55 | - $question->setHidden( true ); |
|
53 | + $helper = $this->getHelper('question'); |
|
54 | + $question = new Question('Password'); |
|
55 | + $question->setHidden(true); |
|
56 | 56 | |
57 | - $password = $helper->ask( $input, $output, $question ); |
|
57 | + $password = $helper->ask($input, $output, $question); |
|
58 | 58 | } |
59 | 59 | |
60 | - $context = $this->getContainer()->get( 'aimeos_context' )->get( false, 'command' ); |
|
61 | - $context->setEditor( 'aimeos:account' ); |
|
60 | + $context = $this->getContainer()->get('aimeos_context')->get(false, 'command'); |
|
61 | + $context->setEditor('aimeos:account'); |
|
62 | 62 | |
63 | - $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context ); |
|
64 | - $localeItem = $localeManager->bootstrap( $input->getArgument( 'site' ), '', '', false ); |
|
65 | - $context->setLocale( $localeItem ); |
|
63 | + $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context); |
|
64 | + $localeItem = $localeManager->bootstrap($input->getArgument('site'), '', '', false); |
|
65 | + $context->setLocale($localeItem); |
|
66 | 66 | |
67 | - $user = $this->createCustomerItem( $context, $code, $password ); |
|
67 | + $user = $this->createCustomerItem($context, $code, $password); |
|
68 | 68 | |
69 | - if( $input->getOption( 'admin' ) ) { |
|
70 | - $this->addGroup( $input, $output, $context, $user, 'admin' ); |
|
69 | + if ($input->getOption('admin')) { |
|
70 | + $this->addGroup($input, $output, $context, $user, 'admin'); |
|
71 | 71 | } |
72 | 72 | |
73 | - if( $input->getOption( 'editor' ) ) { |
|
74 | - $this->addGroup( $input, $output, $context, $user, 'editor' ); |
|
73 | + if ($input->getOption('editor')) { |
|
74 | + $this->addGroup($input, $output, $context, $user, 'editor'); |
|
75 | 75 | } |
76 | 76 | } |
77 | 77 | |
@@ -85,24 +85,24 @@ discard block |
||
85 | 85 | * @param \Aimeos\MShop\Customer\Item\Iface $user Aimeos customer object |
86 | 86 | * @param string $group Unique customer group code |
87 | 87 | */ |
88 | - protected function addGroup( InputInterface $input, OutputInterface $output, |
|
89 | - \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\MShop\Customer\Item\Iface $user, $group ) |
|
88 | + protected function addGroup(InputInterface $input, OutputInterface $output, |
|
89 | + \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\MShop\Customer\Item\Iface $user, $group) |
|
90 | 90 | { |
91 | - $output->writeln( sprintf( 'Add "%1$s" group to user "%2$s" for sites', $group, $user->getCode() ) ); |
|
91 | + $output->writeln(sprintf('Add "%1$s" group to user "%2$s" for sites', $group, $user->getCode())); |
|
92 | 92 | |
93 | - $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context ); |
|
93 | + $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context); |
|
94 | 94 | |
95 | - foreach( $this->getSiteItems( $context, $input ) as $siteItem ) |
|
95 | + foreach ($this->getSiteItems($context, $input) as $siteItem) |
|
96 | 96 | { |
97 | - $localeItem = $localeManager->bootstrap( $siteItem->getCode(), '', '', false ); |
|
97 | + $localeItem = $localeManager->bootstrap($siteItem->getCode(), '', '', false); |
|
98 | 98 | |
99 | 99 | $lcontext = clone $context; |
100 | - $lcontext->setLocale( $localeItem ); |
|
100 | + $lcontext->setLocale($localeItem); |
|
101 | 101 | |
102 | - $output->writeln( '- ' . $siteItem->getCode() ); |
|
102 | + $output->writeln('- '.$siteItem->getCode()); |
|
103 | 103 | |
104 | - $groupItem = $this->getGroupItem( $lcontext, $group ); |
|
105 | - $this->addListItem( $lcontext, $user->getId(), $groupItem->getId() ); |
|
104 | + $groupItem = $this->getGroupItem($lcontext, $group); |
|
105 | + $this->addListItem($lcontext, $user->getId(), $groupItem->getId()); |
|
106 | 106 | } |
107 | 107 | } |
108 | 108 | |
@@ -114,31 +114,31 @@ discard block |
||
114 | 114 | * @param string $userid Unique user ID |
115 | 115 | * @param string $groupid Unique group ID |
116 | 116 | */ |
117 | - protected function addListItem( \Aimeos\MShop\Context\Item\Iface $context, $userid, $groupid ) |
|
117 | + protected function addListItem(\Aimeos\MShop\Context\Item\Iface $context, $userid, $groupid) |
|
118 | 118 | { |
119 | - $manager = \Aimeos\MShop\Customer\Manager\Factory::createManager( $context )->getSubmanager( 'lists' ); |
|
120 | - $typeid = $manager->getSubmanager( 'type' )->findItem( 'default', array(), 'customer/group' )->getId(); |
|
119 | + $manager = \Aimeos\MShop\Customer\Manager\Factory::createManager($context)->getSubmanager('lists'); |
|
120 | + $typeid = $manager->getSubmanager('type')->findItem('default', array(), 'customer/group')->getId(); |
|
121 | 121 | |
122 | 122 | $search = $manager->createSearch(); |
123 | 123 | $expr = array( |
124 | - $search->compare( '==', 'customer.lists.parentid', $userid ), |
|
125 | - $search->compare( '==', 'customer.lists.refid', $groupid ), |
|
126 | - $search->compare( '==', 'customer.lists.domain', 'customer/group' ), |
|
127 | - $search->compare( '==', 'customer.lists.typeid', $typeid ), |
|
124 | + $search->compare('==', 'customer.lists.parentid', $userid), |
|
125 | + $search->compare('==', 'customer.lists.refid', $groupid), |
|
126 | + $search->compare('==', 'customer.lists.domain', 'customer/group'), |
|
127 | + $search->compare('==', 'customer.lists.typeid', $typeid), |
|
128 | 128 | ); |
129 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
130 | - $search->setSlice( 0, 1 ); |
|
129 | + $search->setConditions($search->combine('&&', $expr)); |
|
130 | + $search->setSlice(0, 1); |
|
131 | 131 | |
132 | - if( count( $manager->searchItems( $search ) ) === 0 ) |
|
132 | + if (count($manager->searchItems($search)) === 0) |
|
133 | 133 | { |
134 | 134 | $item = $manager->createItem(); |
135 | - $item->setDomain( 'customer/group' ); |
|
136 | - $item->setParentId( $userid ); |
|
137 | - $item->setTypeId( $typeid ); |
|
138 | - $item->setRefId( $groupid ); |
|
139 | - $item->setStatus( 1 ); |
|
135 | + $item->setDomain('customer/group'); |
|
136 | + $item->setParentId($userid); |
|
137 | + $item->setTypeId($typeid); |
|
138 | + $item->setRefId($groupid); |
|
139 | + $item->setStatus(1); |
|
140 | 140 | |
141 | - $manager->saveItem( $item, false ); |
|
141 | + $manager->saveItem($item, false); |
|
142 | 142 | } |
143 | 143 | } |
144 | 144 | |
@@ -153,23 +153,23 @@ discard block |
||
153 | 153 | * @param string $password New user password |
154 | 154 | * @return \Aimeos\MShop\Customer\Item\Iface Aimeos customer item object |
155 | 155 | */ |
156 | - protected function createCustomerItem( \Aimeos\MShop\Context\Item\Iface $context, $email, $password ) |
|
156 | + protected function createCustomerItem(\Aimeos\MShop\Context\Item\Iface $context, $email, $password) |
|
157 | 157 | { |
158 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'customer' ); |
|
158 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'customer'); |
|
159 | 159 | |
160 | 160 | try { |
161 | - $item = $manager->findItem( $email ); |
|
162 | - } catch( \Aimeos\MShop\Exception $e ) { |
|
161 | + $item = $manager->findItem($email); |
|
162 | + } catch (\Aimeos\MShop\Exception $e) { |
|
163 | 163 | $item = $manager->createItem(); |
164 | 164 | } |
165 | 165 | |
166 | - $item->setCode( $email ); |
|
167 | - $item->setLabel( $email ); |
|
168 | - $item->getPaymentAddress()->setEmail( $email ); |
|
169 | - $item->setPassword( $password ); |
|
170 | - $item->setStatus( 1 ); |
|
166 | + $item->setCode($email); |
|
167 | + $item->setLabel($email); |
|
168 | + $item->getPaymentAddress()->setEmail($email); |
|
169 | + $item->setPassword($password); |
|
170 | + $item->setStatus(1); |
|
171 | 171 | |
172 | - $manager->saveItem( $item ); |
|
172 | + $manager->saveItem($item); |
|
173 | 173 | |
174 | 174 | return $item; |
175 | 175 | } |
@@ -182,21 +182,21 @@ discard block |
||
182 | 182 | * @param string $code Unique customer group code |
183 | 183 | * @return \Aimeos\MShop\Customer\Item\Group\Iface Aimeos customer group item object |
184 | 184 | */ |
185 | - protected function getGroupItem( \Aimeos\MShop\Context\Item\Iface $context, $code ) |
|
185 | + protected function getGroupItem(\Aimeos\MShop\Context\Item\Iface $context, $code) |
|
186 | 186 | { |
187 | - $manager = \Aimeos\MShop\Customer\Manager\Factory::createManager( $context )->getSubmanager( 'group' ); |
|
187 | + $manager = \Aimeos\MShop\Customer\Manager\Factory::createManager($context)->getSubmanager('group'); |
|
188 | 188 | |
189 | 189 | try |
190 | 190 | { |
191 | - $item = $manager->findItem( $code ); |
|
191 | + $item = $manager->findItem($code); |
|
192 | 192 | } |
193 | - catch( \Aimeos\MShop\Exception $e ) |
|
193 | + catch (\Aimeos\MShop\Exception $e) |
|
194 | 194 | { |
195 | 195 | $item = $manager->createItem(); |
196 | - $item->setLabel( $code ); |
|
197 | - $item->setCode( $code ); |
|
196 | + $item->setLabel($code); |
|
197 | + $item->setCode($code); |
|
198 | 198 | |
199 | - $manager->saveItem( $item ); |
|
199 | + $manager->saveItem($item); |
|
200 | 200 | } |
201 | 201 | |
202 | 202 | return $item; |
@@ -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,17 +102,17 @@ 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 ); |
|
107 | + $cntl = $this->createClient($request, $site, $resource); |
|
108 | 108 | |
109 | 109 | $cntl = $this->createClient(); |
110 | 110 | |
111 | - if( ( $html = $cntl->delete() ) == '' ) { |
|
111 | + if (($html = $cntl->delete()) == '') { |
|
112 | 112 | return $cntl->getView()->response(); |
113 | 113 | } |
114 | 114 | |
115 | - return $this->getHtml( $html ); |
|
115 | + return $this->getHtml($html); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | |
@@ -124,10 +124,10 @@ discard block |
||
124 | 124 | * @param string $site Unique site code |
125 | 125 | * @return Response Generated output |
126 | 126 | */ |
127 | - public function getAction( Request $request, $resource, $site = 'default' ) |
|
127 | + public function getAction(Request $request, $resource, $site = 'default') |
|
128 | 128 | { |
129 | - $cntl = $this->createClient( $request, $site, $resource ); |
|
130 | - return $this->getHtml( $cntl->get() ); |
|
129 | + $cntl = $this->createClient($request, $site, $resource); |
|
130 | + return $this->getHtml($cntl->get()); |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | |
@@ -139,15 +139,15 @@ discard block |
||
139 | 139 | * @param string $site Unique site code |
140 | 140 | * @return Response Generated output |
141 | 141 | */ |
142 | - public function saveAction( Request $request, $resource, $site = 'default' ) |
|
142 | + public function saveAction(Request $request, $resource, $site = 'default') |
|
143 | 143 | { |
144 | - $cntl = $this->createClient( $request, $site, $resource ); |
|
144 | + $cntl = $this->createClient($request, $site, $resource); |
|
145 | 145 | |
146 | - if( ( $html = $cntl->save() ) == '' ) { |
|
146 | + if (($html = $cntl->save()) == '') { |
|
147 | 147 | return $cntl->getView()->response(); |
148 | 148 | } |
149 | 149 | |
150 | - return $this->getHtml( $html ); |
|
150 | + return $this->getHtml($html); |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | |
@@ -159,10 +159,10 @@ discard block |
||
159 | 159 | * @param string $site Unique site code |
160 | 160 | * @return Response Generated output |
161 | 161 | */ |
162 | - public function searchAction( Request $request, $resource, $site = 'default' ) |
|
162 | + public function searchAction(Request $request, $resource, $site = 'default') |
|
163 | 163 | { |
164 | - $cntl = $this->createClient( $request, $site, $resource ); |
|
165 | - return $this->getHtml( $cntl->search() ); |
|
164 | + $cntl = $this->createClient($request, $site, $resource); |
|
165 | + return $this->getHtml($cntl->search()); |
|
166 | 166 | } |
167 | 167 | |
168 | 168 | |
@@ -174,21 +174,21 @@ discard block |
||
174 | 174 | * @param string $resource Resource location, e.g. "product" |
175 | 175 | * @return \Aimeos\Admin\JQAdm\Iface Context item |
176 | 176 | */ |
177 | - protected function createClient( Request $request, $site, $resource ) |
|
177 | + protected function createClient(Request $request, $site, $resource) |
|
178 | 178 | { |
179 | - $lang = $request->get( 'lang', 'en' ); |
|
179 | + $lang = $request->get('lang', 'en'); |
|
180 | 180 | |
181 | - $aimeos = $this->get( 'aimeos' )->get(); |
|
182 | - $templatePaths = $aimeos->getCustomPaths( 'admin/jqadm/templates' ); |
|
181 | + $aimeos = $this->get('aimeos')->get(); |
|
182 | + $templatePaths = $aimeos->getCustomPaths('admin/jqadm/templates'); |
|
183 | 183 | |
184 | - $context = $this->get( 'aimeos_context' )->get( false, 'backend' ); |
|
185 | - $context->setI18n( $this->get( 'aimeos_i18n' )->get( array( $lang, 'en' ) ) ); |
|
186 | - $context->setLocale( $this->get( 'aimeos_locale' )->getBackend( $context, $site ) ); |
|
184 | + $context = $this->get('aimeos_context')->get(false, 'backend'); |
|
185 | + $context->setI18n($this->get('aimeos_i18n')->get(array($lang, 'en'))); |
|
186 | + $context->setLocale($this->get('aimeos_locale')->getBackend($context, $site)); |
|
187 | 187 | |
188 | - $view = $this->get( 'aimeos_view' )->create( $context, $templatePaths, $lang ); |
|
189 | - $context->setView( $view ); |
|
188 | + $view = $this->get('aimeos_view')->create($context, $templatePaths, $lang); |
|
189 | + $context->setView($view); |
|
190 | 190 | |
191 | - return \Aimeos\Admin\JQAdm\Factory::createClient( $context, $templatePaths, $resource )->setAimeos( $aimeos ); |
|
191 | + return \Aimeos\Admin\JQAdm\Factory::createClient($context, $templatePaths, $resource)->setAimeos($aimeos); |
|
192 | 192 | } |
193 | 193 | |
194 | 194 | |
@@ -198,12 +198,12 @@ discard block |
||
198 | 198 | * @param string $content Content from admin client |
199 | 199 | * @return Response View for rendering the output |
200 | 200 | */ |
201 | - protected function getHtml( $content ) |
|
201 | + protected function getHtml($content) |
|
202 | 202 | { |
203 | - $version = $this->get( 'aimeos' )->getVersion(); |
|
204 | - $extnames = implode( ',', $this->get( 'aimeos' )->get()->getExtensions() ); |
|
205 | - $content = str_replace( ['{type}', '{version}', '{extensions}'], ['Symfony', $version, $extnames], $content ); |
|
203 | + $version = $this->get('aimeos')->getVersion(); |
|
204 | + $extnames = implode(',', $this->get('aimeos')->get()->getExtensions()); |
|
205 | + $content = str_replace(['{type}', '{version}', '{extensions}'], ['Symfony', $version, $extnames], $content); |
|
206 | 206 | |
207 | - return $this->render( 'AimeosShopBundle:Jqadm:index.html.twig', array( 'content' => $content ) ); |
|
207 | + return $this->render('AimeosShopBundle:Jqadm:index.html.twig', array('content' => $content)); |
|
208 | 208 | } |
209 | 209 | } |