@@ -9,8 +9,8 @@ discard block |
||
9 | 9 | $colsItem = self::extractLines($code, $type); |
10 | 10 | |
11 | 11 | foreach ($colsItem as &$item) { |
12 | - $item = str_replace(' ','', $item); |
|
13 | - $item = str_replace('\',]',']', $item); |
|
12 | + $item = str_replace(' ', '', $item); |
|
13 | + $item = str_replace('\',]', ']', $item); |
|
14 | 14 | $item = trim($item); |
15 | 15 | $item = trim($item, '['); |
16 | 16 | $item = trim($item, '];'); |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | $val = trim(str_replace("'options'=>", "", $s)); |
43 | 43 | } elseif (strpos($s, 'callback')) { |
44 | 44 | $key = 'callback'; |
45 | - $s = str_replace("return","return ",$s); |
|
45 | + $s = str_replace("return", "return ", $s); |
|
46 | 46 | $val = trim(str_replace(["'callback'=>function(\$row) {", "'callback'=>function(\$row){"], "", $s)); |
47 | 47 | $val = substr($val, 0, -1); //to remove last } |
48 | 48 | } else { |
@@ -8,28 +8,28 @@ discard block |
||
8 | 8 | | --------------------------------------------------------------------------------------------------------------- |
9 | 9 | | |
10 | 10 | */ |
11 | -if (! function_exists('cbModulesNS')) { |
|
11 | +if (!function_exists('cbModulesNS')) { |
|
12 | 12 | function cbModulesNS($path = '') |
13 | 13 | { |
14 | 14 | return '\crocodicstudio\crudbooster\Modules\\'.$path; |
15 | 15 | } |
16 | 16 | } |
17 | 17 | |
18 | -if (! function_exists('cbAdminPath')) { |
|
18 | +if (!function_exists('cbAdminPath')) { |
|
19 | 19 | function cbAdminPath() |
20 | 20 | { |
21 | 21 | return cbConfig('ADMIN_PATH'); |
22 | 22 | } |
23 | 23 | } |
24 | 24 | |
25 | -if (! function_exists('ctrlNamespace')) { |
|
25 | +if (!function_exists('ctrlNamespace')) { |
|
26 | 26 | function ctrlNamespace() |
27 | 27 | { |
28 | 28 | return 'App\Http\Controllers'; |
29 | 29 | } |
30 | 30 | } |
31 | 31 | |
32 | -if (! function_exists('is_checked')) { |
|
32 | +if (!function_exists('is_checked')) { |
|
33 | 33 | /** |
34 | 34 | * @param $format |
35 | 35 | * @param $value |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | } |
54 | 54 | } |
55 | 55 | |
56 | -if (! function_exists('controllers_dir')) { |
|
56 | +if (!function_exists('controllers_dir')) { |
|
57 | 57 | function controllers_dir() |
58 | 58 | { |
59 | 59 | $_ = DIRECTORY_SEPARATOR; |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | } |
62 | 62 | } |
63 | 63 | |
64 | -if (! function_exists('controller_path')) { |
|
64 | +if (!function_exists('controller_path')) { |
|
65 | 65 | function controller_path($controller) |
66 | 66 | { |
67 | 67 | $_ = DIRECTORY_SEPARATOR; |
@@ -69,10 +69,10 @@ discard block |
||
69 | 69 | } |
70 | 70 | } |
71 | 71 | |
72 | -if (! function_exists('rrmdir')) { |
|
72 | +if (!function_exists('rrmdir')) { |
|
73 | 73 | function rrmdir($dir) |
74 | 74 | { |
75 | - if (! is_dir($dir)) { |
|
75 | + if (!is_dir($dir)) { |
|
76 | 76 | return; |
77 | 77 | } |
78 | 78 | $objects = scandir($dir); |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | } |
94 | 94 | } |
95 | 95 | |
96 | -if (! function_exists('extract_unit')) { |
|
96 | +if (!function_exists('extract_unit')) { |
|
97 | 97 | /* |
98 | 98 | Credits: Bit Repository |
99 | 99 | URL: http://www.bitrepository.com/extract-content-between-two-delimiters-with-php.html |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | } |
112 | 112 | } |
113 | 113 | |
114 | -if (! function_exists('now')) { |
|
114 | +if (!function_exists('now')) { |
|
115 | 115 | function now() |
116 | 116 | { |
117 | 117 | return date('Y-m-d H:i:s'); |
@@ -125,17 +125,17 @@ discard block |
||
125 | 125 | | $name = name of input |
126 | 126 | | |
127 | 127 | */ |
128 | -if (! function_exists('g')) { |
|
128 | +if (!function_exists('g')) { |
|
129 | 129 | function g($name) |
130 | 130 | { |
131 | 131 | return Request::get($name); |
132 | 132 | } |
133 | 133 | } |
134 | 134 | |
135 | -if (! function_exists('min_var_export')) { |
|
135 | +if (!function_exists('min_var_export')) { |
|
136 | 136 | function min_var_export($input, $indent = "") |
137 | 137 | { |
138 | - if (! is_array($input)) { |
|
138 | + if (!is_array($input)) { |
|
139 | 139 | return var_export($input, true); |
140 | 140 | } |
141 | 141 | $buffer = []; |
@@ -150,13 +150,13 @@ discard block |
||
150 | 150 | } |
151 | 151 | } |
152 | 152 | |
153 | -if (! function_exists('rrmdir')) { |
|
153 | +if (!function_exists('rrmdir')) { |
|
154 | 154 | /* |
155 | 155 | * http://stackoverflow.com/questions/3338123/how-do-i-recursively-delete-a-directory-and-its-entire-contents-files-sub-dir |
156 | 156 | */ |
157 | 157 | function rrmdir($dir) |
158 | 158 | { |
159 | - if (! is_dir($dir)) { |
|
159 | + if (!is_dir($dir)) { |
|
160 | 160 | return; |
161 | 161 | } |
162 | 162 | foreach (scandir($dir) as $object) { |
@@ -173,41 +173,41 @@ discard block |
||
173 | 173 | } |
174 | 174 | } |
175 | 175 | |
176 | -if (! function_exists('cbTrans')) { |
|
176 | +if (!function_exists('cbTrans')) { |
|
177 | 177 | function cbTrans($key, $params = []) |
178 | 178 | { |
179 | 179 | return trans('crudbooster.'.$key, $params); |
180 | 180 | } |
181 | 181 | } |
182 | 182 | |
183 | -if (! function_exists('cbAsset')) { |
|
183 | +if (!function_exists('cbAsset')) { |
|
184 | 184 | function cbAsset($key) |
185 | 185 | { |
186 | 186 | return asset('vendor/crudbooster/assets/'.$key); |
187 | 187 | } |
188 | 188 | } |
189 | 189 | |
190 | -if (! function_exists('cbScript')) { |
|
190 | +if (!function_exists('cbScript')) { |
|
191 | 191 | function cbScript($key) |
192 | 192 | { |
193 | 193 | return '<script src="'.cbAsset($key).'" type="text/javascript"></script>'; |
194 | 194 | } |
195 | 195 | } |
196 | 196 | |
197 | -if (! function_exists('cbStyleSheet')) { |
|
197 | +if (!function_exists('cbStyleSheet')) { |
|
198 | 198 | function cbStyleSheet($key) |
199 | 199 | { |
200 | 200 | return '<link rel="stylesheet" type="text/css" href="'.cbAsset($key).'"/>'; |
201 | 201 | } |
202 | 202 | } |
203 | 203 | |
204 | -if (! function_exists('cbConfig')) { |
|
204 | +if (!function_exists('cbConfig')) { |
|
205 | 205 | function cbConfig($key, $default = null) |
206 | 206 | { |
207 | 207 | return config('crudbooster.'.$key, $default); |
208 | 208 | } |
209 | 209 | } |
210 | -if (! function_exists('makeValidationForHTML')) { |
|
210 | +if (!function_exists('makeValidationForHTML')) { |
|
211 | 211 | function makeValidationForHTML($rules) |
212 | 212 | { |
213 | 213 | $validation = []; |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | } |
226 | 226 | } |
227 | 227 | |
228 | -if (! function_exists('findSelected')) { |
|
228 | +if (!function_exists('findSelected')) { |
|
229 | 229 | /** |
230 | 230 | * @param $rawvalue |
231 | 231 | * @param $form |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | */ |
235 | 235 | function findSelected($rawvalue, $form, $optionValue) |
236 | 236 | { |
237 | - if (! $rawvalue) { |
|
237 | + if (!$rawvalue) { |
|
238 | 238 | return ''; |
239 | 239 | } |
240 | 240 | $value = $rawvalue; |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | return $selected; |
257 | 257 | } |
258 | 258 | } |
259 | -if (! function_exists('array_get_keys')) { |
|
259 | +if (!function_exists('array_get_keys')) { |
|
260 | 260 | |
261 | 261 | /** |
262 | 262 | * @param array $_array |
@@ -272,14 +272,14 @@ discard block |
||
272 | 272 | } |
273 | 273 | } |
274 | 274 | |
275 | -if (! function_exists('cbGetSetting')) { |
|
275 | +if (!function_exists('cbGetSetting')) { |
|
276 | 276 | function cbGetSetting($name) |
277 | 277 | { |
278 | 278 | return \crocodicstudio\crudbooster\Modules\SettingModule\SettingRepo::getSetting($name); |
279 | 279 | } |
280 | 280 | } |
281 | 281 | |
282 | -if (! function_exists('backWithMsg')) { |
|
282 | +if (!function_exists('backWithMsg')) { |
|
283 | 283 | function backWithMsg($msg, $type = 'success') |
284 | 284 | { |
285 | 285 | sendAndTerminate(redirect()->back()->with(['message_type' => $type, 'message' => $msg])); |
@@ -65,7 +65,7 @@ |
||
65 | 65 | |
66 | 66 | private static function getModulePath() |
67 | 67 | { |
68 | - $adminPathSegments = count(explode('/',config('crudbooster.ADMIN_PATH'))); |
|
68 | + $adminPathSegments = count(explode('/', config('crudbooster.ADMIN_PATH'))); |
|
69 | 69 | return Request::segment(1 + $adminPathSegments); |
70 | 70 | } |
71 | 71 | } |
72 | 72 | \ No newline at end of file |
@@ -44,11 +44,11 @@ discard block |
||
44 | 44 | |
45 | 45 | //Create vendor folder at public |
46 | 46 | $this->info('Checking public/vendor directory...'); |
47 | - if (! file_exists(public_path('vendor'))) { |
|
47 | + if (!file_exists(public_path('vendor'))) { |
|
48 | 48 | $this->info('Creating public/vendor directory...'); |
49 | 49 | mkdir(public_path('vendor'), 0777); |
50 | 50 | } else { |
51 | - if (! is_writable(public_path('vendor'))) { |
|
51 | + if (!is_writable(public_path('vendor'))) { |
|
52 | 52 | $this->info('Setup aborted !'); |
53 | 53 | $this->info('Please set public/vendor directory to writable 0777'); |
54 | 54 | |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | $this->info('Migrating database...'); |
104 | 104 | $this->call('migrate'); |
105 | 105 | |
106 | - if (! class_exists('CBSeeder')) { |
|
106 | + if (!class_exists('CBSeeder')) { |
|
107 | 107 | require_once __DIR__.'/../database/seeds/CBSeeder.php'; |
108 | 108 | } |
109 | 109 | $this->callSilent('db:seed', ['--class' => 'CBSeeder']); |
@@ -53,18 +53,18 @@ |
||
53 | 53 | $this->symlinkForAsset(); |
54 | 54 | |
55 | 55 | |
56 | - if($this->confirm('Do you have setting the database configuration at .env ?')) { |
|
56 | + if($this->confirm('Do you have setting the database configuration at .env ?')) { |
|
57 | 57 | $this->installCrudbooster(); |
58 | - }else{ |
|
59 | - $this->info('Setup Aborted !'); |
|
60 | - $this->info('Please setting the database configuration for first !'); |
|
61 | - } |
|
58 | + }else{ |
|
59 | + $this->info('Setup Aborted !'); |
|
60 | + $this->info('Please setting the database configuration for first !'); |
|
61 | + } |
|
62 | 62 | |
63 | - $this->printFooter(); |
|
64 | - } |
|
63 | + $this->printFooter(); |
|
64 | + } |
|
65 | 65 | |
66 | - private function printHeader() { |
|
67 | - $this->info(" |
|
66 | + private function printHeader() { |
|
67 | + $this->info(" |
|
68 | 68 | |
69 | 69 | # __________ __ ______ ____ __ |
70 | 70 | # / ____/ __ \/ / / / __ \/ __ )____ ____ _____/ /____ _____ |
@@ -53,9 +53,9 @@ discard block |
||
53 | 53 | $this->symlinkForAsset(); |
54 | 54 | |
55 | 55 | |
56 | - if($this->confirm('Do you have setting the database configuration at .env ?')) { |
|
56 | + if ($this->confirm('Do you have setting the database configuration at .env ?')) { |
|
57 | 57 | $this->installCrudbooster(); |
58 | - }else{ |
|
58 | + } else { |
|
59 | 59 | $this->info('Setup Aborted !'); |
60 | 60 | $this->info('Please setting the database configuration for first !'); |
61 | 61 | } |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | if (!file_exists(public_path('vendor'.DIRECTORY_SEPARATOR.'crudbooster'))) { |
213 | 213 | $this->info('Creating public/vendor/crudbooster symlink...'); |
214 | 214 | app('files')->link(__DIR__.'/../assets', public_path('vendor/crudbooster')); |
215 | - return ; |
|
215 | + return; |
|
216 | 216 | } |
217 | 217 | $vendorpath = public_path('vendor'.DIRECTORY_SEPARATOR.'crudbooster'); |
218 | 218 | |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | $this->info('Migrating database...'); |
252 | 252 | $this->call('migrate', ['--path'=> '\database\migrations\crudbooster']); |
253 | 253 | |
254 | - if (! class_exists('CBSeeder')) { |
|
254 | + if (!class_exists('CBSeeder')) { |
|
255 | 255 | require_once __DIR__.'/../database/seeds/CBSeeder.php'; |
256 | 256 | } |
257 | 257 | $this->callSilent('db:seed', ['--class' => 'CBSeeder']); |
@@ -264,11 +264,11 @@ discard block |
||
264 | 264 | private function createVendorAtPublic() |
265 | 265 | { |
266 | 266 | $this->info('Checking public/vendor directory...'); |
267 | - if (! file_exists(public_path('vendor'))) { |
|
267 | + if (!file_exists(public_path('vendor'))) { |
|
268 | 268 | mkdir(public_path('vendor'), 0777); |
269 | 269 | } |
270 | 270 | |
271 | - if (! is_writable(public_path('vendor'))) { |
|
271 | + if (!is_writable(public_path('vendor'))) { |
|
272 | 272 | $this->info('Setup aborted !'); |
273 | 273 | $this->info('Please set public/vendor directory to writable 0777'); |
274 | 274 |
@@ -55,7 +55,7 @@ |
||
55 | 55 | |
56 | 56 | if($this->confirm('Do you have setting the database configuration at .env ?')) { |
57 | 57 | $this->installCrudbooster(); |
58 | - }else{ |
|
58 | + } else{ |
|
59 | 59 | $this->info('Setup Aborted !'); |
60 | 60 | $this->info('Please setting the database configuration for first !'); |
61 | 61 | } |
@@ -233,5 +233,5 @@ |
||
233 | 233 | 'please_complete_the_form' =>'Please complete the form !', |
234 | 234 | 'this_field_is_required' =>'This field is required', |
235 | 235 | 'text_form' => 'Form', |
236 | - "your_file_extension_is_not_allowed "=>"Your file extension is not allowed !", |
|
236 | + "your_file_extension_is_not_allowed "=>"Your file extension is not allowed !", |
|
237 | 237 | ]; |
@@ -202,8 +202,8 @@ |
||
202 | 202 | 'datamodal_select'=>'Select', |
203 | 203 | 'datamodal_search_and_enter'=>'Search and enter...', |
204 | 204 | 'datamodal_enter_to_search'=>'Enter to search', |
205 | - 'datamodal_browse_data'=>'Browse Data' , |
|
206 | - 'datamodal_browse_file'=>'Browse File' , |
|
205 | + 'datamodal_browse_data'=>'Browse Data', |
|
206 | + 'datamodal_browse_file'=>'Browse File', |
|
207 | 207 | |
208 | 208 | |
209 | 209 | //child |
@@ -233,5 +233,5 @@ |
||
233 | 233 | 'please_complete_the_form' =>'Please complete the form !', |
234 | 234 | 'this_field_is_required' =>'This field is required', |
235 | 235 | 'text_form' => 'Form', |
236 | - "your_file_extension_is_not_allowed "=>"Your file extension is not allowed !", |
|
236 | + "your_file_extension_is_not_allowed "=>"Your file extension is not allowed !", |
|
237 | 237 | ]; |
@@ -202,8 +202,8 @@ |
||
202 | 202 | 'datamodal_select'=>'Select', |
203 | 203 | 'datamodal_search_and_enter'=>'Search and enter...', |
204 | 204 | 'datamodal_enter_to_search'=>'Enter to search', |
205 | - 'datamodal_browse_data'=>'Browse Data' , |
|
206 | - 'datamodal_browse_file'=>'Browse File' , |
|
205 | + 'datamodal_browse_data'=>'Browse Data', |
|
206 | + 'datamodal_browse_file'=>'Browse File', |
|
207 | 207 | |
208 | 208 | |
209 | 209 | //child |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | $datatableWhere = urldecode(request('datatable_where')); |
12 | 12 | $foreign_key_name = request('fk_name'); |
13 | 13 | $foreign_key_value = request('fk_value'); |
14 | - if (! $table || ! $label || ! $foreign_key_name || ! $foreign_key_value) { |
|
14 | + if (!$table || !$label || !$foreign_key_name || !$foreign_key_value) { |
|
15 | 15 | return response()->json([]); |
16 | 16 | } |
17 | 17 | $query = DB::table($table); |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | |
34 | 34 | $result = DB::table($data['table']); |
35 | 35 | if (request('q')) { |
36 | - $result->where(function ($where) use ($columns) { |
|
36 | + $result->where(function($where) use ($columns) { |
|
37 | 37 | foreach ($columns as $c => $col) { |
38 | 38 | if ($c == 0) { |
39 | 39 | $where->where($col, 'like', '%'.request('q').'%'); |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | public function getDataQuery() |
62 | 62 | { |
63 | 63 | $key = request('query'); |
64 | - if (! Cache::has($key)) { |
|
64 | + if (!Cache::has($key)) { |
|
65 | 65 | return response()->json(['items' => []]); |
66 | 66 | } |
67 | 67 | $query = Cache::get($key); |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | |
85 | 85 | private function checkHideForm() |
86 | 86 | { |
87 | - if (! count($this->hide_form)) { |
|
87 | + if (!count($this->hide_form)) { |
|
88 | 88 | return null; |
89 | 89 | } |
90 | 90 | foreach ($this->form as $i => $f) { |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | $type = $ro['type'] ?: 'text'; |
153 | 153 | $inputdata = request($name); |
154 | 154 | |
155 | - if (! $name || $ro['exception']) { |
|
155 | + if (!$name || $ro['exception']) { |
|
156 | 156 | continue; |
157 | 157 | } |
158 | 158 |