Completed
Push — master ( 0ff3a3...4d0050 )
by Aimeos
02:36
created
src/Aimeos/Shop/Controller/JqadmController.php 2 patches
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 	/**
76 76
 	 * Returns the HTML code for a copy of a resource object
77 77
 	 *
78
-	 * @return string Generated output
78
+	 * @return \Illuminate\Contracts\View\View Generated output
79 79
 	 */
80 80
 	public function copyAction()
81 81
 	{
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 	/**
92 92
 	 * Returns the HTML code for a new resource object
93 93
 	 *
94
-	 * @return string Generated output
94
+	 * @return \Illuminate\Contracts\View\View Generated output
95 95
 	 */
96 96
 	public function createAction()
97 97
 	{
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 	/**
129 129
 	 * Returns the HTML code for the requested resource object
130 130
 	 *
131
-	 * @return string Generated output
131
+	 * @return \Illuminate\Contracts\View\View Generated output
132 132
 	 */
133 133
 	public function getAction()
134 134
 	{
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 	/**
166 166
 	 * Returns the HTML code for a list of resource objects
167 167
 	 *
168
-	 * @return string Generated output
168
+	 * @return \Illuminate\Contracts\View\View Generated output
169 169
 	 */
170 170
 	public function searchAction()
171 171
 	{
Please login to merge, or discard this patch.
Spacing   +52 added lines, -52 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', [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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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 );
200
+		return \Aimeos\Admin\JQAdm\Factory::createClient($context, $templatePaths, $resource);
201 201
 	}
202 202
 
203 203
 
@@ -207,15 +207,15 @@  discard block
 block discarded – undo
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
 }
Please login to merge, or discard this patch.