@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <div class="autoscroll-x"> |
2 | - <?php $filterOrderBy = !empty($selectedFilter) ? (array) $selectedFilter->order_by : []; ?> |
|
2 | + <?php $filterOrderBy = !empty($selectedFilter) ? (array)$selectedFilter->order_by : [ ]; ?> |
|
3 | 3 | <table |
4 | 4 | id="{{ $datatableId }}" |
5 | 5 | class="striped highlight" |
@@ -31,15 +31,15 @@ discard block |
||
31 | 31 | <div class="search hide-on-small-only hide-on-med-only"> |
32 | 32 | <?php |
33 | 33 | $searchValue = null; |
34 | - if (!empty($selectedFilter) && !empty($selectedFilter->conditions->search->{$column['name']})) { |
|
35 | - $searchValue = $selectedFilter->conditions->search->{$column['name']}; |
|
34 | + if (!empty($selectedFilter) && !empty($selectedFilter->conditions->search->{$column[ 'name' ]})) { |
|
35 | + $searchValue = $selectedFilter->conditions->search->{$column[ 'name' ]}; |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | // If a special template exists, use it. Else use the generic template |
39 | 39 | $uitypeViewName = sprintf('uitypes.search.%s', $column[ 'uitype' ]); |
40 | 40 | $uitypeFallbackView = 'uccello::modules.default.uitypes.search.text'; |
41 | 41 | $uitypeViewToInclude = uccello()->view($column[ 'package' ], $module, $uitypeViewName, $uitypeFallbackView); |
42 | - $field = $module->fields()->where('name', $column['name'])->first(); |
|
42 | + $field = $module->fields()->where('name', $column[ 'name' ])->first(); |
|
43 | 43 | ?> |
44 | 44 | @include($uitypeViewToInclude, [ 'field' => $field ]) |
45 | 45 | </div> |
@@ -234,26 +234,26 @@ discard block |
||
234 | 234 | |
235 | 235 | if (is_numeric($nameOrId)) { |
236 | 236 | // Use cache |
237 | - $modules = Cache::rememberForever('modules_by_id', function () { |
|
237 | + $modules = Cache::rememberForever('modules_by_id', function() { |
|
238 | 238 | $modulesGroupedById = collect(); |
239 | 239 | Module::all()->map(function($item) use($modulesGroupedById) { |
240 | - $modulesGroupedById[$item->id] = $item; |
|
240 | + $modulesGroupedById[ $item->id ] = $item; |
|
241 | 241 | return $modulesGroupedById; |
242 | 242 | }); |
243 | 243 | return $modulesGroupedById; |
244 | 244 | }); |
245 | - return $modules[(string) $nameOrId] ?? null; |
|
245 | + return $modules[ (string)$nameOrId ] ?? null; |
|
246 | 246 | } else { |
247 | 247 | // Use cache |
248 | - $modules = Cache::rememberForever('modules_by_name', function () { |
|
248 | + $modules = Cache::rememberForever('modules_by_name', function() { |
|
249 | 249 | $modulesGroupedByName = collect(); |
250 | 250 | Module::all()->map(function($item) use($modulesGroupedByName) { |
251 | - $modulesGroupedByName[$item->name] = $item; |
|
251 | + $modulesGroupedByName[ $item->name ] = $item; |
|
252 | 252 | return $modulesGroupedByName; |
253 | 253 | }); |
254 | 254 | return $modulesGroupedByName; |
255 | 255 | }); |
256 | - return $modules[(string) $nameOrId] ?? null; |
|
256 | + return $modules[ (string)$nameOrId ] ?? null; |
|
257 | 257 | } |
258 | 258 | } |
259 | 259 | |
@@ -271,26 +271,26 @@ discard block |
||
271 | 271 | |
272 | 272 | if (is_numeric($nameOrId)) { |
273 | 273 | // Use cache |
274 | - $uitypes = Cache::rememberForever('uitypes_by_id', function () { |
|
274 | + $uitypes = Cache::rememberForever('uitypes_by_id', function() { |
|
275 | 275 | $uitypesGroupedById = collect(); |
276 | 276 | Uitype::all()->map(function($item) use($uitypesGroupedById) { |
277 | - $uitypesGroupedById[$item->id] = $item; |
|
277 | + $uitypesGroupedById[ $item->id ] = $item; |
|
278 | 278 | return $uitypesGroupedById; |
279 | 279 | }); |
280 | 280 | return $uitypesGroupedById; |
281 | 281 | }); |
282 | - return $uitypes[(string) $nameOrId] ?? null; |
|
282 | + return $uitypes[ (string)$nameOrId ] ?? null; |
|
283 | 283 | } else { |
284 | 284 | // Use cache |
285 | - $uitypes = Cache::rememberForever('uitypes_by_name', function () { |
|
285 | + $uitypes = Cache::rememberForever('uitypes_by_name', function() { |
|
286 | 286 | $uitypesGroupedByName = collect(); |
287 | 287 | Uitype::all()->map(function($item) use($uitypesGroupedByName) { |
288 | - $uitypesGroupedByName[$item->name] = $item; |
|
288 | + $uitypesGroupedByName[ $item->name ] = $item; |
|
289 | 289 | return $uitypesGroupedByName; |
290 | 290 | }); |
291 | 291 | return $uitypesGroupedByName; |
292 | 292 | }); |
293 | - return $uitypes[(string) $nameOrId] ?? null; |
|
293 | + return $uitypes[ (string)$nameOrId ] ?? null; |
|
294 | 294 | } |
295 | 295 | } |
296 | 296 | |
@@ -308,26 +308,26 @@ discard block |
||
308 | 308 | |
309 | 309 | if (is_numeric($nameOrId)) { |
310 | 310 | // Use cache |
311 | - $displaytypes = Cache::rememberForever('displaytypes_by_id', function () { |
|
311 | + $displaytypes = Cache::rememberForever('displaytypes_by_id', function() { |
|
312 | 312 | $displaytypesGroupedById = collect(); |
313 | 313 | Displaytype::all()->map(function($item) use($displaytypesGroupedById) { |
314 | - $displaytypesGroupedById[$item->id] = $item; |
|
314 | + $displaytypesGroupedById[ $item->id ] = $item; |
|
315 | 315 | return $displaytypesGroupedById; |
316 | 316 | }); |
317 | 317 | return $displaytypesGroupedById; |
318 | 318 | }); |
319 | - return $displaytypes[(string) $nameOrId] ?? null; |
|
319 | + return $displaytypes[ (string)$nameOrId ] ?? null; |
|
320 | 320 | } else { |
321 | 321 | // Use cache |
322 | - $displaytypes = Cache::rememberForever('displaytypes_by_name', function () { |
|
322 | + $displaytypes = Cache::rememberForever('displaytypes_by_name', function() { |
|
323 | 323 | $displaytypesGroupedByName = collect(); |
324 | 324 | Displaytype::all()->map(function($item) use($displaytypesGroupedByName) { |
325 | - $displaytypesGroupedByName[$item->name] = $item; |
|
325 | + $displaytypesGroupedByName[ $item->name ] = $item; |
|
326 | 326 | return $displaytypesGroupedByName; |
327 | 327 | }); |
328 | 328 | return $displaytypesGroupedByName; |
329 | 329 | }); |
330 | - return $displaytypes[(string) $nameOrId] ?? null; |
|
330 | + return $displaytypes[ (string)$nameOrId ] ?? null; |
|
331 | 331 | } |
332 | 332 | } |
333 | 333 | |
@@ -345,26 +345,26 @@ discard block |
||
345 | 345 | |
346 | 346 | if (is_numeric($nameOrId)) { |
347 | 347 | // Use cache |
348 | - $capabilities = Cache::rememberForever('capabilities_by_id', function () { |
|
348 | + $capabilities = Cache::rememberForever('capabilities_by_id', function() { |
|
349 | 349 | $capabilitiesGroupedById = collect(); |
350 | 350 | Capability::all()->map(function($item) use($capabilitiesGroupedById) { |
351 | - $capabilitiesGroupedById[$item->id] = $item; |
|
351 | + $capabilitiesGroupedById[ $item->id ] = $item; |
|
352 | 352 | return $capabilitiesGroupedById; |
353 | 353 | }); |
354 | 354 | return $capabilitiesGroupedById; |
355 | 355 | }); |
356 | - return $capabilities[(string) $nameOrId] ?? null; |
|
356 | + return $capabilities[ (string)$nameOrId ] ?? null; |
|
357 | 357 | } else { |
358 | 358 | // Use cache |
359 | - $capabilities = Cache::rememberForever('capabilities_by_name', function () { |
|
359 | + $capabilities = Cache::rememberForever('capabilities_by_name', function() { |
|
360 | 360 | $capabilitiesGroupedByName = collect(); |
361 | 361 | Capability::all()->map(function($item) use($capabilitiesGroupedByName) { |
362 | - $capabilitiesGroupedByName[$item->name] = $item; |
|
362 | + $capabilitiesGroupedByName[ $item->name ] = $item; |
|
363 | 363 | return $capabilitiesGroupedByName; |
364 | 364 | }); |
365 | 365 | return $capabilitiesGroupedByName; |
366 | 366 | }); |
367 | - return $capabilities[(string) $nameOrId] ?? null; |
|
367 | + return $capabilities[ (string)$nameOrId ] ?? null; |
|
368 | 368 | } |
369 | 369 | } |
370 | 370 | |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | * @param string $type |
407 | 407 | * @return array |
408 | 408 | */ |
409 | - public function getDatatableColumns(Module $module, $filterId=null, $type='list'): array |
|
409 | + public function getDatatableColumns(Module $module, $filterId = null, $type = 'list'): array |
|
410 | 410 | { |
411 | 411 | $columns = [ ]; |
412 | 412 | |
@@ -462,7 +462,7 @@ discard block |
||
462 | 462 | * @param string $type |
463 | 463 | * @return Filter |
464 | 464 | */ |
465 | - public function getDefaultFilter(Module $module, $type="list") |
|
465 | + public function getDefaultFilter(Module $module, $type = "list") |
|
466 | 466 | { |
467 | 467 | $filter = Filter::where('module_id', $module->id) |
468 | 468 | ->where('type', $type) |