@@ -34,38 +34,38 @@ discard block |
||
34 | 34 | */ |
35 | 35 | public function fileAction() |
36 | 36 | { |
37 | - if( config( 'shop.authorize', true ) ) { |
|
38 | - $this->authorize( 'admin', [JqadmController::class, ['admin', 'editor', 'viewer']] ); |
|
37 | + if (config('shop.authorize', true)) { |
|
38 | + $this->authorize('admin', [JqadmController::class, ['admin', 'editor', 'viewer']]); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | $contents = ''; |
42 | 42 | $files = array(); |
43 | - $aimeos = app( '\Aimeos\Shop\Base\Aimeos' )->get(); |
|
44 | - $type = Route::input( 'type', Input::get( 'type', 'js' ) ); |
|
43 | + $aimeos = app('\Aimeos\Shop\Base\Aimeos')->get(); |
|
44 | + $type = Route::input('type', Input::get('type', 'js')); |
|
45 | 45 | |
46 | - foreach( $aimeos->getCustomPaths( 'admin/jqadm' ) as $base => $paths ) |
|
46 | + foreach ($aimeos->getCustomPaths('admin/jqadm') as $base => $paths) |
|
47 | 47 | { |
48 | - foreach( $paths as $path ) |
|
48 | + foreach ($paths as $path) |
|
49 | 49 | { |
50 | - $jsbAbsPath = $base . '/' . $path; |
|
51 | - $jsb2 = new \Aimeos\MW\Jsb2\Standard( $jsbAbsPath, dirname( $jsbAbsPath ) ); |
|
52 | - $files = array_merge( $files, $jsb2->getFiles( $type ) ); |
|
50 | + $jsbAbsPath = $base.'/'.$path; |
|
51 | + $jsb2 = new \Aimeos\MW\Jsb2\Standard($jsbAbsPath, dirname($jsbAbsPath)); |
|
52 | + $files = array_merge($files, $jsb2->getFiles($type)); |
|
53 | 53 | } |
54 | 54 | } |
55 | 55 | |
56 | - foreach( $files as $file ) |
|
56 | + foreach ($files as $file) |
|
57 | 57 | { |
58 | - if( ( $content = file_get_contents( $file ) ) !== false ) { |
|
58 | + if (($content = file_get_contents($file)) !== false) { |
|
59 | 59 | $contents .= $content; |
60 | 60 | } |
61 | 61 | } |
62 | 62 | |
63 | - $response = response( $contents ); |
|
63 | + $response = response($contents); |
|
64 | 64 | |
65 | - if( $type === 'js' ) { |
|
66 | - $response->header( 'Content-Type', 'application/javascript' ); |
|
67 | - } elseif( $type === 'css' ) { |
|
68 | - $response->header( 'Content-Type', 'text/css' ); |
|
65 | + if ($type === 'js') { |
|
66 | + $response->header('Content-Type', 'application/javascript'); |
|
67 | + } elseif ($type === 'css') { |
|
68 | + $response->header('Content-Type', 'text/css'); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | return $response; |
@@ -79,12 +79,12 @@ discard block |
||
79 | 79 | */ |
80 | 80 | public function copyAction() |
81 | 81 | { |
82 | - if( config( 'shop.authorize', true ) ) { |
|
83 | - $this->authorize( 'admin', [JqadmController::class, ['admin', 'editor']] ); |
|
82 | + if (config('shop.authorize', true)) { |
|
83 | + $this->authorize('admin', [JqadmController::class, ['admin', 'editor']]); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | $cntl = $this->createClient(); |
87 | - return $this->getHtml( $cntl->copy() ); |
|
87 | + return $this->getHtml($cntl->copy()); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | |
@@ -95,12 +95,12 @@ discard block |
||
95 | 95 | */ |
96 | 96 | public function createAction() |
97 | 97 | { |
98 | - if( config( 'shop.authorize', true ) ) { |
|
99 | - $this->authorize( 'admin', [JqadmController::class, ['admin', 'editor']] ); |
|
98 | + if (config('shop.authorize', true)) { |
|
99 | + $this->authorize('admin', [JqadmController::class, ['admin', 'editor']]); |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | $cntl = $this->createClient(); |
103 | - return $this->getHtml( $cntl->create() ); |
|
103 | + return $this->getHtml($cntl->create()); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | |
@@ -111,17 +111,17 @@ discard block |
||
111 | 111 | */ |
112 | 112 | public function deleteAction() |
113 | 113 | { |
114 | - if( config( 'shop.authorize', true ) ) { |
|
115 | - $this->authorize( 'admin', [JqadmController::class, ['admin', 'editor']] ); |
|
114 | + if (config('shop.authorize', true)) { |
|
115 | + $this->authorize('admin', [JqadmController::class, ['admin', 'editor']]); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | $cntl = $this->createClient(); |
119 | 119 | |
120 | - if( ( $html = $cntl->delete() ) == '' ) { |
|
120 | + if (($html = $cntl->delete()) == '') { |
|
121 | 121 | return $cntl->getView()->response(); |
122 | 122 | } |
123 | 123 | |
124 | - return $this->getHtml( $html ); |
|
124 | + return $this->getHtml($html); |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | |
@@ -132,12 +132,12 @@ discard block |
||
132 | 132 | */ |
133 | 133 | public function getAction() |
134 | 134 | { |
135 | - if( config( 'shop.authorize', true ) ) { |
|
136 | - $this->authorize( 'admin', [JqadmController::class, ['admin', 'editor', 'viewer']] ); |
|
135 | + if (config('shop.authorize', true)) { |
|
136 | + $this->authorize('admin', [JqadmController::class, ['admin', 'editor', 'viewer']]); |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | $cntl = $this->createClient(); |
140 | - return $this->getHtml( $cntl->get() ); |
|
140 | + return $this->getHtml($cntl->get()); |
|
141 | 141 | } |
142 | 142 | |
143 | 143 | |
@@ -148,17 +148,17 @@ discard block |
||
148 | 148 | */ |
149 | 149 | public function saveAction() |
150 | 150 | { |
151 | - if( config( 'shop.authorize', true ) ) { |
|
152 | - $this->authorize( 'admin', [JqadmController::class, ['admin', 'editor']] ); |
|
151 | + if (config('shop.authorize', true)) { |
|
152 | + $this->authorize('admin', [JqadmController::class, ['admin', 'editor']]); |
|
153 | 153 | } |
154 | 154 | |
155 | 155 | $cntl = $this->createClient(); |
156 | 156 | |
157 | - if( ( $html = $cntl->save() ) == '' ) { |
|
157 | + if (($html = $cntl->save()) == '') { |
|
158 | 158 | return $cntl->getView()->response(); |
159 | 159 | } |
160 | 160 | |
161 | - return $this->getHtml( $html ); |
|
161 | + return $this->getHtml($html); |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | |
@@ -169,12 +169,12 @@ discard block |
||
169 | 169 | */ |
170 | 170 | public function searchAction() |
171 | 171 | { |
172 | - if( config( 'shop.authorize', true ) ) { |
|
173 | - $this->authorize( 'admin', [JqadmController::class, ['admin', 'editor', 'viewer']] ); |
|
172 | + if (config('shop.authorize', true)) { |
|
173 | + $this->authorize('admin', [JqadmController::class, ['admin', 'editor', 'viewer']]); |
|
174 | 174 | } |
175 | 175 | |
176 | 176 | $cntl = $this->createClient(); |
177 | - return $this->getHtml( $cntl->search() ); |
|
177 | + return $this->getHtml($cntl->search()); |
|
178 | 178 | } |
179 | 179 | |
180 | 180 | |
@@ -185,19 +185,19 @@ discard block |
||
185 | 185 | */ |
186 | 186 | protected function createClient() |
187 | 187 | { |
188 | - $site = Route::input( 'site', Input::get( 'site', 'default' ) ); |
|
189 | - $lang = Input::get( 'lang', config( 'app.locale', 'en' ) ); |
|
190 | - $resource = Route::input( 'resource' ); |
|
188 | + $site = Route::input('site', Input::get('site', 'default')); |
|
189 | + $lang = Input::get('lang', config('app.locale', 'en')); |
|
190 | + $resource = Route::input('resource'); |
|
191 | 191 | |
192 | - $aimeos = app( '\Aimeos\Shop\Base\Aimeos' )->get(); |
|
193 | - $templatePaths = $aimeos->getCustomPaths( 'admin/jqadm/templates' ); |
|
192 | + $aimeos = app('\Aimeos\Shop\Base\Aimeos')->get(); |
|
193 | + $templatePaths = $aimeos->getCustomPaths('admin/jqadm/templates'); |
|
194 | 194 | |
195 | - $context = app( '\Aimeos\Shop\Base\Context' )->get( false, 'backend' ); |
|
196 | - $context->setI18n( app('\Aimeos\Shop\Base\I18n')->get( array( $lang, 'en' ) ) ); |
|
197 | - $context->setLocale( app('\Aimeos\Shop\Base\Locale')->getBackend( $context, $site ) ); |
|
198 | - $context->setView( app( '\Aimeos\Shop\Base\View' )->create( $context, $templatePaths, $lang ) ); |
|
195 | + $context = app('\Aimeos\Shop\Base\Context')->get(false, 'backend'); |
|
196 | + $context->setI18n(app('\Aimeos\Shop\Base\I18n')->get(array($lang, 'en'))); |
|
197 | + $context->setLocale(app('\Aimeos\Shop\Base\Locale')->getBackend($context, $site)); |
|
198 | + $context->setView(app('\Aimeos\Shop\Base\View')->create($context, $templatePaths, $lang)); |
|
199 | 199 | |
200 | - return \Aimeos\Admin\JQAdm\Factory::createClient( $context, $templatePaths, $resource )->setAimeos( $aimeos ); |
|
200 | + return \Aimeos\Admin\JQAdm\Factory::createClient($context, $templatePaths, $resource)->setAimeos($aimeos); |
|
201 | 201 | } |
202 | 202 | |
203 | 203 | |
@@ -207,15 +207,15 @@ discard block |
||
207 | 207 | * @param string $content Content from admin client |
208 | 208 | * @return \Illuminate\Contracts\View\View View for rendering the output |
209 | 209 | */ |
210 | - protected function getHtml( $content ) |
|
210 | + protected function getHtml($content) |
|
211 | 211 | { |
212 | - $aimeos = app( '\Aimeos\Shop\Base\Aimeos' ); |
|
213 | - $extnames = implode( ',', $aimeos->get()->getExtensions() ); |
|
212 | + $aimeos = app('\Aimeos\Shop\Base\Aimeos'); |
|
213 | + $extnames = implode(',', $aimeos->get()->getExtensions()); |
|
214 | 214 | $version = $aimeos->getVersion(); |
215 | 215 | |
216 | - $site = Route::input( 'site', Input::get( 'site', 'default' ) ); |
|
217 | - $content = str_replace( ['{type}', '{version}', '{extensions}'], ['Laravel', $version, $extnames], $content ); |
|
216 | + $site = Route::input('site', Input::get('site', 'default')); |
|
217 | + $content = str_replace(['{type}', '{version}', '{extensions}'], ['Laravel', $version, $extnames], $content); |
|
218 | 218 | |
219 | - return View::make( 'shop::jqadm.index', array( 'content' => $content, 'site' => $site ) ); |
|
219 | + return View::make('shop::jqadm.index', array('content' => $content, 'site' => $site)); |
|
220 | 220 | } |
221 | 221 | } |