Completed
Push — master ( e63e7d...d63c8b )
by Aimeos
03:05
created
src/views/jqadm/index.blade.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 		<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/tether/1.2.0/css/tether.min.css">
11 11
 		<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css">
12 12
 		<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.2/css/bootstrap.min.css">
13
-		<link rel="stylesheet" href="<?= route( 'aimeos_shop_jqadm_file', array( 'site' => $site, 'type' => 'css' ) ); ?>">
13
+		<link rel="stylesheet" href="<?= route('aimeos_shop_jqadm_file', array('site' => $site, 'type' => 'css')); ?>">
14 14
 
15 15
     	<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
16 16
     	<!--[if lt IE 9]>
@@ -29,6 +29,6 @@  discard block
 block discarded – undo
29 29
 		<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.2/js/bootstrap.min.js"></script>
30 30
 		<script src="//cdnjs.cloudflare.com/ajax/libs/ckeditor/4.5.4/ckeditor.js"></script>
31 31
 		<script src="//cdnjs.cloudflare.com/ajax/libs/ckeditor/4.5.4/adapters/jquery.js"></script>
32
-		<script src="<?= route( 'aimeos_shop_jqadm_file', array( 'site' => $site, 'type' => 'js' ) ); ?>"></script>
32
+		<script src="<?= route('aimeos_shop_jqadm_file', array('site' => $site, 'type' => 'js')); ?>"></script>
33 33
 	</body>
34 34
 </html>
Please login to merge, or discard this patch.
src/views/extadm/index.blade.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
         <link type="text/css" rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/extjs/3.4.1-1/resources/css/ext-all.css" />
10 10
         <link type="text/css" rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/extjs/3.4.1-1/resources/css/xtheme-gray.css" />
11 11
 @foreach ($cssFiles as $cssFile)
12
-        <link rel="stylesheet" href="<?= asset('packages/aimeos/shop/' . $cssFile) ?>" />
12
+        <link rel="stylesheet" href="<?= asset('packages/aimeos/shop/'.$cssFile) ?>" />
13 13
 @endforeach
14 14
 
15 15
         <script type="text/javascript">
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 
46 46
         <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/extjs/3.4.1-1/adapter/ext/ext-base.js"></script>
47 47
         <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/extjs/3.4.1-1/ext-all.js"></script>
48
-        <script type="text/javascript" src="<?= route( 'aimeos_shop_extadm_file', array( 'site' => $site ) ); ?>"></script>
48
+        <script type="text/javascript" src="<?= route('aimeos_shop_extadm_file', array('site' => $site)); ?>"></script>
49 49
 
50 50
     </head>
51 51
     <body>
Please login to merge, or discard this patch.
src/Aimeos/Shop/Controller/AdminController.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -36,20 +36,20 @@
 block discarded – undo
36 36
 	 * @param \Illuminate\Http\Request $request Laravel request object
37 37
 	 * @return \Illuminate\Contracts\View\View View for rendering the output
38 38
 	 */
39
-	public function indexAction( Request $request )
39
+	public function indexAction(Request $request)
40 40
 	{
41
-		if( config( 'shop.authorize', true ) && ( Auth::check() === false
42
-			|| $request->user()->can( 'admin', ['admin', 'editor'] ) ) === false
41
+		if (config('shop.authorize', true) && (Auth::check() === false
42
+			|| $request->user()->can('admin', ['admin', 'editor'])) === false
43 43
 		) {
44
-			return View::make( 'shop::admin.index' );
44
+			return View::make('shop::admin.index');
45 45
 		}
46 46
 
47 47
 		$param = array(
48 48
 			'resource' => 'product',
49
-			'site' => Route::input( 'site', Input::get( 'site', 'default' ) ),
50
-			'lang' => Route::input( 'lang', Input::get( 'lang', config( 'app.locale', 'en' ) ) )
49
+			'site' => Route::input('site', Input::get('site', 'default')),
50
+			'lang' => Route::input('lang', Input::get('lang', config('app.locale', 'en')))
51 51
 		);
52 52
 
53
-		return redirect()->route( 'aimeos_shop_jqadm_search', $param );
53
+		return redirect()->route('aimeos_shop_jqadm_search', $param);
54 54
 	}
55 55
 }
56 56
\ No newline at end of file
Please login to merge, or discard this patch.
src/Aimeos/Shop/Controller/JqadmController.php 1 patch
Spacing   +57 added lines, -57 removed lines patch added patch discarded remove patch
@@ -34,38 +34,38 @@  discard block
 block discarded – undo
34 34
 	 */
35 35
 	public function fileAction()
36 36
 	{
37
-		if( config( 'shop.authorize', true ) ) {
38
-			$this->authorize( 'admin', [['admin', 'editor']] );
37
+		if (config('shop.authorize', true)) {
38
+			$this->authorize('admin', [['admin', 'editor']]);
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
 block discarded – undo
79 79
 	 */
80 80
 	public function copyAction()
81 81
 	{
82
-		if( config( 'shop.authorize', true ) ) {
83
-			$this->authorize( 'admin', [['admin', 'editor']] );
82
+		if (config('shop.authorize', true)) {
83
+			$this->authorize('admin', [['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
 block discarded – undo
95 95
 	 */
96 96
 	public function createAction()
97 97
 	{
98
-		if( config( 'shop.authorize', true ) ) {
99
-			$this->authorize( 'admin', [['admin', 'editor']] );
98
+		if (config('shop.authorize', true)) {
99
+			$this->authorize('admin', [['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,12 +111,12 @@  discard block
 block discarded – undo
111 111
 	 */
112 112
 	public function deleteAction()
113 113
 	{
114
-		if( config( 'shop.authorize', true ) ) {
115
-			$this->authorize( 'admin', [['admin', 'editor']] );
114
+		if (config('shop.authorize', true)) {
115
+			$this->authorize('admin', [['admin', 'editor']]);
116 116
 		}
117 117
 
118 118
 		$cntl = $this->createClient();
119
-		return $this->getHtml( $cntl->delete() . $cntl->search() );
119
+		return $this->getHtml($cntl->delete().$cntl->search());
120 120
 	}
121 121
 
122 122
 
@@ -127,12 +127,12 @@  discard block
 block discarded – undo
127 127
 	 */
128 128
 	public function getAction()
129 129
 	{
130
-		if( config( 'shop.authorize', true ) ) {
131
-			$this->authorize( 'admin', [['admin', 'editor']] );
130
+		if (config('shop.authorize', true)) {
131
+			$this->authorize('admin', [['admin', 'editor']]);
132 132
 		}
133 133
 
134 134
 		$cntl = $this->createClient();
135
-		return $this->getHtml( $cntl->get() );
135
+		return $this->getHtml($cntl->get());
136 136
 	}
137 137
 
138 138
 
@@ -143,12 +143,12 @@  discard block
 block discarded – undo
143 143
 	 */
144 144
 	public function saveAction()
145 145
 	{
146
-		if( config( 'shop.authorize', true ) ) {
147
-			$this->authorize( 'admin', [['admin', 'editor']] );
146
+		if (config('shop.authorize', true)) {
147
+			$this->authorize('admin', [['admin', 'editor']]);
148 148
 		}
149 149
 
150 150
 		$cntl = $this->createClient();
151
-		return $this->getHtml( ( $cntl->save() ? : $cntl->search() ) );
151
+		return $this->getHtml(($cntl->save() ?: $cntl->search()));
152 152
 	}
153 153
 
154 154
 
@@ -159,12 +159,12 @@  discard block
 block discarded – undo
159 159
 	 */
160 160
 	public function searchAction()
161 161
 	{
162
-		if( config( 'shop.authorize', true ) ) {
163
-			$this->authorize( 'admin', [['admin', 'editor']] );
162
+		if (config('shop.authorize', true)) {
163
+			$this->authorize('admin', [['admin', 'editor']]);
164 164
 		}
165 165
 
166 166
 		$cntl = $this->createClient();
167
-		return $this->getHtml( $cntl->search() );
167
+		return $this->getHtml($cntl->search());
168 168
 	}
169 169
 
170 170
 
@@ -175,20 +175,20 @@  discard block
 block discarded – undo
175 175
 	 */
176 176
 	protected function createClient()
177 177
 	{
178
-		$site = Route::input( 'site', Input::get( 'site', 'default' ) );
179
-		$lang = Input::get( 'lang', config( 'app.locale', 'en' ) );
180
-		$resource = Route::input( 'resource' );
178
+		$site = Route::input('site', Input::get('site', 'default'));
179
+		$lang = Input::get('lang', config('app.locale', 'en'));
180
+		$resource = Route::input('resource');
181 181
 
182
-		$aimeos = app( '\Aimeos\Shop\Base\Aimeos' )->get();
183
-		$templatePaths = $aimeos->getCustomPaths( 'admin/jqadm/templates' );
182
+		$aimeos = app('\Aimeos\Shop\Base\Aimeos')->get();
183
+		$templatePaths = $aimeos->getCustomPaths('admin/jqadm/templates');
184 184
 
185
-		$context = app( '\Aimeos\Shop\Base\Context' )->get( false );
186
-		$context = $this->setLocale( $context, $site, $lang );
185
+		$context = app('\Aimeos\Shop\Base\Context')->get(false);
186
+		$context = $this->setLocale($context, $site, $lang);
187 187
 
188
-		$view = app( '\Aimeos\Shop\Base\View' )->create( $context->getConfig(), $templatePaths, $lang );
189
-		$context->setView( $view );
188
+		$view = app('\Aimeos\Shop\Base\View')->create($context->getConfig(), $templatePaths, $lang);
189
+		$context->setView($view);
190 190
 
191
-		return \Aimeos\Admin\JQAdm\Factory::createClient( $context, $templatePaths, $resource );
191
+		return \Aimeos\Admin\JQAdm\Factory::createClient($context, $templatePaths, $resource);
192 192
 	}
193 193
 
194 194
 
@@ -198,13 +198,13 @@  discard block
 block discarded – undo
198 198
 	 * @param string $content Content from admin client
199 199
 	 * @return \Illuminate\Contracts\View\View View for rendering the output
200 200
 	 */
201
-	protected function getHtml( $content )
201
+	protected function getHtml($content)
202 202
 	{
203
-		$version = app( '\Aimeos\Shop\Base\Aimeos' )->getVersion();
204
-		$site = Route::input( 'site', Input::get( 'site', 'default' ) );
205
-		$content = str_replace( ['{type}', '{version}'], ['Laravel', $version], $content );
203
+		$version = app('\Aimeos\Shop\Base\Aimeos')->getVersion();
204
+		$site = Route::input('site', Input::get('site', 'default'));
205
+		$content = str_replace(['{type}', '{version}'], ['Laravel', $version], $content);
206 206
 
207
-		return View::make( 'shop::jqadm.index', array( 'content' => $content, 'site' => $site ) );
207
+		return View::make('shop::jqadm.index', array('content' => $content, 'site' => $site));
208 208
 	}
209 209
 
210 210
 
@@ -216,23 +216,23 @@  discard block
 block discarded – undo
216 216
 	 * @param string $lang ISO language code, e.g. "en" or "en_GB"
217 217
 	 * @return \Aimeos\MShop\Context\Item\Iface Modified context object
218 218
 	 */
219
-	protected function setLocale( \Aimeos\MShop\Context\Item\Iface $context, $site, $lang )
219
+	protected function setLocale(\Aimeos\MShop\Context\Item\Iface $context, $site, $lang)
220 220
 	{
221
-		$localeManager = \Aimeos\MShop\Factory::createManager( $context, 'locale' );
221
+		$localeManager = \Aimeos\MShop\Factory::createManager($context, 'locale');
222 222
 
223 223
 		try
224 224
 		{
225
-			$localeItem = $localeManager->bootstrap( $site, '', '', false );
226
-			$localeItem->setLanguageId( null );
227
-			$localeItem->setCurrencyId( null );
225
+			$localeItem = $localeManager->bootstrap($site, '', '', false);
226
+			$localeItem->setLanguageId(null);
227
+			$localeItem->setCurrencyId(null);
228 228
 		}
229
-		catch( \Aimeos\MShop\Locale\Exception $e )
229
+		catch (\Aimeos\MShop\Locale\Exception $e)
230 230
 		{
231 231
 			$localeItem = $localeManager->createItem();
232 232
 		}
233 233
 
234
-		$context->setLocale( $localeItem );
235
-		$context->setI18n( app('\Aimeos\Shop\Base\I18n')->get( array( $lang, 'en' ) ) );
234
+		$context->setLocale($localeItem);
235
+		$context->setI18n(app('\Aimeos\Shop\Base\I18n')->get(array($lang, 'en')));
236 236
 
237 237
 		return $context;
238 238
 	}
Please login to merge, or discard this patch.