We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -69,7 +69,7 @@ |
||
69 | 69 | * |
70 | 70 | * @param array $columns - the database columns that contain the JSONs |
71 | 71 | * |
72 | - * @return Model |
|
72 | + * @return CrudTrait |
|
73 | 73 | */ |
74 | 74 | public function withFakes($columns = []) |
75 | 75 | { |
@@ -1,10 +1,10 @@ |
||
1 | 1 | {{-- checkbox with loose false/null/0 checking --}} |
2 | 2 | <?php |
3 | - $icon = "fa-check-square-o"; |
|
4 | - if (strip_tags($entry->{$column['name']}) == false) |
|
5 | - { |
|
6 | - $icon = "fa-square-o"; |
|
7 | - } |
|
3 | + $icon = "fa-check-square-o"; |
|
4 | + if (strip_tags($entry->{$column['name']}) == false) |
|
5 | + { |
|
6 | + $icon = "fa-square-o"; |
|
7 | + } |
|
8 | 8 | ?> |
9 | 9 | |
10 | 10 | <td> |
@@ -1,6 +1,6 @@ |
||
1 | 1 | {{-- custom return value via attribute --}} |
2 | 2 | <td> |
3 | 3 | <?php |
4 | - echo $entry->{$column['function_name']}()->{$column['attribute']}; |
|
4 | + echo $entry->{$column['function_name']}()->{$column['attribute']}; |
|
5 | 5 | ?> |
6 | 6 | </td> |
7 | 7 | \ No newline at end of file |
@@ -1,6 +1,6 @@ |
||
1 | 1 | {{-- custom return value --}} |
2 | 2 | <td> |
3 | 3 | <?php |
4 | - echo $entry->{$column['function_name']}(); |
|
4 | + echo $entry->{$column['function_name']}(); |
|
5 | 5 | ?> |
6 | 6 | </td> |
7 | 7 | \ No newline at end of file |
@@ -95,6 +95,12 @@ |
||
95 | 95 | public $type = 'view'; |
96 | 96 | public $content; |
97 | 97 | |
98 | + /** |
|
99 | + * @param string $stack |
|
100 | + * @param string $name |
|
101 | + * @param string $type |
|
102 | + * @param string $content |
|
103 | + */ |
|
98 | 104 | public function __construct($stack, $name, $type, $content) |
99 | 105 | { |
100 | 106 | $this->stack = $stack; |
@@ -20,42 +20,42 @@ discard block |
||
20 | 20 | |
21 | 21 | @section('content') |
22 | 22 | <?php |
23 | - function tree_element($entry, $key, $all_entries, $crud) |
|
24 | - { |
|
23 | + function tree_element($entry, $key, $all_entries, $crud) |
|
24 | + { |
|
25 | 25 | if (!isset($entry->tree_element_shown)) { |
26 | - // mark the element as shown |
|
27 | - $all_entries[$key]->tree_element_shown = true; |
|
28 | - $entry->tree_element_shown = true; |
|
26 | + // mark the element as shown |
|
27 | + $all_entries[$key]->tree_element_shown = true; |
|
28 | + $entry->tree_element_shown = true; |
|
29 | 29 | |
30 | - // show the tree element |
|
31 | - echo '<li id="list_'.$entry->getKey().'">'; |
|
32 | - echo '<div><span class="disclose"><span></span></span>'.$entry->{$crud->reorder_label}.'</div>'; |
|
30 | + // show the tree element |
|
31 | + echo '<li id="list_'.$entry->getKey().'">'; |
|
32 | + echo '<div><span class="disclose"><span></span></span>'.$entry->{$crud->reorder_label}.'</div>'; |
|
33 | 33 | |
34 | - // see if this element has any children |
|
35 | - $children = []; |
|
36 | - foreach ($all_entries as $key => $subentry) { |
|
34 | + // see if this element has any children |
|
35 | + $children = []; |
|
36 | + foreach ($all_entries as $key => $subentry) { |
|
37 | 37 | if ($subentry->parent_id == $entry->getKey()) { |
38 | - $children[] = $subentry; |
|
38 | + $children[] = $subentry; |
|
39 | + } |
|
39 | 40 | } |
40 | - } |
|
41 | 41 | |
42 | - $children = collect($children)->sortBy('lft'); |
|
42 | + $children = collect($children)->sortBy('lft'); |
|
43 | 43 | |
44 | - // if it does have children, show them |
|
45 | - if (count($children)) { |
|
44 | + // if it does have children, show them |
|
45 | + if (count($children)) { |
|
46 | 46 | echo '<ol>'; |
47 | 47 | foreach ($children as $key => $child) { |
48 | - $children[$key] = tree_element($child, $child->getKey(), $all_entries, $crud); |
|
48 | + $children[$key] = tree_element($child, $child->getKey(), $all_entries, $crud); |
|
49 | 49 | } |
50 | 50 | echo '</ol>'; |
51 | - } |
|
52 | - echo '</li>'; |
|
51 | + } |
|
52 | + echo '</li>'; |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | return $entry; |
56 | - } |
|
56 | + } |
|
57 | 57 | |
58 | - ?> |
|
58 | + ?> |
|
59 | 59 | <div class="row"> |
60 | 60 | <div class="col-md-8 col-md-offset-2"> |
61 | 61 | @if ($crud->hasAccess('list')) |
@@ -73,15 +73,15 @@ discard block |
||
73 | 73 | |
74 | 74 | <ol class="sortable"> |
75 | 75 | <?php |
76 | - $all_entries = collect($entries->all())->sortBy('lft')->keyBy($crud->getModel()->getKeyName()); |
|
77 | - $root_entries = $all_entries->filter(function($item) { |
|
76 | + $all_entries = collect($entries->all())->sortBy('lft')->keyBy($crud->getModel()->getKeyName()); |
|
77 | + $root_entries = $all_entries->filter(function($item) { |
|
78 | 78 | return $item->parent_id == 0; |
79 | - }); |
|
80 | - ?> |
|
79 | + }); |
|
80 | + ?> |
|
81 | 81 | @foreach ($root_entries as $key => $entry) |
82 | 82 | <?php |
83 | 83 | $root_entries[$key] = tree_element($entry, $key, $all_entries, $crud); |
84 | - ?> |
|
84 | + ?> |
|
85 | 85 | @endforeach |
86 | 86 | </ol> |
87 | 87 |
@@ -89,33 +89,33 @@ |
||
89 | 89 | Route::post($name.'/search', [ |
90 | 90 | 'as' => 'crud.'.$name.'.search', |
91 | 91 | 'uses' => $controller.'@search', |
92 | - ]); |
|
92 | + ]); |
|
93 | 93 | Route::get($name.'/reorder', [ |
94 | 94 | 'as' => 'crud.'.$name.'.reorder', |
95 | 95 | 'uses' => $controller.'@reorder', |
96 | - ]); |
|
96 | + ]); |
|
97 | 97 | Route::post($name.'/reorder', [ |
98 | 98 | 'as' => 'crud.'.$name.'.save.reorder', |
99 | 99 | 'uses' => $controller.'@saveReorder', |
100 | - ]); |
|
100 | + ]); |
|
101 | 101 | Route::get($name.'/{id}/details', [ |
102 | 102 | 'as' => 'crud.'.$name.'.showDetailsRow', |
103 | 103 | 'uses' => $controller.'@showDetailsRow', |
104 | - ]); |
|
104 | + ]); |
|
105 | 105 | Route::get($name.'/{id}/translate/{lang}', [ |
106 | 106 | 'as' => 'crud.'.$name.'.translateItem', |
107 | 107 | 'uses' => $controller.'@translateItem', |
108 | - ]); |
|
108 | + ]); |
|
109 | 109 | |
110 | 110 | Route::get($name.'/{id}/revisions', [ |
111 | 111 | 'as' => 'crud.'.$name.'.listRevisions', |
112 | 112 | 'uses' => $controller.'@listRevisions', |
113 | - ]); |
|
113 | + ]); |
|
114 | 114 | |
115 | 115 | Route::post($name.'/{id}/revisions/{revisionId}/restore', [ |
116 | 116 | 'as' => 'crud.'.$name.'.restoreRevision', |
117 | 117 | 'uses' => $controller.'@restoreRevision', |
118 | - ]); |
|
118 | + ]); |
|
119 | 119 | |
120 | 120 | $options_with_default_route_names = array_merge([ |
121 | 121 | 'names' => [ |
@@ -1,11 +1,11 @@ |
||
1 | 1 | {{-- enumerate the values in an array --}} |
2 | 2 | <td> |
3 | 3 | <?php |
4 | - $value = $entry->{$column['name']}; |
|
5 | - // the value should be an array wether or not attribute casting is used |
|
6 | - if (!is_array($value)) { |
|
7 | - $value = json_decode($value, true); |
|
8 | - } |
|
4 | + $value = $entry->{$column['name']}; |
|
5 | + // the value should be an array wether or not attribute casting is used |
|
6 | + if (!is_array($value)) { |
|
7 | + $value = json_decode($value, true); |
|
8 | + } |
|
9 | 9 | if ($value && count($value)) { |
10 | 10 | echo implode(', ', $value); |
11 | 11 | } else { |
@@ -33,6 +33,7 @@ |
||
33 | 33 | * Get all fields needed for the EDIT ENTRY form. |
34 | 34 | * |
35 | 35 | * @param [integer] The id of the entry that is being edited. |
36 | + * @param integer $id |
|
36 | 37 | * |
37 | 38 | * @return [array] The fields with attributes, fake attributes and values. |
38 | 39 | */ |