@@ -31,10 +31,10 @@ discard block |
||
31 | 31 | * @param string $site Unique site code |
32 | 32 | * @return string Generated output |
33 | 33 | */ |
34 | - public function copyAction( Request $request, $resource, $site = 'default' ) |
|
34 | + public function copyAction(Request $request, $resource, $site = 'default') |
|
35 | 35 | { |
36 | - $cntl = $this->createClient( $request, $site, $resource ); |
|
37 | - return $this->getHtml( $cntl->copy() ); |
|
36 | + $cntl = $this->createClient($request, $site, $resource); |
|
37 | + return $this->getHtml($cntl->copy()); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | |
@@ -46,10 +46,10 @@ discard block |
||
46 | 46 | * @param string $site Unique site code |
47 | 47 | * @return string Generated output |
48 | 48 | */ |
49 | - public function createAction( Request $request, $resource, $site = 'default' ) |
|
49 | + public function createAction(Request $request, $resource, $site = 'default') |
|
50 | 50 | { |
51 | - $cntl = $this->createClient( $request, $site, $resource ); |
|
52 | - return $this->getHtml( $cntl->create() ); |
|
51 | + $cntl = $this->createClient($request, $site, $resource); |
|
52 | + return $this->getHtml($cntl->create()); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | |
@@ -61,10 +61,10 @@ discard block |
||
61 | 61 | * @param string $site Unique site code |
62 | 62 | * @return string Generated output |
63 | 63 | */ |
64 | - public function deleteAction( Request $request, $resource, $site = 'default' ) |
|
64 | + public function deleteAction(Request $request, $resource, $site = 'default') |
|
65 | 65 | { |
66 | - $cntl = $this->createClient( $request, $site, $resource ); |
|
67 | - return $this->getHtml( $cntl->delete() . $cntl->search() ); |
|
66 | + $cntl = $this->createClient($request, $site, $resource); |
|
67 | + return $this->getHtml($cntl->delete() . $cntl->search()); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | |
@@ -76,10 +76,10 @@ discard block |
||
76 | 76 | * @param string $site Unique site code |
77 | 77 | * @return string Generated output |
78 | 78 | */ |
79 | - public function getAction( Request $request, $resource, $site = 'default' ) |
|
79 | + public function getAction(Request $request, $resource, $site = 'default') |
|
80 | 80 | { |
81 | - $cntl = $this->createClient( $request, $site, $resource ); |
|
82 | - return $this->getHtml( $cntl->get() ); |
|
81 | + $cntl = $this->createClient($request, $site, $resource); |
|
82 | + return $this->getHtml($cntl->get()); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | |
@@ -91,10 +91,10 @@ discard block |
||
91 | 91 | * @param string $site Unique site code |
92 | 92 | * @return string Generated output |
93 | 93 | */ |
94 | - public function saveAction( Request $request, $resource, $site = 'default' ) |
|
94 | + public function saveAction(Request $request, $resource, $site = 'default') |
|
95 | 95 | { |
96 | - $cntl = $this->createClient( $request, $site, $resource ); |
|
97 | - return $this->getHtml( ( $cntl->save() ? : $cntl->search() ) ); |
|
96 | + $cntl = $this->createClient($request, $site, $resource); |
|
97 | + return $this->getHtml(($cntl->save() ?: $cntl->search())); |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | |
@@ -106,10 +106,10 @@ discard block |
||
106 | 106 | * @param string $site Unique site code |
107 | 107 | * @return string Generated output |
108 | 108 | */ |
109 | - public function searchAction( Request $request, $resource, $site = 'default' ) |
|
109 | + public function searchAction(Request $request, $resource, $site = 'default') |
|
110 | 110 | { |
111 | - $cntl = $this->createClient( $request, $site, $resource ); |
|
112 | - return $this->getHtml( $cntl->search() ); |
|
111 | + $cntl = $this->createClient($request, $site, $resource); |
|
112 | + return $this->getHtml($cntl->search()); |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | |
@@ -121,20 +121,20 @@ discard block |
||
121 | 121 | * @param string $resource Resource location, e.g. "product" |
122 | 122 | * @return \Aimeos\MShop\Context\Item\Iface Context item |
123 | 123 | */ |
124 | - protected function createClient( Request $request, $site, $resource ) |
|
124 | + protected function createClient(Request $request, $site, $resource) |
|
125 | 125 | { |
126 | - $lang = $request->get( 'lang', 'en' ); |
|
126 | + $lang = $request->get('lang', 'en'); |
|
127 | 127 | |
128 | - $aimeos = $this->get( 'aimeos' )->get(); |
|
129 | - $templatePaths = $aimeos->getCustomPaths( 'admin/jqadm/templates' ); |
|
128 | + $aimeos = $this->get('aimeos')->get(); |
|
129 | + $templatePaths = $aimeos->getCustomPaths('admin/jqadm/templates'); |
|
130 | 130 | |
131 | - $context = $this->get( 'aimeos_context' )->get( false ); |
|
132 | - $context = $this->setLocale( $context, $site, $lang ); |
|
131 | + $context = $this->get('aimeos_context')->get(false); |
|
132 | + $context = $this->setLocale($context, $site, $lang); |
|
133 | 133 | |
134 | - $view = $this->get( 'aimeos_view' )->create( $context->getConfig(), $templatePaths, $lang ); |
|
135 | - $context->setView( $view ); |
|
134 | + $view = $this->get('aimeos_view')->create($context->getConfig(), $templatePaths, $lang); |
|
135 | + $context->setView($view); |
|
136 | 136 | |
137 | - return \Aimeos\Admin\JQAdm\Factory::createClient( $context, $templatePaths, $resource ); |
|
137 | + return \Aimeos\Admin\JQAdm\Factory::createClient($context, $templatePaths, $resource); |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | |
@@ -144,12 +144,12 @@ discard block |
||
144 | 144 | * @param string $content Content from admin client |
145 | 145 | * @return \Illuminate\Contracts\View\View View for rendering the output |
146 | 146 | */ |
147 | - protected function getHtml( $content ) |
|
147 | + protected function getHtml($content) |
|
148 | 148 | { |
149 | - $version = $this->get( 'aimeos' )->getVersion(); |
|
150 | - $content = str_replace( array( '{type}', '{version}' ), array( 'Symfony', $version ), $content ); |
|
149 | + $version = $this->get('aimeos')->getVersion(); |
|
150 | + $content = str_replace(array('{type}', '{version}'), array('Symfony', $version), $content); |
|
151 | 151 | |
152 | - return $this->render( 'AimeosShopBundle:Jqadm:index.html.twig', array( 'content' => $content ) ); |
|
152 | + return $this->render('AimeosShopBundle:Jqadm:index.html.twig', array('content' => $content)); |
|
153 | 153 | } |
154 | 154 | |
155 | 155 | |
@@ -161,23 +161,23 @@ discard block |
||
161 | 161 | * @param string $lang ISO language code, e.g. "en" or "en_GB" |
162 | 162 | * @return \Aimeos\MShop\Context\Item\Iface Modified context object |
163 | 163 | */ |
164 | - protected function setLocale( \Aimeos\MShop\Context\Item\Iface $context, $site = 'default', $lang = null ) |
|
164 | + protected function setLocale(\Aimeos\MShop\Context\Item\Iface $context, $site = 'default', $lang = null) |
|
165 | 165 | { |
166 | - $localeManager = \Aimeos\MShop\Factory::createManager( $context, 'locale' ); |
|
166 | + $localeManager = \Aimeos\MShop\Factory::createManager($context, 'locale'); |
|
167 | 167 | |
168 | 168 | try |
169 | 169 | { |
170 | - $localeItem = $localeManager->bootstrap( $site, '', '', false ); |
|
171 | - $localeItem->setLanguageId( null ); |
|
172 | - $localeItem->setCurrencyId( null ); |
|
170 | + $localeItem = $localeManager->bootstrap($site, '', '', false); |
|
171 | + $localeItem->setLanguageId(null); |
|
172 | + $localeItem->setCurrencyId(null); |
|
173 | 173 | } |
174 | - catch( \Aimeos\MShop\Locale\Exception $e ) |
|
174 | + catch (\Aimeos\MShop\Locale\Exception $e) |
|
175 | 175 | { |
176 | 176 | $localeItem = $localeManager->createItem(); |
177 | 177 | } |
178 | 178 | |
179 | - $context->setLocale( $localeItem ); |
|
180 | - $context->setI18n( $this->get( 'aimeos_i18n' )->get( array( $lang ) ) ); |
|
179 | + $context->setLocale($localeItem); |
|
180 | + $context->setI18n($this->get('aimeos_i18n')->get(array($lang))); |
|
181 | 181 | |
182 | 182 | return $context; |
183 | 183 | } |