@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <div class="row form-group"> |
2 | -<?php $key = isset($data['unique_id']) ? $data['key'] . '_' . $data['unique_id'] : $data['key'] ; ?> |
|
2 | +<?php $key = isset($data['unique_id']) ? $data['key'] . '_' . $data['unique_id'] : $data['key']; ?> |
|
3 | 3 | {{ html()->label($data['name'])->class('col-md-2 form-control-label')->for($key) }} |
4 | 4 | <div class="col-md-10"> |
5 | 5 | <div class="custom-control custom-switch"> |
@@ -9,16 +9,16 @@ discard block |
||
9 | 9 | ->value('1') |
10 | 10 | ->attribute('id', $key) |
11 | 11 | ->class('custom-control-input'); |
12 | - if($data['required']){ |
|
12 | + if ($data['required']) { |
|
13 | 13 | $input = $input->required(); |
14 | 14 | } |
15 | - if($asset_classname){ |
|
15 | + if ($asset_classname) { |
|
16 | 16 | $name = 'assetInjectionform[' . $asset_classname . '][' . $data['unique_id'] . '][' . $data['key'] . ']'; |
17 | - }else{ |
|
17 | + }else { |
|
18 | 18 | $name = $data['key']; |
19 | 19 | } |
20 | 20 | |
21 | - $name .= (isset($multiform) && $multiform) ? '[]' : '';?> |
|
21 | + $name .= (isset($multiform) && $multiform) ? '[]' : ''; ?> |
|
22 | 22 | |
23 | 23 | {{ $input->name($name)->checked(old($name, !empty($data['value']) ? true: false)) }} |
24 | 24 |
@@ -14,7 +14,7 @@ |
||
14 | 14 | } |
15 | 15 | if($asset_classname){ |
16 | 16 | $name = 'assetInjectionform[' . $asset_classname . '][' . $data['unique_id'] . '][' . $data['key'] . ']'; |
17 | - }else{ |
|
17 | + } else{ |
|
18 | 18 | $name = $data['key']; |
19 | 19 | } |
20 | 20 |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <div class="row form-group"> |
2 | - <?php $key = isset($data['unique_id']) ? $data['key'] . '_' . $data['unique_id'] : $data['key'] ; ?> |
|
2 | + <?php $key = isset($data['unique_id']) ? $data['key'] . '_' . $data['unique_id'] : $data['key']; ?> |
|
3 | 3 | {{ html()->label($data['name'])->class('col-md-2 form-control-label')->for($key) }} |
4 | 4 | <div class="col-md-10"> |
5 | 5 | |
@@ -7,16 +7,16 @@ discard block |
||
7 | 7 | ->text() |
8 | 8 | ->attribute('id', $key) |
9 | 9 | ->class('form-control'); |
10 | - if($data['required']){ |
|
10 | + if ($data['required']) { |
|
11 | 11 | $input = $input->required(); |
12 | 12 | } |
13 | - if($asset_classname){ |
|
13 | + if ($asset_classname) { |
|
14 | 14 | $name = 'assetInjectionform[' . $asset_classname . '][' . $data['unique_id'] . '][' . $data['key'] . ']'; |
15 | - }else{ |
|
15 | + }else { |
|
16 | 16 | $name = $data['key']; |
17 | 17 | } |
18 | 18 | |
19 | - $name .= (isset($multiform) && $multiform) ? '[]' : '';?> |
|
19 | + $name .= (isset($multiform) && $multiform) ? '[]' : ''; ?> |
|
20 | 20 | |
21 | 21 | {{ $input->name($name)->value(old($name, !empty($data['value']) ? $data['value'] : NULL)) }} |
22 | 22 |
@@ -12,7 +12,7 @@ |
||
12 | 12 | } |
13 | 13 | if($asset_classname){ |
14 | 14 | $name = 'assetInjectionform[' . $asset_classname . '][' . $data['unique_id'] . '][' . $data['key'] . ']'; |
15 | - }else{ |
|
15 | + } else{ |
|
16 | 16 | $name = $data['key']; |
17 | 17 | } |
18 | 18 |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <div class="row form-group"> |
2 | - <?php $key = isset($data['unique_id']) ? $data['key'] . '_' . $data['unique_id'] : $data['key'] ; ?> |
|
2 | + <?php $key = isset($data['unique_id']) ? $data['key'] . '_' . $data['unique_id'] : $data['key']; ?> |
|
3 | 3 | {{ html()->label($data['name'])->class('col-md-2 form-control-label')->for($key) }} |
4 | 4 | <div class="col-md-10"> |
5 | 5 | |
@@ -14,16 +14,16 @@ discard block |
||
14 | 14 | ->attribute('id', $key . '_file') |
15 | 15 | ->placeholder('Choose File') |
16 | 16 | ->class('form-control ams-upload-filename'); |
17 | - if($data['required']){ |
|
17 | + if ($data['required']) { |
|
18 | 18 | $input = $input->required(); |
19 | 19 | } |
20 | - if($asset_classname){ |
|
20 | + if ($asset_classname) { |
|
21 | 21 | $name = 'assetInjectionform[' . $asset_classname . '][' . $data['unique_id'] . '][' . $data['key'] . ']'; |
22 | - }else{ |
|
22 | + }else { |
|
23 | 23 | $name = $data['key']; |
24 | 24 | } |
25 | 25 | |
26 | - $name .= (isset($multiform) && $multiform) ? '[]' : '';?> |
|
26 | + $name .= (isset($multiform) && $multiform) ? '[]' : ''; ?> |
|
27 | 27 | |
28 | 28 | {{ $input->name($name)->value(old($name, !empty($data['value']) ? $data['value'] : NULL)) }} |
29 | 29 |
@@ -19,7 +19,7 @@ |
||
19 | 19 | } |
20 | 20 | if($asset_classname){ |
21 | 21 | $name = 'assetInjectionform[' . $asset_classname . '][' . $data['unique_id'] . '][' . $data['key'] . ']'; |
22 | - }else{ |
|
22 | + } else{ |
|
23 | 23 | $name = $data['key']; |
24 | 24 | } |
25 | 25 |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <div class="row form-group"> |
2 | - <?php $key = isset($data['unique_id']) ? $data['key'] . '_' . $data['unique_id'] : $data['key'] ; ?> |
|
2 | + <?php $key = isset($data['unique_id']) ? $data['key'] . '_' . $data['unique_id'] : $data['key']; ?> |
|
3 | 3 | |
4 | 4 | {{ html()->label($data['name'])->class('col-md-2 form-control-label')->for($key) }} |
5 | 5 | <div class="col-md-10"> |
@@ -14,17 +14,17 @@ discard block |
||
14 | 14 | ->attribute('id', $key) |
15 | 15 | ->class('form-control autoinput'); |
16 | 16 | |
17 | - if($data['required']){ |
|
17 | + if ($data['required']) { |
|
18 | 18 | $input = $input->required(); |
19 | 19 | } |
20 | 20 | |
21 | - if($asset_classname){ |
|
21 | + if ($asset_classname) { |
|
22 | 22 | $name = 'assetInjectionform[' . $asset_classname . '][' . $data['unique_id'] . '][' . $data['key'] . ']'; |
23 | - }else{ |
|
23 | + }else { |
|
24 | 24 | $name = $data['key']; |
25 | 25 | } |
26 | 26 | |
27 | - $name .= (isset($multiform) && $multiform) ? '[]' : '';?> |
|
27 | + $name .= (isset($multiform) && $multiform) ? '[]' : ''; ?> |
|
28 | 28 | |
29 | 29 | {{ $input->name($name)->value(old($name, !empty($data['value']) ? $data['value'] : NULL)) }} |
30 | 30 |
@@ -20,7 +20,7 @@ |
||
20 | 20 | |
21 | 21 | if($asset_classname){ |
22 | 22 | $name = 'assetInjectionform[' . $asset_classname . '][' . $data['unique_id'] . '][' . $data['key'] . ']'; |
23 | - }else{ |
|
23 | + } else{ |
|
24 | 24 | $name = $data['key']; |
25 | 25 | } |
26 | 26 |
@@ -1,12 +1,12 @@ |
||
1 | 1 | <?php |
2 | - $user_labels = is_array($data['meta']) ? $data['meta'] : []; |
|
2 | + $user_labels = is_array($data['meta']) ? $data['meta'] : []; |
|
3 | 3 | $options = !empty($data['options']) ? $data['options'] : []; |
4 | 4 | |
5 | - $uid = $data['key'] . $data['unique_id']; |
|
6 | - if($asset_classname){ |
|
5 | + $uid = $data['key'] . $data['unique_id']; |
|
6 | + if ($asset_classname) { |
|
7 | 7 | $name = 'assetInjectionform[' . $asset_classname . '][' . $data['unique_id'] . '][' . $data['key'] . ']'; |
8 | 8 | $nameMeta = "assetInjectionform[{$asset_classname}][{$data['unique_id']}][_meta_][{$data['key']}]"; |
9 | - }else{ |
|
9 | + }else { |
|
10 | 10 | $name = $data['key']; |
11 | 11 | $nameMeta = "_meta_[{$data['key']}]"; |
12 | 12 | } |
@@ -6,7 +6,7 @@ |
||
6 | 6 | if($asset_classname){ |
7 | 7 | $name = 'assetInjectionform[' . $asset_classname . '][' . $data['unique_id'] . '][' . $data['key'] . ']'; |
8 | 8 | $nameMeta = "assetInjectionform[{$asset_classname}][{$data['unique_id']}][_meta_][{$data['key']}]"; |
9 | - }else{ |
|
9 | + } else{ |
|
10 | 10 | $name = $data['key']; |
11 | 11 | $nameMeta = "_meta_[{$data['key']}]"; |
12 | 12 | } |
@@ -9,17 +9,17 @@ |
||
9 | 9 | {{ $datastore->render('content') }} |
10 | 10 | |
11 | 11 | |
12 | - <?php if($children):?> |
|
12 | + <?php if ($children):?> |
|
13 | 13 | <nav> |
14 | 14 | <div class="nav nav-tabs" id="asset-tab" role="tablist"> |
15 | - <?php foreach($children as $idx => $child): ?> |
|
16 | - <a class="nav-item nav-link<?php echo $idx === 0 ?' active' : '';?>" id="child-{{ $idx }}-tab" data-toggle="tab" href="#asset-{{ $idx }}" role="tab" aria-controls="asset-{{ $idx }}" aria-selected="true">{{ $child->prop('title') }}</a> |
|
15 | + <?php foreach ($children as $idx => $child): ?> |
|
16 | + <a class="nav-item nav-link<?php echo $idx === 0 ? ' active' : ''; ?>" id="child-{{ $idx }}-tab" data-toggle="tab" href="#asset-{{ $idx }}" role="tab" aria-controls="asset-{{ $idx }}" aria-selected="true">{{ $child->prop('title') }}</a> |
|
17 | 17 | <?php endforeach; ?> |
18 | 18 | |
19 | 19 | </div> |
20 | 20 | </nav> |
21 | 21 | <div class="tab-content" id="asset-tabContent"> |
22 | - <?php foreach($children as $idx => $child): ?> |
|
22 | + <?php foreach ($children as $idx => $child): ?> |
|
23 | 23 | <div class="tab-pane fade<?php echo $idx === 0 ? ' show active' : ''; ?>" id="asset-{{ $idx }}" role="tabpanel" aria-labelledby="asset-{{ $idx }}-tab"> |
24 | 24 | {{ $child->prop('content')}} |
25 | 25 | </div> |
@@ -19,8 +19,8 @@ |
||
19 | 19 | |
20 | 20 | |
21 | 21 | public function parent() |
22 | - { |
|
23 | - return $this->belongsTo(DatastoreModel::class, 'datastore2_id'); |
|
22 | + { |
|
23 | + return $this->belongsTo(DatastoreModel::class, 'datastore2_id'); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | public function page() |
@@ -29,15 +29,15 @@ |
||
29 | 29 | } |
30 | 30 | |
31 | 31 | |
32 | - public function datastore(){ |
|
32 | + public function datastore() { |
|
33 | 33 | return $this->belongsTo(DatastoreModel::class, 'datastore_id'); |
34 | 34 | } |
35 | 35 | |
36 | - public function getItemAttribute(){ |
|
36 | + public function getItemAttribute() { |
|
37 | 37 | return $this->datastore->datastore; |
38 | 38 | } |
39 | 39 | |
40 | - public function prop($key){ |
|
40 | + public function prop($key) { |
|
41 | 41 | return $this->item->prop($key); |
42 | 42 | } |
43 | 43 |
@@ -19,7 +19,7 @@ |
||
19 | 19 | 'asset' |
20 | 20 | ]; |
21 | 21 | |
22 | - public function getDatastoreAttribute(){ |
|
22 | + public function getDatastoreAttribute() { |
|
23 | 23 | return $this->id ? Datastore::getAssetById($this->asset) : null; |
24 | 24 | } |
25 | 25 |
@@ -11,37 +11,37 @@ |
||
11 | 11 | { |
12 | 12 | |
13 | 13 | /** |
14 | - * @return string |
|
15 | - */ |
|
16 | - public function getEditButtonAttribute() |
|
17 | - { |
|
18 | - return '<a href="'.route('admin.ams.content.update', ['asset' => $this->content_path, 'id' => $this->id]).'" data-toggle="tooltip" data-placement="top" title="'.__('buttons.general.crud.edit').'" class="btn btn-primary"><i class="fas fa-edit"></i></a>'; |
|
14 | + * @return string |
|
15 | + */ |
|
16 | + public function getEditButtonAttribute() |
|
17 | + { |
|
18 | + return '<a href="'.route('admin.ams.content.update', ['asset' => $this->content_path, 'id' => $this->id]).'" data-toggle="tooltip" data-placement="top" title="'.__('buttons.general.crud.edit').'" class="btn btn-primary"><i class="fas fa-edit"></i></a>'; |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | /** |
22 | - * @return string |
|
23 | - */ |
|
24 | - public function getDeleteButtonAttribute() |
|
25 | - { |
|
22 | + * @return string |
|
23 | + */ |
|
24 | + public function getDeleteButtonAttribute() |
|
25 | + { |
|
26 | 26 | |
27 | - return '<a href="'.route('admin.ams.content.destroy', $this).'" |
|
27 | + return '<a href="'.route('admin.ams.content.destroy', $this).'" |
|
28 | 28 | data-method="delete" |
29 | 29 | data-trans-button-cancel="'.__('buttons.general.cancel').'" |
30 | 30 | data-trans-button-confirm="'.__('buttons.general.crud.delete').'" |
31 | 31 | data-trans-title="'.__('strings.backend.general.are_you_sure').'" |
32 | 32 | class="btn btn-danger"><i class="fas fa-trash" data-toggle="tooltip" data-placement="top" title="'.__('buttons.general.crud.delete').'"></i></a> '; |
33 | 33 | |
34 | - } |
|
34 | + } |
|
35 | 35 | |
36 | - /** |
|
37 | - * @return string |
|
38 | - */ |
|
39 | - public function getActionButtonsAttribute() |
|
40 | - { |
|
36 | + /** |
|
37 | + * @return string |
|
38 | + */ |
|
39 | + public function getActionButtonsAttribute() |
|
40 | + { |
|
41 | 41 | |
42 | 42 | if($this->id) |
43 | 43 | { |
44 | - return '<div class="btn-group" role="group" aria-label="'.__('labels.backend.access.users.user_actions').'"> |
|
44 | + return '<div class="btn-group" role="group" aria-label="'.__('labels.backend.access.users.user_actions').'"> |
|
45 | 45 | '.$this->edit_button.' |
46 | 46 | '.$this->delete_button.' |
47 | 47 | </div>'; |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | */ |
16 | 16 | public function getEditButtonAttribute() |
17 | 17 | { |
18 | - return '<a href="'.route('admin.ams.content.update', ['asset' => $this->content_path, 'id' => $this->id]).'" data-toggle="tooltip" data-placement="top" title="'.__('buttons.general.crud.edit').'" class="btn btn-primary"><i class="fas fa-edit"></i></a>'; |
|
18 | + return '<a href="' . route('admin.ams.content.update', ['asset' => $this->content_path, 'id' => $this->id]) . '" data-toggle="tooltip" data-placement="top" title="' . __('buttons.general.crud.edit') . '" class="btn btn-primary"><i class="fas fa-edit"></i></a>'; |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | /** |
@@ -24,12 +24,12 @@ discard block |
||
24 | 24 | public function getDeleteButtonAttribute() |
25 | 25 | { |
26 | 26 | |
27 | - return '<a href="'.route('admin.ams.content.destroy', $this).'" |
|
27 | + return '<a href="' . route('admin.ams.content.destroy', $this) . '" |
|
28 | 28 | data-method="delete" |
29 | - data-trans-button-cancel="'.__('buttons.general.cancel').'" |
|
30 | - data-trans-button-confirm="'.__('buttons.general.crud.delete').'" |
|
31 | - data-trans-title="'.__('strings.backend.general.are_you_sure').'" |
|
32 | - class="btn btn-danger"><i class="fas fa-trash" data-toggle="tooltip" data-placement="top" title="'.__('buttons.general.crud.delete').'"></i></a> '; |
|
29 | + data-trans-button-cancel="'.__('buttons.general.cancel') . '" |
|
30 | + data-trans-button-confirm="'.__('buttons.general.crud.delete') . '" |
|
31 | + data-trans-title="'.__('strings.backend.general.are_you_sure') . '" |
|
32 | + class="btn btn-danger"><i class="fas fa-trash" data-toggle="tooltip" data-placement="top" title="'.__('buttons.general.crud.delete') . '"></i></a> '; |
|
33 | 33 | |
34 | 34 | } |
35 | 35 | |
@@ -39,16 +39,16 @@ discard block |
||
39 | 39 | public function getActionButtonsAttribute() |
40 | 40 | { |
41 | 41 | |
42 | - if($this->id) |
|
42 | + if ($this->id) |
|
43 | 43 | { |
44 | - return '<div class="btn-group" role="group" aria-label="'.__('labels.backend.access.users.user_actions').'"> |
|
45 | - '.$this->edit_button.' |
|
46 | - '.$this->delete_button.' |
|
44 | + return '<div class="btn-group" role="group" aria-label="' . __('labels.backend.access.users.user_actions') . '"> |
|
45 | + '.$this->edit_button . ' |
|
46 | + '.$this->delete_button . ' |
|
47 | 47 | </div>'; |
48 | 48 | } |
49 | 49 | } |
50 | 50 | |
51 | - public function getContentPathAttribute(){ |
|
51 | + public function getContentPathAttribute() { |
|
52 | 52 | return Helpers::getPath($this->type); |
53 | 53 | } |
54 | 54 | |
@@ -59,20 +59,20 @@ discard block |
||
59 | 59 | |
60 | 60 | }*/ |
61 | 61 | |
62 | - public function getDatastoreAttribute(){ |
|
63 | - if($this->id){ |
|
62 | + public function getDatastoreAttribute() { |
|
63 | + if ($this->id) { |
|
64 | 64 | return DatastoreFactory::getAsset($this->type, $this->id); |
65 | 65 | } |
66 | - if($this->type){ |
|
66 | + if ($this->type) { |
|
67 | 67 | return DatastoreFactory::dispence($this->type); |
68 | 68 | } |
69 | 69 | } |
70 | 70 | |
71 | - public function getRouteAttribute(){ |
|
71 | + public function getRouteAttribute() { |
|
72 | 72 | return $this->type ? Helpers::callStatic($this->type, 'route', [$this]) : null; |
73 | 73 | } |
74 | 74 | |
75 | - public function routeChild($parentSlug){ |
|
75 | + public function routeChild($parentSlug) { |
|
76 | 76 | return $this->type ? Helpers::callStatic($this->type, 'route', [$this, $parentSlug]) : null; |
77 | 77 | |
78 | 78 | } |