@@ -34,63 +34,63 @@ discard block |
||
34 | 34 | * @param \Illuminate\Http\Request $request Laravel request object |
35 | 35 | * @return \Illuminate\Contracts\View\View View for rendering the output |
36 | 36 | */ |
37 | - public function indexAction( Request $request ) |
|
37 | + public function indexAction(Request $request) |
|
38 | 38 | { |
39 | - if( config( 'shop.authorize', true ) ) { |
|
40 | - $this->authorize( 'admin' ); |
|
39 | + if (config('shop.authorize', true)) { |
|
40 | + $this->authorize('admin'); |
|
41 | 41 | } |
42 | 42 | |
43 | - $site = Route::input( 'site', 'default' ); |
|
44 | - $lang = Input::get( 'lang', config( 'app.locale', 'en' ) ); |
|
43 | + $site = Route::input('site', 'default'); |
|
44 | + $lang = Input::get('lang', config('app.locale', 'en')); |
|
45 | 45 | |
46 | - $aimeos = app( '\Aimeos\Shop\Base\Aimeos' ); |
|
46 | + $aimeos = app('\Aimeos\Shop\Base\Aimeos'); |
|
47 | 47 | |
48 | 48 | $bootstrap = $aimeos->get(); |
49 | - $cntlPaths = $bootstrap->getCustomPaths( 'controller/extjs' ); |
|
49 | + $cntlPaths = $bootstrap->getCustomPaths('controller/extjs'); |
|
50 | 50 | |
51 | - $context = app( '\Aimeos\Shop\Base\Context' )->get( false ); |
|
52 | - $context = $this->setLocale( $context, $site, $lang ); |
|
51 | + $context = app('\Aimeos\Shop\Base\Context')->get(false); |
|
52 | + $context = $this->setLocale($context, $site, $lang); |
|
53 | 53 | |
54 | - $controller = new \Aimeos\Controller\ExtJS\JsonRpc( $context, $cntlPaths ); |
|
54 | + $controller = new \Aimeos\Controller\ExtJS\JsonRpc($context, $cntlPaths); |
|
55 | 55 | $cssFiles = array(); |
56 | 56 | |
57 | - foreach( $bootstrap->getCustomPaths( 'admin/extjs' ) as $base => $paths ) |
|
57 | + foreach ($bootstrap->getCustomPaths('admin/extjs') as $base => $paths) |
|
58 | 58 | { |
59 | - foreach( $paths as $path ) |
|
59 | + foreach ($paths as $path) |
|
60 | 60 | { |
61 | 61 | $jsbAbsPath = $base . '/' . $path; |
62 | 62 | |
63 | - if( !is_file( $jsbAbsPath ) ) { |
|
64 | - throw new \Exception( sprintf( 'JSB2 file "%1$s" not found', $jsbAbsPath ) ); |
|
63 | + if (!is_file($jsbAbsPath)) { |
|
64 | + throw new \Exception(sprintf('JSB2 file "%1$s" not found', $jsbAbsPath)); |
|
65 | 65 | } |
66 | 66 | |
67 | - $jsb2 = new \Aimeos\MW\Jsb2\Standard( $jsbAbsPath, dirname( $path ) ); |
|
68 | - $cssFiles = array_merge( $cssFiles, $jsb2->getUrls( 'css' ) ); |
|
67 | + $jsb2 = new \Aimeos\MW\Jsb2\Standard($jsbAbsPath, dirname($path)); |
|
68 | + $cssFiles = array_merge($cssFiles, $jsb2->getUrls('css')); |
|
69 | 69 | } |
70 | 70 | } |
71 | 71 | |
72 | - $jqadmUrl = route( 'aimeos_shop_jqadm_search', array( 'site' => $site, 'resource' => 'product' ) ); |
|
73 | - $jsonUrl = route( 'aimeos_shop_extadm_json', array( 'site' => $site, '_token' => csrf_token() ) ); |
|
74 | - $adminUrl = route( 'aimeos_shop_extadm', array( 'site' => '<site>', 'lang' => '<lang>', 'tab' => '<tab>' ) ); |
|
72 | + $jqadmUrl = route('aimeos_shop_jqadm_search', array('site' => $site, 'resource' => 'product')); |
|
73 | + $jsonUrl = route('aimeos_shop_extadm_json', array('site' => $site, '_token' => csrf_token())); |
|
74 | + $adminUrl = route('aimeos_shop_extadm', array('site' => '<site>', 'lang' => '<lang>', 'tab' => '<tab>')); |
|
75 | 75 | |
76 | 76 | $vars = array( |
77 | 77 | 'lang' => $lang, |
78 | 78 | 'cssFiles' => $cssFiles, |
79 | - 'languages' => $this->getJsonLanguages( $context), |
|
80 | - 'config' => $this->getJsonClientConfig( $context ), |
|
81 | - 'site' => $this->getJsonSiteItem( $context, $site ), |
|
82 | - 'i18nContent' => $this->getJsonClientI18n( $bootstrap->getI18nPaths(), $lang ), |
|
79 | + 'languages' => $this->getJsonLanguages($context), |
|
80 | + 'config' => $this->getJsonClientConfig($context), |
|
81 | + 'site' => $this->getJsonSiteItem($context, $site), |
|
82 | + 'i18nContent' => $this->getJsonClientI18n($bootstrap->getI18nPaths(), $lang), |
|
83 | 83 | 'searchSchemas' => $controller->getJsonSearchSchemas(), |
84 | 84 | 'itemSchemas' => $controller->getJsonItemSchemas(), |
85 | - 'smd' => $controller->getJsonSmd( $jsonUrl ), |
|
86 | - 'urlTemplate' => str_replace( ['<', '>'], ['{', '}'], urldecode( $adminUrl ) ), |
|
87 | - 'uploaddir' => config( 'shop::uploaddir' ), |
|
88 | - 'activeTab' => Input::get( 'tab', 0 ), |
|
85 | + 'smd' => $controller->getJsonSmd($jsonUrl), |
|
86 | + 'urlTemplate' => str_replace(['<', '>'], ['{', '}'], urldecode($adminUrl)), |
|
87 | + 'uploaddir' => config('shop::uploaddir'), |
|
88 | + 'activeTab' => Input::get('tab', 0), |
|
89 | 89 | 'version' => $aimeos->getVersion(), |
90 | 90 | 'jqadmurl' => $jqadmUrl, |
91 | 91 | ); |
92 | 92 | |
93 | - return View::make( 'shop::extadm.index', $vars ); |
|
93 | + return View::make('shop::extadm.index', $vars); |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | |
@@ -101,20 +101,20 @@ discard block |
||
101 | 101 | */ |
102 | 102 | public function doAction() |
103 | 103 | { |
104 | - if( config( 'shop.authorize', true ) ) { |
|
105 | - $this->authorize( 'admin' ); |
|
104 | + if (config('shop.authorize', true)) { |
|
105 | + $this->authorize('admin'); |
|
106 | 106 | } |
107 | 107 | |
108 | - $aimeos = app( '\Aimeos\Shop\Base\Aimeos' )->get(); |
|
109 | - $cntlPaths = $aimeos->getCustomPaths( 'controller/extjs' ); |
|
108 | + $aimeos = app('\Aimeos\Shop\Base\Aimeos')->get(); |
|
109 | + $cntlPaths = $aimeos->getCustomPaths('controller/extjs'); |
|
110 | 110 | |
111 | - $context = app( '\Aimeos\Shop\Base\Context' )->get( false ); |
|
112 | - $context = $this->setLocale( $context ); |
|
111 | + $context = app('\Aimeos\Shop\Base\Context')->get(false); |
|
112 | + $context = $this->setLocale($context); |
|
113 | 113 | |
114 | - $controller = new \Aimeos\Controller\ExtJS\JsonRpc( $context, $cntlPaths ); |
|
114 | + $controller = new \Aimeos\Controller\ExtJS\JsonRpc($context, $cntlPaths); |
|
115 | 115 | |
116 | - $response = $controller->process( Input::instance()->request->all(), 'php://input' ); |
|
117 | - return View::make( 'shop::extadm.do', array( 'output' => $response ) ); |
|
116 | + $response = $controller->process(Input::instance()->request->all(), 'php://input'); |
|
117 | + return View::make('shop::extadm.do', array('output' => $response)); |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | |
@@ -125,32 +125,32 @@ discard block |
||
125 | 125 | */ |
126 | 126 | public function fileAction() |
127 | 127 | { |
128 | - if( config( 'shop.authorize', true ) ) { |
|
129 | - $this->authorize( 'admin' ); |
|
128 | + if (config('shop.authorize', true)) { |
|
129 | + $this->authorize('admin'); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | $contents = ''; |
133 | 133 | $jsFiles = array(); |
134 | - $aimeos = app( '\Aimeos\Shop\Base\Aimeos' )->get(); |
|
134 | + $aimeos = app('\Aimeos\Shop\Base\Aimeos')->get(); |
|
135 | 135 | |
136 | - foreach( $aimeos->getCustomPaths( 'admin/extjs' ) as $base => $paths ) |
|
136 | + foreach ($aimeos->getCustomPaths('admin/extjs') as $base => $paths) |
|
137 | 137 | { |
138 | - foreach( $paths as $path ) |
|
138 | + foreach ($paths as $path) |
|
139 | 139 | { |
140 | 140 | $jsbAbsPath = $base . '/' . $path; |
141 | - $jsb2 = new \Aimeos\MW\Jsb2\Standard( $jsbAbsPath, dirname( $jsbAbsPath ) ); |
|
142 | - $jsFiles = array_merge( $jsFiles, $jsb2->getFiles( 'js' ) ); |
|
141 | + $jsb2 = new \Aimeos\MW\Jsb2\Standard($jsbAbsPath, dirname($jsbAbsPath)); |
|
142 | + $jsFiles = array_merge($jsFiles, $jsb2->getFiles('js')); |
|
143 | 143 | } |
144 | 144 | } |
145 | 145 | |
146 | - foreach( $jsFiles as $file ) |
|
146 | + foreach ($jsFiles as $file) |
|
147 | 147 | { |
148 | - if( ( $content = file_get_contents( $file ) ) !== false ) { |
|
148 | + if (($content = file_get_contents($file)) !== false) { |
|
149 | 149 | $contents .= $content; |
150 | 150 | } |
151 | 151 | } |
152 | 152 | |
153 | - return response( $contents )->header( 'Content-Type', 'application/javascript' ); |
|
153 | + return response($contents)->header('Content-Type', 'application/javascript'); |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | |
@@ -160,15 +160,15 @@ discard block |
||
160 | 160 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object |
161 | 161 | * @return array List of language IDs with labels |
162 | 162 | */ |
163 | - protected function getJsonLanguages( \Aimeos\MShop\Context\Item\Iface $context ) |
|
163 | + protected function getJsonLanguages(\Aimeos\MShop\Context\Item\Iface $context) |
|
164 | 164 | { |
165 | 165 | $result = array(); |
166 | 166 | |
167 | - foreach( app( '\Aimeos\Shop\Base\Aimeos' )->get()->getI18nList( 'admin' ) as $id ) { |
|
168 | - $result[] = array( 'id' => $id, 'label' => $id ); |
|
167 | + foreach (app('\Aimeos\Shop\Base\Aimeos')->get()->getI18nList('admin') as $id) { |
|
168 | + $result[] = array('id' => $id, 'label' => $id); |
|
169 | 169 | } |
170 | 170 | |
171 | - return json_encode( $result ); |
|
171 | + return json_encode($result); |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | |
@@ -178,10 +178,10 @@ discard block |
||
178 | 178 | * @param \Aimeos\MShop\Context\Item\Iface $context Context item object |
179 | 179 | * @return string JSON encoded configuration object |
180 | 180 | */ |
181 | - protected function getJsonClientConfig( \Aimeos\MShop\Context\Item\Iface $context ) |
|
181 | + protected function getJsonClientConfig(\Aimeos\MShop\Context\Item\Iface $context) |
|
182 | 182 | { |
183 | - $config = $context->getConfig()->get( 'admin/extjs', array() ); |
|
184 | - return json_encode( array( 'admin' => array( 'extjs' => $config ) ), JSON_FORCE_OBJECT ); |
|
183 | + $config = $context->getConfig()->get('admin/extjs', array()); |
|
184 | + return json_encode(array('admin' => array('extjs' => $config)), JSON_FORCE_OBJECT); |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | |
@@ -192,16 +192,16 @@ discard block |
||
192 | 192 | * @param string $lang ISO language code like "en" or "en_GB" |
193 | 193 | * @return string JSON encoded translation object |
194 | 194 | */ |
195 | - protected function getJsonClientI18n( array $i18nPaths, $lang ) |
|
195 | + protected function getJsonClientI18n(array $i18nPaths, $lang) |
|
196 | 196 | { |
197 | - $i18n = new \Aimeos\MW\Translation\Zend2( $i18nPaths, 'gettext', $lang, array( 'disableNotices' => true ) ); |
|
197 | + $i18n = new \Aimeos\MW\Translation\Zend2($i18nPaths, 'gettext', $lang, array('disableNotices' => true)); |
|
198 | 198 | |
199 | 199 | $content = array( |
200 | - 'admin' => $i18n->getAll( 'admin' ), |
|
201 | - 'admin/ext' => $i18n->getAll( 'admin/ext' ), |
|
200 | + 'admin' => $i18n->getAll('admin'), |
|
201 | + 'admin/ext' => $i18n->getAll('admin/ext'), |
|
202 | 202 | ); |
203 | 203 | |
204 | - return json_encode( $content, JSON_FORCE_OBJECT ); |
|
204 | + return json_encode($content, JSON_FORCE_OBJECT); |
|
205 | 205 | } |
206 | 206 | |
207 | 207 | |
@@ -213,19 +213,19 @@ discard block |
||
213 | 213 | * @return string JSON encoded site item object |
214 | 214 | * @throws Exception If no site item was found for the code |
215 | 215 | */ |
216 | - protected function getJsonSiteItem( \Aimeos\MShop\Context\Item\Iface $context, $site ) |
|
216 | + protected function getJsonSiteItem(\Aimeos\MShop\Context\Item\Iface $context, $site) |
|
217 | 217 | { |
218 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'locale/site' ); |
|
218 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'locale/site'); |
|
219 | 219 | |
220 | 220 | $criteria = $manager->createSearch(); |
221 | - $criteria->setConditions( $criteria->compare( '==', 'locale.site.code', $site ) ); |
|
222 | - $items = $manager->searchItems( $criteria ); |
|
221 | + $criteria->setConditions($criteria->compare('==', 'locale.site.code', $site)); |
|
222 | + $items = $manager->searchItems($criteria); |
|
223 | 223 | |
224 | - if( ( $item = reset( $items ) ) === false ) { |
|
225 | - throw new \Exception( sprintf( 'No site found for code "%1$s"', $site ) ); |
|
224 | + if (($item = reset($items)) === false) { |
|
225 | + throw new \Exception(sprintf('No site found for code "%1$s"', $site)); |
|
226 | 226 | } |
227 | 227 | |
228 | - return json_encode( $item->toArray() ); |
|
228 | + return json_encode($item->toArray()); |
|
229 | 229 | } |
230 | 230 | |
231 | 231 | |
@@ -237,17 +237,17 @@ discard block |
||
237 | 237 | * @param string $locale ISO language code, e.g. "en" or "en_GB" |
238 | 238 | * @return \Aimeos\MShop\Context\Item\Iface Modified context object |
239 | 239 | */ |
240 | - protected function setLocale( \Aimeos\MShop\Context\Item\Iface $context, $sitecode = 'default', $locale = null ) |
|
240 | + protected function setLocale(\Aimeos\MShop\Context\Item\Iface $context, $sitecode = 'default', $locale = null) |
|
241 | 241 | { |
242 | - $localeManager = \Aimeos\MShop\Factory::createManager( $context, 'locale' ); |
|
242 | + $localeManager = \Aimeos\MShop\Factory::createManager($context, 'locale'); |
|
243 | 243 | |
244 | 244 | try { |
245 | - $localeItem = $localeManager->bootstrap( $sitecode, $locale, '', false ); |
|
246 | - } catch( \Aimeos\MShop\Locale\Exception $e ) { |
|
245 | + $localeItem = $localeManager->bootstrap($sitecode, $locale, '', false); |
|
246 | + } catch (\Aimeos\MShop\Locale\Exception $e) { |
|
247 | 247 | $localeItem = $localeManager->createItem(); |
248 | 248 | } |
249 | 249 | |
250 | - $context->setLocale( $localeItem ); |
|
250 | + $context->setLocale($localeItem); |
|
251 | 251 | |
252 | 252 | return $context; |
253 | 253 | } |
@@ -34,14 +34,14 @@ discard block |
||
34 | 34 | * @param integer $id Unique resource ID |
35 | 35 | * @return string Generated output |
36 | 36 | */ |
37 | - public function copyAction( $site = 'default', $resource, $id ) |
|
37 | + public function copyAction($site = 'default', $resource, $id) |
|
38 | 38 | { |
39 | - if( config( 'shop.authorize', true ) ) { |
|
40 | - $this->authorize( 'admin' ); |
|
39 | + if (config('shop.authorize', true)) { |
|
40 | + $this->authorize('admin'); |
|
41 | 41 | } |
42 | 42 | |
43 | - $cntl = $this->createClient( $site, $resource ); |
|
44 | - return $this->getHtml( $site, $cntl->copy( $id ) ); |
|
43 | + $cntl = $this->createClient($site, $resource); |
|
44 | + return $this->getHtml($site, $cntl->copy($id)); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | |
@@ -52,14 +52,14 @@ discard block |
||
52 | 52 | * @param string $sitecode Unique site code |
53 | 53 | * @return string Generated output |
54 | 54 | */ |
55 | - public function createAction( $site = 'default', $resource ) |
|
55 | + public function createAction($site = 'default', $resource) |
|
56 | 56 | { |
57 | - if( config( 'shop.authorize', true ) ) { |
|
58 | - $this->authorize( 'admin' ); |
|
57 | + if (config('shop.authorize', true)) { |
|
58 | + $this->authorize('admin'); |
|
59 | 59 | } |
60 | 60 | |
61 | - $cntl = $this->createClient( $site, $resource ); |
|
62 | - return $this->getHtml( $site, $cntl->create() ); |
|
61 | + $cntl = $this->createClient($site, $resource); |
|
62 | + return $this->getHtml($site, $cntl->create()); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | |
@@ -71,14 +71,14 @@ discard block |
||
71 | 71 | * @param integer $id Unique resource ID |
72 | 72 | * @return string Generated output |
73 | 73 | */ |
74 | - public function deleteAction( $site = 'default', $resource, $id ) |
|
74 | + public function deleteAction($site = 'default', $resource, $id) |
|
75 | 75 | { |
76 | - if( config( 'shop.authorize', true ) ) { |
|
77 | - $this->authorize( 'admin' ); |
|
76 | + if (config('shop.authorize', true)) { |
|
77 | + $this->authorize('admin'); |
|
78 | 78 | } |
79 | 79 | |
80 | - $cntl = $this->createClient( $site, $resource ); |
|
81 | - return $this->getHtml( $site, $cntl->delete( $id ) . $cntl->search() ); |
|
80 | + $cntl = $this->createClient($site, $resource); |
|
81 | + return $this->getHtml($site, $cntl->delete($id) . $cntl->search()); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | |
@@ -90,14 +90,14 @@ discard block |
||
90 | 90 | * @param integer $id Unique resource ID |
91 | 91 | * @return string Generated output |
92 | 92 | */ |
93 | - public function getAction( $site = 'default', $resource, $id ) |
|
93 | + public function getAction($site = 'default', $resource, $id) |
|
94 | 94 | { |
95 | - if( config( 'shop.authorize', true ) ) { |
|
96 | - $this->authorize( 'admin' ); |
|
95 | + if (config('shop.authorize', true)) { |
|
96 | + $this->authorize('admin'); |
|
97 | 97 | } |
98 | 98 | |
99 | - $cntl = $this->createClient( $site, $resource ); |
|
100 | - return $this->getHtml( $site, $cntl->get( $id ) ); |
|
99 | + $cntl = $this->createClient($site, $resource); |
|
100 | + return $this->getHtml($site, $cntl->get($id)); |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | |
@@ -108,14 +108,14 @@ discard block |
||
108 | 108 | * @param string $sitecode Unique site code |
109 | 109 | * @return string Generated output |
110 | 110 | */ |
111 | - public function saveAction( $site = 'default', $resource ) |
|
111 | + public function saveAction($site = 'default', $resource) |
|
112 | 112 | { |
113 | - if( config( 'shop.authorize', true ) ) { |
|
114 | - $this->authorize( 'admin' ); |
|
113 | + if (config('shop.authorize', true)) { |
|
114 | + $this->authorize('admin'); |
|
115 | 115 | } |
116 | 116 | |
117 | - $cntl = $this->createClient( $site, $resource ); |
|
118 | - return $this->getHtml( $site, ( $cntl->save() ? : $cntl->search() ) ); |
|
117 | + $cntl = $this->createClient($site, $resource); |
|
118 | + return $this->getHtml($site, ($cntl->save() ?: $cntl->search())); |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | |
@@ -126,14 +126,14 @@ discard block |
||
126 | 126 | * @param string $sitecode Unique site code |
127 | 127 | * @return string Generated output |
128 | 128 | */ |
129 | - public function searchAction( $site = 'default', $resource ) |
|
129 | + public function searchAction($site = 'default', $resource) |
|
130 | 130 | { |
131 | - if( config( 'shop.authorize', true ) ) { |
|
132 | - $this->authorize( 'admin' ); |
|
131 | + if (config('shop.authorize', true)) { |
|
132 | + $this->authorize('admin'); |
|
133 | 133 | } |
134 | 134 | |
135 | - $cntl = $this->createClient( $site, $resource ); |
|
136 | - return $this->getHtml( $site, $cntl->search() ); |
|
135 | + $cntl = $this->createClient($site, $resource); |
|
136 | + return $this->getHtml($site, $cntl->search()); |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | |
@@ -143,20 +143,20 @@ discard block |
||
143 | 143 | * @param string $sitecode Unique site code |
144 | 144 | * @return \Aimeos\MShop\Context\Item\Iface Context item |
145 | 145 | */ |
146 | - protected function createClient( $sitecode, $resource ) |
|
146 | + protected function createClient($sitecode, $resource) |
|
147 | 147 | { |
148 | - $lang = Input::get( 'lang', config( 'app.locale', 'en' ) ); |
|
148 | + $lang = Input::get('lang', config('app.locale', 'en')); |
|
149 | 149 | |
150 | - $aimeos = app( '\Aimeos\Shop\Base\Aimeos' )->get(); |
|
151 | - $templatePaths = $aimeos->getCustomPaths( 'admin/jqadm/templates' ); |
|
150 | + $aimeos = app('\Aimeos\Shop\Base\Aimeos')->get(); |
|
151 | + $templatePaths = $aimeos->getCustomPaths('admin/jqadm/templates'); |
|
152 | 152 | |
153 | - $context = app( '\Aimeos\Shop\Base\Context' )->get( false ); |
|
154 | - $context = $this->setLocale( $context, $sitecode, $lang ); |
|
153 | + $context = app('\Aimeos\Shop\Base\Context')->get(false); |
|
154 | + $context = $this->setLocale($context, $sitecode, $lang); |
|
155 | 155 | |
156 | - $view = app( '\Aimeos\Shop\Base\View' )->create( $context->getConfig(), $templatePaths, $lang ); |
|
157 | - $context->setView( $view ); |
|
156 | + $view = app('\Aimeos\Shop\Base\View')->create($context->getConfig(), $templatePaths, $lang); |
|
157 | + $context->setView($view); |
|
158 | 158 | |
159 | - return \Aimeos\Admin\JQAdm\Factory::createClient( $context, $templatePaths, $resource ); |
|
159 | + return \Aimeos\Admin\JQAdm\Factory::createClient($context, $templatePaths, $resource); |
|
160 | 160 | } |
161 | 161 | |
162 | 162 | |
@@ -167,12 +167,12 @@ discard block |
||
167 | 167 | * @param string $content Content from admin client |
168 | 168 | * @return \Illuminate\Contracts\View\View View for rendering the output |
169 | 169 | */ |
170 | - protected function getHtml( $site, $content ) |
|
170 | + protected function getHtml($site, $content) |
|
171 | 171 | { |
172 | - $version = app( '\Aimeos\Shop\Base\Aimeos' )->getVersion(); |
|
173 | - $content = str_replace( ['{type}', '{version}'], ['Laravel', $version], $content ); |
|
172 | + $version = app('\Aimeos\Shop\Base\Aimeos')->getVersion(); |
|
173 | + $content = str_replace(['{type}', '{version}'], ['Laravel', $version], $content); |
|
174 | 174 | |
175 | - return View::make( 'shop::jqadm.index', array( 'content' => $content ) ); |
|
175 | + return View::make('shop::jqadm.index', array('content' => $content)); |
|
176 | 176 | } |
177 | 177 | |
178 | 178 | |
@@ -184,23 +184,23 @@ discard block |
||
184 | 184 | * @param string $lang ISO language code, e.g. "en" or "en_GB" |
185 | 185 | * @return \Aimeos\MShop\Context\Item\Iface Modified context object |
186 | 186 | */ |
187 | - protected function setLocale( \Aimeos\MShop\Context\Item\Iface $context, $sitecode = 'default', $lang = null ) |
|
187 | + protected function setLocale(\Aimeos\MShop\Context\Item\Iface $context, $sitecode = 'default', $lang = null) |
|
188 | 188 | { |
189 | - $localeManager = \Aimeos\MShop\Factory::createManager( $context, 'locale' ); |
|
189 | + $localeManager = \Aimeos\MShop\Factory::createManager($context, 'locale'); |
|
190 | 190 | |
191 | 191 | try |
192 | 192 | { |
193 | - $localeItem = $localeManager->bootstrap( $sitecode, '', '', false ); |
|
194 | - $localeItem->setLanguageId( null ); |
|
195 | - $localeItem->setCurrencyId( null ); |
|
193 | + $localeItem = $localeManager->bootstrap($sitecode, '', '', false); |
|
194 | + $localeItem->setLanguageId(null); |
|
195 | + $localeItem->setCurrencyId(null); |
|
196 | 196 | } |
197 | - catch( \Aimeos\MShop\Locale\Exception $e ) |
|
197 | + catch (\Aimeos\MShop\Locale\Exception $e) |
|
198 | 198 | { |
199 | 199 | $localeItem = $localeManager->createItem(); |
200 | 200 | } |
201 | 201 | |
202 | - $context->setLocale( $localeItem ); |
|
203 | - $context->setI18n( app('\Aimeos\Shop\Base\I18n')->get( array( $lang ) ) ); |
|
202 | + $context->setLocale($localeItem); |
|
203 | + $context->setI18n(app('\Aimeos\Shop\Base\I18n')->get(array($lang))); |
|
204 | 204 | |
205 | 205 | return $context; |
206 | 206 | } |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | * |
35 | 35 | * @param \Illuminate\Contracts\Config\Repository $config Configuration object |
36 | 36 | */ |
37 | - public function __construct( \Illuminate\Contracts\Config\Repository $config ) |
|
37 | + public function __construct(\Illuminate\Contracts\Config\Repository $config) |
|
38 | 38 | { |
39 | 39 | $this->config = $config; |
40 | 40 | } |
@@ -47,10 +47,10 @@ discard block |
||
47 | 47 | */ |
48 | 48 | public function get() |
49 | 49 | { |
50 | - if( $this->object === null ) |
|
50 | + if ($this->object === null) |
|
51 | 51 | { |
52 | - $extDirs = (array) $this->config->get( 'shop.extdir', array() ); |
|
53 | - $this->object = new \Aimeos\Bootstrap( $extDirs, false ); |
|
52 | + $extDirs = (array) $this->config->get('shop.extdir', array()); |
|
53 | + $this->object = new \Aimeos\Bootstrap($extDirs, false); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | return $this->object; |
@@ -64,12 +64,12 @@ discard block |
||
64 | 64 | */ |
65 | 65 | public function getVersion() |
66 | 66 | { |
67 | - if( ( $content = @file_get_contents( base_path( 'composer.lock' ) ) ) !== false |
|
68 | - && ( $content = json_decode( $content, true ) ) !== null && isset( $content['packages'] ) |
|
67 | + if (($content = @file_get_contents(base_path('composer.lock'))) !== false |
|
68 | + && ($content = json_decode($content, true)) !== null && isset($content['packages']) |
|
69 | 69 | ) { |
70 | - foreach( (array) $content['packages'] as $item ) |
|
70 | + foreach ((array) $content['packages'] as $item) |
|
71 | 71 | { |
72 | - if( $item['name'] === 'aimeos/aimeos-laravel' ) { |
|
72 | + if ($item['name'] === 'aimeos/aimeos-laravel') { |
|
73 | 73 | return $item['version']; |
74 | 74 | } |
75 | 75 | } |