@@ -26,53 +26,53 @@ discard block |
||
26 | 26 | * @param string|null $locale Code of the current language or null for no translation |
27 | 27 | * @return \Aimeos\MW\View\Iface View object |
28 | 28 | */ |
29 | - public function create( \Aimeos\MW\Config\Iface $config, array $templatePaths, $locale = null ) |
|
29 | + public function create(\Aimeos\MW\Config\Iface $config, array $templatePaths, $locale = null) |
|
30 | 30 | { |
31 | 31 | $params = $fixed = array(); |
32 | 32 | |
33 | - if( $locale !== null ) |
|
33 | + if ($locale !== null) |
|
34 | 34 | { |
35 | 35 | $params = \Route::current()->parameters() + \Input::all(); |
36 | 36 | $params['target'] = \Route::currentRouteName(); |
37 | 37 | |
38 | 38 | $fixed = $this->getFixedParams(); |
39 | 39 | |
40 | - $i18n = app('\Aimeos\Shop\Base\I18n')->get( array( $locale ) ); |
|
40 | + $i18n = app('\Aimeos\Shop\Base\I18n')->get(array($locale)); |
|
41 | 41 | $translation = $i18n[$locale]; |
42 | 42 | } |
43 | 43 | else |
44 | 44 | { |
45 | - $translation = new \Aimeos\MW\Translation\None( 'en' ); |
|
45 | + $translation = new \Aimeos\MW\Translation\None('en'); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | |
49 | - $view = new \Aimeos\MW\View\Standard( $templatePaths ); |
|
49 | + $view = new \Aimeos\MW\View\Standard($templatePaths); |
|
50 | 50 | |
51 | - $helper = new \Aimeos\MW\View\Helper\Translate\Standard( $view, $translation ); |
|
52 | - $view->addHelper( 'translate', $helper ); |
|
51 | + $helper = new \Aimeos\MW\View\Helper\Translate\Standard($view, $translation); |
|
52 | + $view->addHelper('translate', $helper); |
|
53 | 53 | |
54 | - $helper = new \Aimeos\MW\View\Helper\Url\Laravel5( $view, app('url'), $fixed ); |
|
55 | - $view->addHelper( 'url', $helper ); |
|
54 | + $helper = new \Aimeos\MW\View\Helper\Url\Laravel5($view, app('url'), $fixed); |
|
55 | + $view->addHelper('url', $helper); |
|
56 | 56 | |
57 | - $helper = new \Aimeos\MW\View\Helper\Parameter\Standard( $view, $params ); |
|
58 | - $view->addHelper( 'param', $helper ); |
|
57 | + $helper = new \Aimeos\MW\View\Helper\Parameter\Standard($view, $params); |
|
58 | + $view->addHelper('param', $helper); |
|
59 | 59 | |
60 | - $helper = new \Aimeos\MW\View\Helper\Config\Standard( $view, $config ); |
|
61 | - $view->addHelper( 'config', $helper ); |
|
60 | + $helper = new \Aimeos\MW\View\Helper\Config\Standard($view, $config); |
|
61 | + $view->addHelper('config', $helper); |
|
62 | 62 | |
63 | - $sepDec = $config->get( 'client/html/common/format/seperatorDecimal', '.' ); |
|
64 | - $sep1000 = $config->get( 'client/html/common/format/seperator1000', ' ' ); |
|
65 | - $helper = new \Aimeos\MW\View\Helper\Number\Standard( $view, $sepDec, $sep1000 ); |
|
66 | - $view->addHelper( 'number', $helper ); |
|
63 | + $sepDec = $config->get('client/html/common/format/seperatorDecimal', '.'); |
|
64 | + $sep1000 = $config->get('client/html/common/format/seperator1000', ' '); |
|
65 | + $helper = new \Aimeos\MW\View\Helper\Number\Standard($view, $sepDec, $sep1000); |
|
66 | + $view->addHelper('number', $helper); |
|
67 | 67 | |
68 | - $helper = new \Aimeos\MW\View\Helper\FormParam\Standard( $view, array() ); |
|
69 | - $view->addHelper( 'formparam', $helper ); |
|
68 | + $helper = new \Aimeos\MW\View\Helper\FormParam\Standard($view, array()); |
|
69 | + $view->addHelper('formparam', $helper); |
|
70 | 70 | |
71 | - $helper = new \Aimeos\MW\View\Helper\Request\Laravel5( $view, \Request::instance() ); |
|
72 | - $view->addHelper( 'request', $helper ); |
|
71 | + $helper = new \Aimeos\MW\View\Helper\Request\Laravel5($view, \Request::instance()); |
|
72 | + $view->addHelper('request', $helper); |
|
73 | 73 | |
74 | - $helper = new \Aimeos\MW\View\Helper\Csrf\Standard( $view, '_token', csrf_token() ); |
|
75 | - $view->addHelper( 'csrf', $helper ); |
|
74 | + $helper = new \Aimeos\MW\View\Helper\Csrf\Standard($view, '_token', csrf_token()); |
|
75 | + $view->addHelper('csrf', $helper); |
|
76 | 76 | |
77 | 77 | return $view; |
78 | 78 | } |
@@ -87,15 +87,15 @@ discard block |
||
87 | 87 | { |
88 | 88 | $fixed = array(); |
89 | 89 | |
90 | - if( ( $value = \Route::input( 'site' ) ) !== null ) { |
|
90 | + if (($value = \Route::input('site')) !== null) { |
|
91 | 91 | $fixed['site'] = $value; |
92 | 92 | } |
93 | 93 | |
94 | - if( ( $value = \Route::input( 'locale' ) ) !== null ) { |
|
94 | + if (($value = \Route::input('locale')) !== null) { |
|
95 | 95 | $fixed['locale'] = $value; |
96 | 96 | } |
97 | 97 | |
98 | - if( ( $value = \Route::input( 'currency' ) ) !== null ) { |
|
98 | + if (($value = \Route::input('currency')) !== null) { |
|
99 | 99 | $fixed['currency'] = $value; |
100 | 100 | } |
101 | 101 |
@@ -33,16 +33,16 @@ discard block |
||
33 | 33 | * @param integer $id Unique resource ID |
34 | 34 | * @return string Generated output |
35 | 35 | */ |
36 | - public function copyAction( $site = 'default', $resource, $id ) |
|
36 | + public function copyAction($site = 'default', $resource, $id) |
|
37 | 37 | { |
38 | - if( config( 'shop.authorize', true ) ) { |
|
39 | - $this->authorize( 'admin' ); |
|
38 | + if (config('shop.authorize', true)) { |
|
39 | + $this->authorize('admin'); |
|
40 | 40 | } |
41 | 41 | |
42 | - $cntl = $this->createClient( $site, $resource ); |
|
43 | - $content = $cntl->copy( $id ); |
|
42 | + $cntl = $this->createClient($site, $resource); |
|
43 | + $content = $cntl->copy($id); |
|
44 | 44 | |
45 | - return \View::make('shop::admin.jqadm', array( 'content' => $content ) ); |
|
45 | + return \View::make('shop::admin.jqadm', array('content' => $content)); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | |
@@ -53,16 +53,16 @@ discard block |
||
53 | 53 | * @param string $sitecode Unique site code |
54 | 54 | * @return string Generated output |
55 | 55 | */ |
56 | - public function createAction( $site = 'default', $resource ) |
|
56 | + public function createAction($site = 'default', $resource) |
|
57 | 57 | { |
58 | - if( config( 'shop.authorize', true ) ) { |
|
59 | - $this->authorize( 'admin' ); |
|
58 | + if (config('shop.authorize', true)) { |
|
59 | + $this->authorize('admin'); |
|
60 | 60 | } |
61 | 61 | |
62 | - $cntl = $this->createClient( $site, $resource ); |
|
63 | - $content = $cntl->create( $id ); |
|
62 | + $cntl = $this->createClient($site, $resource); |
|
63 | + $content = $cntl->create($id); |
|
64 | 64 | |
65 | - return \View::make('shop::admin.jqadm', array( 'content' => $content ) ); |
|
65 | + return \View::make('shop::admin.jqadm', array('content' => $content)); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | |
@@ -74,16 +74,16 @@ discard block |
||
74 | 74 | * @param integer $id Unique resource ID |
75 | 75 | * @return string Generated output |
76 | 76 | */ |
77 | - public function deleteAction( $site = 'default', $resource, $id ) |
|
77 | + public function deleteAction($site = 'default', $resource, $id) |
|
78 | 78 | { |
79 | - if( config( 'shop.authorize', true ) ) { |
|
80 | - $this->authorize( 'admin' ); |
|
79 | + if (config('shop.authorize', true)) { |
|
80 | + $this->authorize('admin'); |
|
81 | 81 | } |
82 | 82 | |
83 | - $cntl = $this->createClient( $site, $resource ); |
|
84 | - $content = ( $cntl->delete( $id ) ? : $cntl->search() ); |
|
83 | + $cntl = $this->createClient($site, $resource); |
|
84 | + $content = ($cntl->delete($id) ?: $cntl->search()); |
|
85 | 85 | |
86 | - return \View::make('shop::admin.jqadm', array( 'content' => $content ) ); |
|
86 | + return \View::make('shop::admin.jqadm', array('content' => $content)); |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | |
@@ -95,16 +95,16 @@ discard block |
||
95 | 95 | * @param integer $id Unique resource ID |
96 | 96 | * @return string Generated output |
97 | 97 | */ |
98 | - public function getAction( $site = 'default', $resource, $id ) |
|
98 | + public function getAction($site = 'default', $resource, $id) |
|
99 | 99 | { |
100 | - if( config( 'shop.authorize', true ) ) { |
|
101 | - $this->authorize( 'admin' ); |
|
100 | + if (config('shop.authorize', true)) { |
|
101 | + $this->authorize('admin'); |
|
102 | 102 | } |
103 | 103 | |
104 | - $cntl = $this->createClient( $site, $resource ); |
|
105 | - $content = $cntl->get( $id ); |
|
104 | + $cntl = $this->createClient($site, $resource); |
|
105 | + $content = $cntl->get($id); |
|
106 | 106 | |
107 | - return \View::make('shop::admin.jqadm', array( 'content' => $content ) ); |
|
107 | + return \View::make('shop::admin.jqadm', array('content' => $content)); |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | |
@@ -115,16 +115,16 @@ discard block |
||
115 | 115 | * @param string $sitecode Unique site code |
116 | 116 | * @return string Generated output |
117 | 117 | */ |
118 | - public function saveAction( $site = 'default', $resource ) |
|
118 | + public function saveAction($site = 'default', $resource) |
|
119 | 119 | { |
120 | - if( config( 'shop.authorize', true ) ) { |
|
121 | - $this->authorize( 'admin' ); |
|
120 | + if (config('shop.authorize', true)) { |
|
121 | + $this->authorize('admin'); |
|
122 | 122 | } |
123 | 123 | |
124 | - $cntl = $this->createClient( $site, $resource ); |
|
125 | - $content = ( $cntl->save() ? : $cntl->search() ); |
|
124 | + $cntl = $this->createClient($site, $resource); |
|
125 | + $content = ($cntl->save() ?: $cntl->search()); |
|
126 | 126 | |
127 | - return \View::make('shop::admin.jqadm', array( 'content' => $content ) ); |
|
127 | + return \View::make('shop::admin.jqadm', array('content' => $content)); |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | |
@@ -135,16 +135,16 @@ discard block |
||
135 | 135 | * @param string $sitecode Unique site code |
136 | 136 | * @return string Generated output |
137 | 137 | */ |
138 | - public function searchAction( $site = 'default', $resource ) |
|
138 | + public function searchAction($site = 'default', $resource) |
|
139 | 139 | { |
140 | - if( config( 'shop.authorize', true ) ) { |
|
141 | - $this->authorize( 'admin' ); |
|
140 | + if (config('shop.authorize', true)) { |
|
141 | + $this->authorize('admin'); |
|
142 | 142 | } |
143 | 143 | |
144 | - $cntl = $this->createClient( $site, $resource ); |
|
144 | + $cntl = $this->createClient($site, $resource); |
|
145 | 145 | $content = $cntl->search(); |
146 | 146 | |
147 | - return \View::make('shop::admin.jqadm', array( 'content' => $content ) ); |
|
147 | + return \View::make('shop::admin.jqadm', array('content' => $content)); |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | |
@@ -154,20 +154,20 @@ discard block |
||
154 | 154 | * @param string $sitecode Unique site code |
155 | 155 | * @return \Aimeos\MShop\Context\Item\Iface Context item |
156 | 156 | */ |
157 | - protected function createClient( $sitecode, $resource ) |
|
157 | + protected function createClient($sitecode, $resource) |
|
158 | 158 | { |
159 | - $lang = \Input::get( 'lang', config( 'app.locale', 'en' ) ); |
|
159 | + $lang = \Input::get('lang', config('app.locale', 'en')); |
|
160 | 160 | |
161 | - $aimeos = app( '\Aimeos\Shop\Base\Aimeos' )->get(); |
|
162 | - $templatePaths = $aimeos->getCustomPaths( 'controller/jqadm/templates' ); |
|
161 | + $aimeos = app('\Aimeos\Shop\Base\Aimeos')->get(); |
|
162 | + $templatePaths = $aimeos->getCustomPaths('controller/jqadm/templates'); |
|
163 | 163 | |
164 | - $context = app( '\Aimeos\Shop\Base\Context' )->get( false ); |
|
165 | - $context = $this->setLocale( $context, $sitecode, $lang ); |
|
164 | + $context = app('\Aimeos\Shop\Base\Context')->get(false); |
|
165 | + $context = $this->setLocale($context, $sitecode, $lang); |
|
166 | 166 | |
167 | - $view = app( '\Aimeos\Shop\Base\View' )->create( $context->getConfig(), $templatePaths, $lang ); |
|
168 | - $context->setView( $view ); |
|
167 | + $view = app('\Aimeos\Shop\Base\View')->create($context->getConfig(), $templatePaths, $lang); |
|
168 | + $context->setView($view); |
|
169 | 169 | |
170 | - return \Aimeos\Client\JQAdm\Factory::createClient( $context, $templatePaths, $resource ); |
|
170 | + return \Aimeos\Client\JQAdm\Factory::createClient($context, $templatePaths, $resource); |
|
171 | 171 | } |
172 | 172 | |
173 | 173 | |
@@ -179,23 +179,23 @@ discard block |
||
179 | 179 | * @param string $lang ISO language code, e.g. "en" or "en_GB" |
180 | 180 | * @return \Aimeos\MShop\Context\Item\Iface Modified context object |
181 | 181 | */ |
182 | - protected function setLocale( \Aimeos\MShop\Context\Item\Iface $context, $sitecode, $lang ) |
|
182 | + protected function setLocale(\Aimeos\MShop\Context\Item\Iface $context, $sitecode, $lang) |
|
183 | 183 | { |
184 | - $localeManager = \Aimeos\MShop\Factory::createManager( $context, 'locale' ); |
|
184 | + $localeManager = \Aimeos\MShop\Factory::createManager($context, 'locale'); |
|
185 | 185 | |
186 | 186 | try |
187 | 187 | { |
188 | - $localeItem = $localeManager->bootstrap( $sitecode, '', '', false ); |
|
189 | - $localeItem->setLanguageId( null ); |
|
190 | - $localeItem->setCurrencyId( null ); |
|
188 | + $localeItem = $localeManager->bootstrap($sitecode, '', '', false); |
|
189 | + $localeItem->setLanguageId(null); |
|
190 | + $localeItem->setCurrencyId(null); |
|
191 | 191 | } |
192 | - catch( \Aimeos\MShop\Locale\Exception $e ) |
|
192 | + catch (\Aimeos\MShop\Locale\Exception $e) |
|
193 | 193 | { |
194 | 194 | $localeItem = $localeManager->createItem(); |
195 | 195 | } |
196 | 196 | |
197 | - $context->setLocale( $localeItem ); |
|
198 | - $context->setI18n( app('\Aimeos\Shop\Base\I18n')->get( array( $lang ) ) ); |
|
197 | + $context->setLocale($localeItem); |
|
198 | + $context->setI18n(app('\Aimeos\Shop\Base\I18n')->get(array($lang))); |
|
199 | 199 | |
200 | 200 | return $context; |
201 | 201 | } |
@@ -35,19 +35,19 @@ discard block |
||
35 | 35 | * @param integer|null $id Unique resource ID |
36 | 36 | * @return \Illuminate\Http\Response Response object containing the generated output |
37 | 37 | */ |
38 | - public function deleteAction( Request $request, $site = 'default', $resource, $id = null ) |
|
38 | + public function deleteAction(Request $request, $site = 'default', $resource, $id = null) |
|
39 | 39 | { |
40 | - if( config( 'shop.authorize', true ) ) { |
|
41 | - $this->authorize( 'admin' ); |
|
40 | + if (config('shop.authorize', true)) { |
|
41 | + $this->authorize('admin'); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | $status = 500; |
45 | 45 | $header = $request->headers->all(); |
46 | 46 | |
47 | - $cntl = $this->createController( $site, $resource ); |
|
48 | - $result = $cntl->delete( $request->getContent(), $header, $status ); |
|
47 | + $cntl = $this->createController($site, $resource); |
|
48 | + $result = $cntl->delete($request->getContent(), $header, $status); |
|
49 | 49 | |
50 | - return $this->createResponse( $result, $status, $header ); |
|
50 | + return $this->createResponse($result, $status, $header); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | |
@@ -60,19 +60,19 @@ discard block |
||
60 | 60 | * @param integer|null $id Unique resource ID |
61 | 61 | * @return \Illuminate\Http\Response Response object containing the generated output |
62 | 62 | */ |
63 | - public function getAction( Request $request, $site = 'default', $resource, $id = null ) |
|
63 | + public function getAction(Request $request, $site = 'default', $resource, $id = null) |
|
64 | 64 | { |
65 | - if( config( 'shop.authorize', true ) ) { |
|
66 | - $this->authorize( 'admin' ); |
|
65 | + if (config('shop.authorize', true)) { |
|
66 | + $this->authorize('admin'); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | $status = 500; |
70 | 70 | $header = $request->headers->all(); |
71 | 71 | |
72 | - $cntl = $this->createController( $site, $resource ); |
|
73 | - $result = $cntl->get( $request->getContent(), $header, $status ); |
|
72 | + $cntl = $this->createController($site, $resource); |
|
73 | + $result = $cntl->get($request->getContent(), $header, $status); |
|
74 | 74 | |
75 | - return $this->createResponse( $result, $status, $header ); |
|
75 | + return $this->createResponse($result, $status, $header); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | |
@@ -85,19 +85,19 @@ discard block |
||
85 | 85 | * @param integer|null $id Unique resource ID |
86 | 86 | * @return \Illuminate\Http\Response Response object containing the generated output |
87 | 87 | */ |
88 | - public function patchAction( Request $request, $site = 'default', $resource, $id = null ) |
|
88 | + public function patchAction(Request $request, $site = 'default', $resource, $id = null) |
|
89 | 89 | { |
90 | - if( config( 'shop.authorize', true ) ) { |
|
91 | - $this->authorize( 'admin' ); |
|
90 | + if (config('shop.authorize', true)) { |
|
91 | + $this->authorize('admin'); |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | $status = 500; |
95 | 95 | $header = $request->headers->all(); |
96 | 96 | |
97 | - $cntl = $this->createController( $site, $resource ); |
|
98 | - $result = $cntl->patch( $request->getContent(), $header, $status ); |
|
97 | + $cntl = $this->createController($site, $resource); |
|
98 | + $result = $cntl->patch($request->getContent(), $header, $status); |
|
99 | 99 | |
100 | - return $this->createResponse( $result, $status, $header ); |
|
100 | + return $this->createResponse($result, $status, $header); |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | |
@@ -110,19 +110,19 @@ discard block |
||
110 | 110 | * @param integer $id Unique ID of the resource |
111 | 111 | * @return \Illuminate\Http\Response Response object containing the generated output |
112 | 112 | */ |
113 | - public function postAction( Request $request, $site = 'default', $resource, $id = null ) |
|
113 | + public function postAction(Request $request, $site = 'default', $resource, $id = null) |
|
114 | 114 | { |
115 | - if( config( 'shop.authorize', true ) ) { |
|
116 | - $this->authorize( 'admin' ); |
|
115 | + if (config('shop.authorize', true)) { |
|
116 | + $this->authorize('admin'); |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | $status = 500; |
120 | 120 | $header = $request->headers->all(); |
121 | 121 | |
122 | - $cntl = $this->createController( $site, $resource ); |
|
123 | - $result = $cntl->post( $request->getContent(), $header, $status ); |
|
122 | + $cntl = $this->createController($site, $resource); |
|
123 | + $result = $cntl->post($request->getContent(), $header, $status); |
|
124 | 124 | |
125 | - return $this->createResponse( $result, $status, $header ); |
|
125 | + return $this->createResponse($result, $status, $header); |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | |
@@ -135,19 +135,19 @@ discard block |
||
135 | 135 | * @param integer|null $id Unique resource ID |
136 | 136 | * @return \Illuminate\Http\Response Response object containing the generated output |
137 | 137 | */ |
138 | - public function putAction( Request $request, $site = 'default', $resource, $id = null ) |
|
138 | + public function putAction(Request $request, $site = 'default', $resource, $id = null) |
|
139 | 139 | { |
140 | - if( config( 'shop.authorize', true ) ) { |
|
141 | - $this->authorize( 'admin' ); |
|
140 | + if (config('shop.authorize', true)) { |
|
141 | + $this->authorize('admin'); |
|
142 | 142 | } |
143 | 143 | |
144 | 144 | $status = 500; |
145 | 145 | $header = $request->headers->all(); |
146 | 146 | |
147 | - $cntl = $this->createController( $site, $resource ); |
|
148 | - $result = $cntl->put( $request->getContent(), $header, $status ); |
|
147 | + $cntl = $this->createController($site, $resource); |
|
148 | + $result = $cntl->put($request->getContent(), $header, $status); |
|
149 | 149 | |
150 | - return $this->createResponse( $result, $status, $header ); |
|
150 | + return $this->createResponse($result, $status, $header); |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | |
@@ -159,19 +159,19 @@ discard block |
||
159 | 159 | * @param string $sitecode Unique site code |
160 | 160 | * @return \Illuminate\Http\Response Response object containing the generated output |
161 | 161 | */ |
162 | - public function optionsAction( Request $request, $site = 'default', $resource = '' ) |
|
162 | + public function optionsAction(Request $request, $site = 'default', $resource = '') |
|
163 | 163 | { |
164 | - if( config( 'shop.authorize', true ) ) { |
|
165 | - $this->authorize( 'admin' ); |
|
164 | + if (config('shop.authorize', true)) { |
|
165 | + $this->authorize('admin'); |
|
166 | 166 | } |
167 | 167 | |
168 | 168 | $status = 500; |
169 | 169 | $header = $request->headers->all(); |
170 | 170 | |
171 | - $cntl = $this->createController( $site, $resource ); |
|
172 | - $result = $cntl->options( $request->getContent(), $header, $status ); |
|
171 | + $cntl = $this->createController($site, $resource); |
|
172 | + $result = $cntl->options($request->getContent(), $header, $status); |
|
173 | 173 | |
174 | - return $this->createResponse( $result, $status, $header ); |
|
174 | + return $this->createResponse($result, $status, $header); |
|
175 | 175 | } |
176 | 176 | |
177 | 177 | |
@@ -181,20 +181,20 @@ discard block |
||
181 | 181 | * @param string $sitecode Unique site code |
182 | 182 | * @return \Aimeos\MShop\Context\Item\Iface Context item |
183 | 183 | */ |
184 | - protected function createController( $sitecode, $resource ) |
|
184 | + protected function createController($sitecode, $resource) |
|
185 | 185 | { |
186 | - $lang = \Input::get( 'lang', config( 'app.locale', 'en' ) ); |
|
186 | + $lang = \Input::get('lang', config('app.locale', 'en')); |
|
187 | 187 | |
188 | - $aimeos = app( '\Aimeos\Shop\Base\Aimeos' )->get(); |
|
189 | - $templatePaths = $aimeos->getCustomPaths( 'controller/jsonadm/templates' ); |
|
188 | + $aimeos = app('\Aimeos\Shop\Base\Aimeos')->get(); |
|
189 | + $templatePaths = $aimeos->getCustomPaths('controller/jsonadm/templates'); |
|
190 | 190 | |
191 | - $context = app( '\Aimeos\Shop\Base\Context' )->get( false ); |
|
192 | - $context = $this->setLocale( $context, $sitecode, $lang ); |
|
191 | + $context = app('\Aimeos\Shop\Base\Context')->get(false); |
|
192 | + $context = $this->setLocale($context, $sitecode, $lang); |
|
193 | 193 | |
194 | - $view = app( '\Aimeos\Shop\Base\View' )->create( $context->getConfig(), $templatePaths, $lang ); |
|
195 | - $context->setView( $view ); |
|
194 | + $view = app('\Aimeos\Shop\Base\View')->create($context->getConfig(), $templatePaths, $lang); |
|
195 | + $context->setView($view); |
|
196 | 196 | |
197 | - return \Aimeos\Controller\JsonAdm\Factory::createController( $context, $templatePaths, $resource ); |
|
197 | + return \Aimeos\Controller\JsonAdm\Factory::createController($context, $templatePaths, $resource); |
|
198 | 198 | } |
199 | 199 | |
200 | 200 | |
@@ -206,12 +206,12 @@ discard block |
||
206 | 206 | * @param array $header List of HTTP headers |
207 | 207 | * @return \Illuminate\Http\Response HTTP response object |
208 | 208 | */ |
209 | - protected function createResponse( $content, $status, array $header ) |
|
209 | + protected function createResponse($content, $status, array $header) |
|
210 | 210 | { |
211 | - $response = \Response::make( $content, $status ); |
|
211 | + $response = \Response::make($content, $status); |
|
212 | 212 | |
213 | - foreach( $header as $key => $value ) { |
|
214 | - $response->header( $key, $value ); |
|
213 | + foreach ($header as $key => $value) { |
|
214 | + $response->header($key, $value); |
|
215 | 215 | } |
216 | 216 | |
217 | 217 | return $response; |
@@ -226,23 +226,23 @@ discard block |
||
226 | 226 | * @param string $lang ISO language code, e.g. "en" or "en_GB" |
227 | 227 | * @return \Aimeos\MShop\Context\Item\Iface Modified context object |
228 | 228 | */ |
229 | - protected function setLocale( \Aimeos\MShop\Context\Item\Iface $context, $sitecode, $lang ) |
|
229 | + protected function setLocale(\Aimeos\MShop\Context\Item\Iface $context, $sitecode, $lang) |
|
230 | 230 | { |
231 | - $localeManager = \Aimeos\MShop\Factory::createManager( $context, 'locale' ); |
|
231 | + $localeManager = \Aimeos\MShop\Factory::createManager($context, 'locale'); |
|
232 | 232 | |
233 | 233 | try |
234 | 234 | { |
235 | - $localeItem = $localeManager->bootstrap( $sitecode, '', '', false ); |
|
236 | - $localeItem->setLanguageId( null ); |
|
237 | - $localeItem->setCurrencyId( null ); |
|
235 | + $localeItem = $localeManager->bootstrap($sitecode, '', '', false); |
|
236 | + $localeItem->setLanguageId(null); |
|
237 | + $localeItem->setCurrencyId(null); |
|
238 | 238 | } |
239 | - catch( \Aimeos\MShop\Locale\Exception $e ) |
|
239 | + catch (\Aimeos\MShop\Locale\Exception $e) |
|
240 | 240 | { |
241 | 241 | $localeItem = $localeManager->createItem(); |
242 | 242 | } |
243 | 243 | |
244 | - $context->setLocale( $localeItem ); |
|
245 | - $context->setI18n( app('\Aimeos\Shop\Base\I18n')->get( array( $lang ) ) ); |
|
244 | + $context->setLocale($localeItem); |
|
245 | + $context->setI18n(app('\Aimeos\Shop\Base\I18n')->get(array($lang))); |
|
246 | 246 | |
247 | 247 | return $context; |
248 | 248 | } |
@@ -2,15 +2,15 @@ discard block |
||
2 | 2 | |
3 | 3 | Route::group(config('shop.routes.admin', ['middleware' => 'auth']), function() { |
4 | 4 | |
5 | - Route::match( array( 'GET' ), 'admin/file', array( |
|
5 | + Route::match(array('GET'), 'admin/file', array( |
|
6 | 6 | 'as' => 'aimeos_shop_admin_file', |
7 | 7 | 'uses' => 'Aimeos\Shop\Controller\AdminController@fileAction' |
8 | 8 | )); |
9 | - Route::match( array( 'POST' ), 'admin/do', array( |
|
9 | + Route::match(array('POST'), 'admin/do', array( |
|
10 | 10 | 'as' => 'aimeos_shop_admin_json', |
11 | 11 | 'uses' => 'Aimeos\Shop\Controller\AdminController@doAction' |
12 | 12 | )); |
13 | - Route::match( array( 'GET' ), 'admin', array( |
|
13 | + Route::match(array('GET'), 'admin', array( |
|
14 | 14 | 'as' => 'aimeos_shop_admin', |
15 | 15 | 'uses' => 'Aimeos\Shop\Controller\AdminController@indexAction' |
16 | 16 | )); |
@@ -20,85 +20,85 @@ discard block |
||
20 | 20 | |
21 | 21 | Route::group(config('shop.routes.jsonadm', ['middleware' => 'auth']), function() { |
22 | 22 | |
23 | - Route::match( array( 'GET', 'POST' ), 'jqadm/copy/{resource}/{id}', array( |
|
23 | + Route::match(array('GET', 'POST'), 'jqadm/copy/{resource}/{id}', array( |
|
24 | 24 | 'as' => 'aimeos_shop_jqadm_copy', |
25 | 25 | 'uses' => 'Aimeos\Shop\Controller\JqadmController@copyAction' |
26 | - ))->where( array( 'resource' => '[^0-9]+', 'id' => '[0-9]*' ) ); |
|
26 | + ))->where(array('resource' => '[^0-9]+', 'id' => '[0-9]*')); |
|
27 | 27 | |
28 | - Route::match( array( 'GET', 'POST' ), 'jqadm/create/{resource}', array( |
|
28 | + Route::match(array('GET', 'POST'), 'jqadm/create/{resource}', array( |
|
29 | 29 | 'as' => 'aimeos_shop_jqadm_create', |
30 | 30 | 'uses' => 'Aimeos\Shop\Controller\JqadmController@createAction' |
31 | - ))->where( array( 'resource' => '[^0-9]+' ) ); |
|
31 | + ))->where(array('resource' => '[^0-9]+')); |
|
32 | 32 | |
33 | - Route::match( array( 'GET', 'POST' ), 'jqadm/delete/{resource}/{id}', array( |
|
33 | + Route::match(array('GET', 'POST'), 'jqadm/delete/{resource}/{id}', array( |
|
34 | 34 | 'as' => 'aimeos_shop_jqadm_delete', |
35 | 35 | 'uses' => 'Aimeos\Shop\Controller\JqadmController@deleteAction' |
36 | - ))->where( array( 'resource' => '[^0-9]+', 'id' => '[0-9]*' ) ); |
|
36 | + ))->where(array('resource' => '[^0-9]+', 'id' => '[0-9]*')); |
|
37 | 37 | |
38 | - Route::match( array( 'GET' ), 'jqadm/get/{resource}/{id}', array( |
|
38 | + Route::match(array('GET'), 'jqadm/get/{resource}/{id}', array( |
|
39 | 39 | 'as' => 'aimeos_shop_jqadm_get', |
40 | 40 | 'uses' => 'Aimeos\Shop\Controller\JqadmController@getAction' |
41 | - ))->where( array( 'resource' => '[^0-9]*', 'id' => '[0-9]*' ) ); |
|
41 | + ))->where(array('resource' => '[^0-9]*', 'id' => '[0-9]*')); |
|
42 | 42 | |
43 | - Route::match( array( 'POST' ), 'jqadm/save/{resource}', array( |
|
43 | + Route::match(array('POST'), 'jqadm/save/{resource}', array( |
|
44 | 44 | 'as' => 'aimeos_shop_jqadm_save', |
45 | 45 | 'uses' => 'Aimeos\Shop\Controller\JqadmController@saveAction' |
46 | - ))->where( array( 'resource' => '[^0-9]+' ) ); |
|
46 | + ))->where(array('resource' => '[^0-9]+')); |
|
47 | 47 | |
48 | - Route::match( array( 'GET', 'POST' ), 'jqadm/{resource}', array( |
|
48 | + Route::match(array('GET', 'POST'), 'jqadm/{resource}', array( |
|
49 | 49 | 'as' => 'aimeos_shop_jqadm_search', |
50 | 50 | 'uses' => 'Aimeos\Shop\Controller\JqadmController@searchAction' |
51 | - ))->where( array( 'resource' => '[^0-9]+' ) ); |
|
51 | + ))->where(array('resource' => '[^0-9]+')); |
|
52 | 52 | |
53 | 53 | }); |
54 | 54 | |
55 | 55 | |
56 | 56 | Route::group(config('shop.routes.jsonadm', ['middleware' => 'auth']), function() { |
57 | 57 | |
58 | - Route::match( array( 'DELETE' ), 'jsonadm/{resource}/{id?}', array( |
|
58 | + Route::match(array('DELETE'), 'jsonadm/{resource}/{id?}', array( |
|
59 | 59 | 'as' => 'aimeos_shop_jsonadm_delete', |
60 | 60 | 'uses' => 'Aimeos\Shop\Controller\JsonadmController@deleteAction' |
61 | - ))->where( array( 'resource' => '[^0-9]+', 'id' => '[0-9]*' ) ); |
|
61 | + ))->where(array('resource' => '[^0-9]+', 'id' => '[0-9]*')); |
|
62 | 62 | |
63 | - Route::match( array( 'GET' ), 'jsonadm/{resource}/{id?}', array( |
|
63 | + Route::match(array('GET'), 'jsonadm/{resource}/{id?}', array( |
|
64 | 64 | 'as' => 'aimeos_shop_jsonadm_get', |
65 | 65 | 'uses' => 'Aimeos\Shop\Controller\JsonadmController@getAction' |
66 | - ))->where( array( 'resource' => '[^0-9]+', 'id' => '[0-9]*' ) ); |
|
66 | + ))->where(array('resource' => '[^0-9]+', 'id' => '[0-9]*')); |
|
67 | 67 | |
68 | - Route::match( array( 'PATCH' ), 'jsonadm/{resource}/{id?}', array( |
|
68 | + Route::match(array('PATCH'), 'jsonadm/{resource}/{id?}', array( |
|
69 | 69 | 'as' => 'aimeos_shop_jsonadm_patch', |
70 | 70 | 'uses' => 'Aimeos\Shop\Controller\JsonadmController@patchAction' |
71 | - ))->where( array( 'resource' => '[^0-9]+', 'id' => '[0-9]*' ) ); |
|
71 | + ))->where(array('resource' => '[^0-9]+', 'id' => '[0-9]*')); |
|
72 | 72 | |
73 | - Route::match( array( 'POST' ), 'jsonadm/{resource}/{id?}', array( |
|
73 | + Route::match(array('POST'), 'jsonadm/{resource}/{id?}', array( |
|
74 | 74 | 'as' => 'aimeos_shop_jsonadm_post', |
75 | 75 | 'uses' => 'Aimeos\Shop\Controller\JsonadmController@postAction' |
76 | - ))->where( array( 'resource' => '[^0-9]+', 'id' => '[0-9]*' ) ); |
|
76 | + ))->where(array('resource' => '[^0-9]+', 'id' => '[0-9]*')); |
|
77 | 77 | |
78 | - Route::match( array( 'PUT' ), 'jsonadm/{resource}/{id?}', array( |
|
78 | + Route::match(array('PUT'), 'jsonadm/{resource}/{id?}', array( |
|
79 | 79 | 'as' => 'aimeos_shop_jsonadm_put', |
80 | 80 | 'uses' => 'Aimeos\Shop\Controller\JsonadmController@putAction' |
81 | - ))->where( array( 'resource' => '[^0-9]+', 'id' => '[0-9]*' ) ); |
|
81 | + ))->where(array('resource' => '[^0-9]+', 'id' => '[0-9]*')); |
|
82 | 82 | |
83 | - Route::match( array( 'OPTIONS' ), 'jsonadm/{resource?}', array( |
|
83 | + Route::match(array('OPTIONS'), 'jsonadm/{resource?}', array( |
|
84 | 84 | 'as' => 'aimeos_shop_jsonadm_options', |
85 | 85 | 'uses' => 'Aimeos\Shop\Controller\JsonadmController@optionsAction' |
86 | - ))->where( array( 'resource' => '[^0-9]*' ) ); |
|
86 | + ))->where(array('resource' => '[^0-9]*')); |
|
87 | 87 | |
88 | 88 | }); |
89 | 89 | |
90 | 90 | |
91 | 91 | Route::group(config('shop.routes.account', ['middleware' => 'auth']), function() { |
92 | 92 | |
93 | - Route::match( array( 'GET', 'POST' ), 'myaccount', array( |
|
93 | + Route::match(array('GET', 'POST'), 'myaccount', array( |
|
94 | 94 | 'as' => 'aimeos_shop_account', |
95 | 95 | 'uses' => 'Aimeos\Shop\Controller\AccountController@indexAction' |
96 | 96 | )); |
97 | - Route::match( array( 'GET', 'POST' ), 'myaccount/favorite/{fav_action?}/{fav_id?}/{d_prodid?}/{d_name?}/{l_pos?}', array( |
|
97 | + Route::match(array('GET', 'POST'), 'myaccount/favorite/{fav_action?}/{fav_id?}/{d_prodid?}/{d_name?}/{l_pos?}', array( |
|
98 | 98 | 'as' => 'aimeos_shop_account_favorite', |
99 | 99 | 'uses' => 'Aimeos\Shop\Controller\AccountController@indexAction' |
100 | 100 | )); |
101 | - Route::match( array( 'GET', 'POST' ), 'myaccount/watch/{wat_action?}/{wat_id?}/{d_prodid?}/{d_name?}/{l_pos?}', array( |
|
101 | + Route::match(array('GET', 'POST'), 'myaccount/watch/{wat_action?}/{wat_id?}/{d_prodid?}/{d_name?}/{l_pos?}', array( |
|
102 | 102 | 'as' => 'aimeos_shop_account_watch', |
103 | 103 | 'uses' => 'Aimeos\Shop\Controller\AccountController@indexAction' |
104 | 104 | )); |
@@ -108,45 +108,45 @@ discard block |
||
108 | 108 | |
109 | 109 | Route::group(config('shop.routes.default', []), function() { |
110 | 110 | |
111 | - Route::match( array( 'GET', 'POST' ), 'basket', array( |
|
111 | + Route::match(array('GET', 'POST'), 'basket', array( |
|
112 | 112 | 'as' => 'aimeos_shop_basket', |
113 | 113 | 'uses' => 'Aimeos\Shop\Controller\BasketController@indexAction' |
114 | 114 | )); |
115 | 115 | |
116 | - Route::match( array( 'GET', 'POST' ), 'count', array( |
|
116 | + Route::match(array('GET', 'POST'), 'count', array( |
|
117 | 117 | 'as' => 'aimeos_shop_count', |
118 | 118 | 'uses' => 'Aimeos\Shop\Controller\CatalogController@countAction' |
119 | 119 | )); |
120 | - Route::match( array( 'GET', 'POST' ), 'detail/{d_prodid}/{d_name?}/{l_pos?}', array( |
|
120 | + Route::match(array('GET', 'POST'), 'detail/{d_prodid}/{d_name?}/{l_pos?}', array( |
|
121 | 121 | 'as' => 'aimeos_shop_detail', |
122 | 122 | 'uses' => 'Aimeos\Shop\Controller\CatalogController@detailAction' |
123 | 123 | )); |
124 | - Route::match( array( 'GET', 'POST' ), 'detail/pin/{pin_action?}/{pin_id?}/{d_prodid?}/{d_name?}/{l_pos?}', array( |
|
124 | + Route::match(array('GET', 'POST'), 'detail/pin/{pin_action?}/{pin_id?}/{d_prodid?}/{d_name?}/{l_pos?}', array( |
|
125 | 125 | 'as' => 'aimeos_shop_session_pinned', |
126 | 126 | 'uses' => 'Aimeos\Shop\Controller\CatalogController@detailAction' |
127 | 127 | )); |
128 | - Route::match( array( 'GET', 'POST' ), 'list', array( |
|
128 | + Route::match(array('GET', 'POST'), 'list', array( |
|
129 | 129 | 'as' => 'aimeos_shop_list', |
130 | 130 | 'uses' => 'Aimeos\Shop\Controller\CatalogController@listAction' |
131 | 131 | )); |
132 | - Route::match( array( 'GET', 'POST' ), 'suggest', array( |
|
132 | + Route::match(array('GET', 'POST'), 'suggest', array( |
|
133 | 133 | 'as' => 'aimeos_shop_suggest', |
134 | 134 | 'uses' => 'Aimeos\Shop\Controller\CatalogController@suggestAction' |
135 | 135 | )); |
136 | - Route::match( array( 'GET', 'POST' ), 'stock', array( |
|
136 | + Route::match(array('GET', 'POST'), 'stock', array( |
|
137 | 137 | 'as' => 'aimeos_shop_stock', |
138 | 138 | 'uses' => 'Aimeos\Shop\Controller\CatalogController@stockAction' |
139 | 139 | )); |
140 | 140 | |
141 | - Route::match( array( 'GET', 'POST' ), 'checkout/{c_step?}', array( |
|
141 | + Route::match(array('GET', 'POST'), 'checkout/{c_step?}', array( |
|
142 | 142 | 'as' => 'aimeos_shop_checkout', |
143 | 143 | 'uses' => 'Aimeos\Shop\Controller\CheckoutController@indexAction' |
144 | 144 | )); |
145 | - Route::match( array( 'GET', 'POST' ), 'confirm', array( |
|
145 | + Route::match(array('GET', 'POST'), 'confirm', array( |
|
146 | 146 | 'as' => 'aimeos_shop_confirm', |
147 | 147 | 'uses' => 'Aimeos\Shop\Controller\CheckoutController@confirmAction' |
148 | 148 | )); |
149 | - Route::match( array( 'GET', 'POST' ), 'update', array( |
|
149 | + Route::match(array('GET', 'POST'), 'update', array( |
|
150 | 150 | 'as' => 'aimeos_shop_update', |
151 | 151 | 'uses' => 'Aimeos\Shop\Controller\CheckoutController@updateAction' |
152 | 152 | )); |