@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | use Illuminate\Support\Facades\View; |
20 | 20 | use App\Http\Controllers\Controller; |
21 | 21 | |
22 | -class AdminModuleController extends Controller{ |
|
22 | +class AdminModuleController extends Controller { |
|
23 | 23 | |
24 | 24 | /** |
25 | 25 | * Module name |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | * Module name for blade |
125 | 125 | */ |
126 | 126 | $temp = explode('.', $this->moduleBasicRoute); |
127 | - View::share('moduleNameBlade', strtolower($temp[0] . "_module_" . $temp[1])); |
|
127 | + View::share('moduleNameBlade', strtolower($temp[ 0 ] . "_module_" . $temp[ 1 ])); |
|
128 | 128 | |
129 | 129 | } |
130 | 130 | |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | * @param boolean $update |
137 | 137 | * @return boolean |
138 | 138 | */ |
139 | - public function saveMediaToStorage($object, $request, $update = FALSE){ |
|
139 | + public function saveMediaToStorage($object, $request, $update = FALSE) { |
|
140 | 140 | |
141 | 141 | return FALSE; |
142 | 142 | } |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | |
153 | 153 | return env('ADMIN_PAGINATE', 10); |
154 | 154 | } |
155 | - else{ |
|
155 | + else { |
|
156 | 156 | |
157 | 157 | return $this->paginateRows; |
158 | 158 | } |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | * @param object $object |
165 | 165 | * @param Request $request |
166 | 166 | */ |
167 | - public function associateRelationships($object, Request $request){ |
|
167 | + public function associateRelationships($object, Request $request) { |
|
168 | 168 | |
169 | 169 | } |
170 | 170 | |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | * @param object $object |
175 | 175 | * @param Request $request |
176 | 176 | */ |
177 | - public function associateRelationshipsWithID($object, Request $request){ |
|
177 | + public function associateRelationshipsWithID($object, Request $request) { |
|
178 | 178 | |
179 | 179 | } |
180 | 180 | |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | * |
184 | 184 | * @param object $object |
185 | 185 | */ |
186 | - public function resetCache($object){ |
|
186 | + public function resetCache($object) { |
|
187 | 187 | |
188 | 188 | } |
189 | 189 | |
@@ -217,17 +217,17 @@ discard block |
||
217 | 217 | /** |
218 | 218 | * Choose the view |
219 | 219 | */ |
220 | - if(empty($this->customView['index']) == TRUE){ |
|
220 | + if (empty($this->customView[ 'index' ]) == TRUE) { |
|
221 | 221 | $view = $this->moduleBasicTemplatePath . '.index'; |
222 | 222 | } |
223 | - else{ |
|
223 | + else { |
|
224 | 224 | $view = $this->customView; |
225 | 225 | } |
226 | 226 | |
227 | 227 | /** |
228 | 228 | * Return page |
229 | 229 | */ |
230 | - return view($view, array_merge(['results' => $arResults])); |
|
230 | + return view($view, array_merge([ 'results' => $arResults ])); |
|
231 | 231 | } |
232 | 232 | |
233 | 233 | /** |
@@ -240,10 +240,10 @@ discard block |
||
240 | 240 | /** |
241 | 241 | * Choose the view |
242 | 242 | */ |
243 | - if(empty($this->customView['index']) == TRUE){ |
|
243 | + if (empty($this->customView[ 'index' ]) == TRUE) { |
|
244 | 244 | $view = $this->moduleBasicTemplatePath . '.create_edit'; |
245 | 245 | } |
246 | - else{ |
|
246 | + else { |
|
247 | 247 | $view = $this->customView; |
248 | 248 | } |
249 | 249 | |
@@ -265,8 +265,8 @@ discard block |
||
265 | 265 | * Change the validation array |
266 | 266 | */ |
267 | 267 | foreach ($this->arValidationArray as $name => $value) { |
268 | - if(strpos($this->arValidationArray[$name], 'unique') > 0){ |
|
269 | - $this->arValidationArray[$name] = $value . ',NULL,id,deleted_at,NULL'; |
|
268 | + if (strpos($this->arValidationArray[ $name ], 'unique') > 0) { |
|
269 | + $this->arValidationArray[ $name ] = $value . ',NULL,id,deleted_at,NULL'; |
|
270 | 270 | } |
271 | 271 | } |
272 | 272 | |
@@ -329,35 +329,35 @@ discard block |
||
329 | 329 | * Get the row |
330 | 330 | */ |
331 | 331 | $arResults = $modelClass::where('id', $id)->relationships()->excludeFromFind()->get(); |
332 | - $arResults = $arResults[0]; |
|
332 | + $arResults = $arResults[ 0 ]; |
|
333 | 333 | |
334 | 334 | /** |
335 | 335 | * Row does not exist - redirect |
336 | 336 | */ |
337 | 337 | if (count($arResults) == 0) { |
338 | 338 | |
339 | - return redirect(route($this->moduleBasicRoute . '.index'))->withInput()->withErrors(['edit' => trans('validation.row_not_exist')]); |
|
339 | + return redirect(route($this->moduleBasicRoute . '.index'))->withInput()->withErrors([ 'edit' => trans('validation.row_not_exist') ]); |
|
340 | 340 | } |
341 | 341 | |
342 | 342 | /** |
343 | 343 | * Set the put method for update |
344 | 344 | */ |
345 | - $arResults['_method'] = 'PUT'; |
|
345 | + $arResults[ '_method' ] = 'PUT'; |
|
346 | 346 | |
347 | 347 | /** |
348 | 348 | * Choose the view |
349 | 349 | */ |
350 | - if(empty($this->customView['index']) == TRUE){ |
|
350 | + if (empty($this->customView[ 'index' ]) == TRUE) { |
|
351 | 351 | $view = $this->moduleBasicTemplatePath . '.create_edit'; |
352 | 352 | } |
353 | - else{ |
|
353 | + else { |
|
354 | 354 | $view = $this->customView; |
355 | 355 | } |
356 | 356 | |
357 | 357 | /** |
358 | 358 | * Return page |
359 | 359 | */ |
360 | - return view($view, ['results' => $arResults]); |
|
360 | + return view($view, [ 'results' => $arResults ]); |
|
361 | 361 | } |
362 | 362 | |
363 | 363 | /** |
@@ -385,8 +385,8 @@ discard block |
||
385 | 385 | */ |
386 | 386 | foreach ($this->arValidationArray as $name => $value) { |
387 | 387 | |
388 | - if(strpos($this->arValidationArray[$name], 'unique') > 0){ |
|
389 | - $this->arValidationArray[$name] = $value . ','.$id.',id,deleted_at,NULL'; |
|
388 | + if (strpos($this->arValidationArray[ $name ], 'unique') > 0) { |
|
389 | + $this->arValidationArray[ $name ] = $value . ',' . $id . ',id,deleted_at,NULL'; |
|
390 | 390 | } |
391 | 391 | } |
392 | 392 | |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | */ |
407 | 407 | if ($arResults == FALSE) { |
408 | 408 | |
409 | - return redirect(route($this->moduleBasicRoute . '.index'))->withInput()->withErrors(['edit' => trans('validation.row_not_exist')]); |
|
409 | + return redirect(route($this->moduleBasicRoute . '.index'))->withInput()->withErrors([ 'edit' => trans('validation.row_not_exist') ]); |
|
410 | 410 | } |
411 | 411 | |
412 | 412 | /** |
@@ -424,7 +424,7 @@ discard block |
||
424 | 424 | * |
425 | 425 | * @todo Delete |
426 | 426 | */ |
427 | - if(in_array($name, $this->binaryFields)){ |
|
427 | + if (in_array($name, $this->binaryFields)) { |
|
428 | 428 | |
429 | 429 | /** |
430 | 430 | * @todo Check this function |
@@ -432,7 +432,7 @@ discard block |
||
432 | 432 | $this->arValidationArray[$name] = $value . ',' . $id; |
433 | 433 | }**/ |
434 | 434 | } |
435 | - else{ |
|
435 | + else { |
|
436 | 436 | |
437 | 437 | /** |
438 | 438 | * Empty exception |
@@ -441,17 +441,17 @@ discard block |
||
441 | 441 | $arResults->$name = $request->input($name); |
442 | 442 | } |
443 | 443 | |
444 | - else{ |
|
444 | + else { |
|
445 | 445 | |
446 | 446 | /** |
447 | 447 | * Numeric zero ? |
448 | 448 | */ |
449 | - if(@is_numeric($request->input($name)) == TRUE){ |
|
449 | + if (@is_numeric($request->input($name)) == TRUE) { |
|
450 | 450 | |
451 | 451 | $arResults->$name = $request->input($name); |
452 | 452 | } |
453 | 453 | |
454 | - else{ |
|
454 | + else { |
|
455 | 455 | $arResults->$name = NULL; |
456 | 456 | } |
457 | 457 | } |
@@ -468,7 +468,7 @@ discard block |
||
468 | 468 | /** |
469 | 469 | * Save media to storage |
470 | 470 | */ |
471 | - if($this->saveMediaToStorage($arResults, $request, TRUE) == TRUE){ |
|
471 | + if ($this->saveMediaToStorage($arResults, $request, TRUE) == TRUE) { |
|
472 | 472 | |
473 | 473 | // Update binary fields |
474 | 474 | foreach ($this->binaryFields as $name => $value) { |
@@ -476,7 +476,7 @@ discard block |
||
476 | 476 | if (empty($request->$value) == FALSE) { |
477 | 477 | $arResults->$value = $request->$value; |
478 | 478 | } |
479 | - else{ |
|
479 | + else { |
|
480 | 480 | $arResults->$value = NULL; |
481 | 481 | } |
482 | 482 | } |
@@ -151,8 +151,7 @@ discard block |
||
151 | 151 | if ($this->paginateRows == NULL) { |
152 | 152 | |
153 | 153 | return env('ADMIN_PAGINATE', 10); |
154 | - } |
|
155 | - else{ |
|
154 | + } else{ |
|
156 | 155 | |
157 | 156 | return $this->paginateRows; |
158 | 157 | } |
@@ -219,8 +218,7 @@ discard block |
||
219 | 218 | */ |
220 | 219 | if(empty($this->customView['index']) == TRUE){ |
221 | 220 | $view = $this->moduleBasicTemplatePath . '.index'; |
222 | - } |
|
223 | - else{ |
|
221 | + } else{ |
|
224 | 222 | $view = $this->customView; |
225 | 223 | } |
226 | 224 | |
@@ -242,8 +240,7 @@ discard block |
||
242 | 240 | */ |
243 | 241 | if(empty($this->customView['index']) == TRUE){ |
244 | 242 | $view = $this->moduleBasicTemplatePath . '.create_edit'; |
245 | - } |
|
246 | - else{ |
|
243 | + } else{ |
|
247 | 244 | $view = $this->customView; |
248 | 245 | } |
249 | 246 | |
@@ -349,8 +346,7 @@ discard block |
||
349 | 346 | */ |
350 | 347 | if(empty($this->customView['index']) == TRUE){ |
351 | 348 | $view = $this->moduleBasicTemplatePath . '.create_edit'; |
352 | - } |
|
353 | - else{ |
|
349 | + } else{ |
|
354 | 350 | $view = $this->customView; |
355 | 351 | } |
356 | 352 | |
@@ -431,17 +427,14 @@ discard block |
||
431 | 427 | * if($request->has($name)){ |
432 | 428 | $this->arValidationArray[$name] = $value . ',' . $id; |
433 | 429 | }**/ |
434 | - } |
|
435 | - else{ |
|
430 | + } else{ |
|
436 | 431 | |
437 | 432 | /** |
438 | 433 | * Empty exception |
439 | 434 | */ |
440 | 435 | if (empty($request->input($name)) == FALSE) { |
441 | 436 | $arResults->$name = $request->input($name); |
442 | - } |
|
443 | - |
|
444 | - else{ |
|
437 | + } else{ |
|
445 | 438 | |
446 | 439 | /** |
447 | 440 | * Numeric zero ? |
@@ -449,9 +442,7 @@ discard block |
||
449 | 442 | if(@is_numeric($request->input($name)) == TRUE){ |
450 | 443 | |
451 | 444 | $arResults->$name = $request->input($name); |
452 | - } |
|
453 | - |
|
454 | - else{ |
|
445 | + } else{ |
|
455 | 446 | $arResults->$name = NULL; |
456 | 447 | } |
457 | 448 | } |
@@ -475,8 +466,7 @@ discard block |
||
475 | 466 | |
476 | 467 | if (empty($request->$value) == FALSE) { |
477 | 468 | $arResults->$value = $request->$value; |
478 | - } |
|
479 | - else{ |
|
469 | + } else{ |
|
480 | 470 | $arResults->$value = NULL; |
481 | 471 | } |
482 | 472 | } |