@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | /** @var Nayjest\Grids\Components\Filters\DateRangePicker $component */ |
3 | 3 | $id = uniqid(); |
4 | 4 | ?> |
5 | -<?php if($component->getLabel()): ?> |
|
5 | +<?php if ($component->getLabel()): ?> |
|
6 | 6 | <span> |
7 | 7 | <span class="glyphicon glyphicon-calendar"></span> |
8 | 8 | <?= $component->getLabel() ?> |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | start.val(picker.startDate.format(options.format)); |
37 | 37 | var end = $('[name="<?= $component->getEndInputName() ?>"]'); |
38 | 38 | end.val(picker.endDate.format(options.format)); |
39 | - <?php if($component->isSubmittedOnChange()): ?> |
|
39 | + <?php if ($component->isSubmittedOnChange()): ?> |
|
40 | 40 | end.get(0).form.submit(); |
41 | 41 | <?php endif ?> |
42 | 42 | }; |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | $('[name="<?= $component->getStartInputName() ?>"]').val(''); |
49 | 49 | $('[name="<?= $component->getEndInputName() ?>"]').val(''); |
50 | 50 | |
51 | - <?php if($component->isSubmittedOnChange()): ?> |
|
51 | + <?php if ($component->isSubmittedOnChange()): ?> |
|
52 | 52 | var end = $('[name="<?= $component->getEndInputName() ?>"]'); |
53 | 53 | end.get(0).form.submit(); |
54 | 54 | <?php endif ?> |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | /** @var Nayjest\Grids\Components\SelectFilter $component */ |
3 | 3 | $value = $component->getValue(); |
4 | 4 | if (!is_array($value)) $value = []; |
5 | -$id = uniqid() . mt_rand(); |
|
5 | +$id = uniqid().mt_rand(); |
|
6 | 6 | ?> |
7 | 7 | <div class="btn-group"> |
8 | 8 | <button type="button" class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown"> |
@@ -25,11 +25,11 @@ discard block |
||
25 | 25 | </label> |
26 | 26 | </div> |
27 | 27 | </li> |
28 | - <?php foreach($component->getVariants() as $val => $label): ?> |
|
29 | - <?php if(is_array($label)):?> |
|
28 | + <?php foreach ($component->getVariants() as $val => $label): ?> |
|
29 | + <?php if (is_array($label)):?> |
|
30 | 30 | <?php |
31 | 31 | $class = ''; |
32 | - if(array_intersect(array_keys($label['values']), array_keys($value))) { |
|
32 | + if (array_intersect(array_keys($label['values']), array_keys($value))) { |
|
33 | 33 | $class = ' in'; |
34 | 34 | } |
35 | 35 | ?> |
@@ -51,12 +51,12 @@ discard block |
||
51 | 51 | </label> |
52 | 52 | </div> |
53 | 53 | <?php endif ?> |
54 | - <?php foreach($label['values'] as $option_val=>$option_label):?> |
|
54 | + <?php foreach ($label['values'] as $option_val=>$option_label):?> |
|
55 | 55 | <div> |
56 | 56 | <label> |
57 | 57 | <input |
58 | 58 | type="checkbox" |
59 | - <?php if(!empty($value[$option_val])) echo "checked='checked'" ?> |
|
59 | + <?php if (!empty($value[$option_val])) echo "checked='checked'" ?> |
|
60 | 60 | name="<?= $component->getInputName() ?>[<?= $option_val ?>]" |
61 | 61 | > |
62 | 62 | <span><?= $option_label ?></span> |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | <label> |
71 | 71 | <input |
72 | 72 | type="checkbox" |
73 | - <?php if(!empty($value[$val])) echo "checked='checked'" ?> |
|
73 | + <?php if (!empty($value[$val])) echo "checked='checked'" ?> |
|
74 | 74 | name="<?= $component->getInputName() ?>[<?= $val ?>]" |
75 | 75 | > |
76 | 76 | <span><?= $label ?></span> |
@@ -1,7 +1,9 @@ |
||
1 | 1 | <?php |
2 | 2 | /** @var Nayjest\Grids\Components\SelectFilter $component */ |
3 | 3 | $value = $component->getValue(); |
4 | -if (!is_array($value)) $value = []; |
|
4 | +if (!is_array($value)) { |
|
5 | + $value = []; |
|
6 | +} |
|
5 | 7 | $id = uniqid() . mt_rand(); |
6 | 8 | ?> |
7 | 9 | <div class="btn-group"> |
@@ -27,7 +27,7 @@ |
||
27 | 27 | } else { |
28 | 28 | try { |
29 | 29 | return $this->src->{$fieldName}; |
30 | - } catch(Exception $e) { |
|
30 | + } catch (Exception $e) { |
|
31 | 31 | throw new RuntimeException( |
32 | 32 | "Can't read '$fieldName' property from DataRow", |
33 | 33 | 0, |
@@ -4,7 +4,6 @@ |
||
4 | 4 | * |
5 | 5 | * @var $grid Nayjest\Grids\Grid |
6 | 6 | */ |
7 | -use Nayjest\Grids\Components\ExcelDownload; |
|
8 | 7 | ?> |
9 | 8 | <span style="visibility:hidden"> |
10 | 9 | <a |
@@ -2,7 +2,6 @@ |
||
2 | 2 | |
3 | 3 | namespace Nayjest\Grids\Components; |
4 | 4 | |
5 | -use Event; |
|
6 | 5 | use Illuminate\Pagination\Paginator; |
7 | 6 | use Illuminate\Foundation\Application; |
8 | 7 | use Maatwebsite\Excel\Classes\LaravelExcelWorksheet; |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | if (version_compare(Application::VERSION, '5.0.0', '<')) { |
178 | 178 | $provider->getPaginationFactory()->setPageName('page_unused'); |
179 | 179 | } else { |
180 | - Paginator::currentPageResolver(function () { |
|
180 | + Paginator::currentPageResolver(function() { |
|
181 | 181 | return 1; |
182 | 182 | }); |
183 | 183 | } |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | $excel = app('excel'); |
231 | 231 | $excel |
232 | 232 | ->create($this->getFileName(), $this->getOnFileCreate()) |
233 | - ->save('xlsx',Storage::disk('local')->getDriver()->getAdapter()->getPathPrefix() . 'public/excels/'); |
|
233 | + ->save('xlsx', Storage::disk('local')->getDriver()->getAdapter()->getPathPrefix().'public/excels/'); |
|
234 | 234 | } |
235 | 235 | |
236 | 236 | protected function escapeString($str) |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | public function getOnFileCreate() |
292 | 292 | { |
293 | 293 | if ($this->on_file_create === null) { |
294 | - $this->on_file_create = function (LaravelExcelWriter $excel) { |
|
294 | + $this->on_file_create = function(LaravelExcelWriter $excel) { |
|
295 | 295 | $excel->sheet($this->getSheetName(), $this->getOnSheetCreate()); |
296 | 296 | |
297 | 297 | }; |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | public function getOnSheetCreate() |
317 | 317 | { |
318 | 318 | if ($this->on_sheet_create === null) { |
319 | - $this->on_sheet_create = function (LaravelExcelWorksheet $sheet) { |
|
319 | + $this->on_sheet_create = function(LaravelExcelWorksheet $sheet) { |
|
320 | 320 | // for($i = 0; $i < count($data); $i++) { |
321 | 321 | // for ($j = 0; $j < count($data[$i]); $j++) { |
322 | 322 | // $sheet->appendRow(($i * 1000) + $j + 1, $data[$i][$j]); |
@@ -4,16 +4,8 @@ |
||
4 | 4 | |
5 | 5 | use Event; |
6 | 6 | use Illuminate\Support\Facades\Storage; |
7 | -use Illuminate\Pagination\Paginator; |
|
8 | -use Illuminate\Foundation\Application; |
|
9 | -use Maatwebsite\Excel\Classes\LaravelExcelWorksheet; |
|
10 | -use Maatwebsite\Excel\Excel; |
|
11 | -use Maatwebsite\Excel\Writers\LaravelExcelWriter; |
|
12 | 7 | use Nayjest\Grids\Components\Base\RenderableComponent; |
13 | 8 | use Nayjest\Grids\Components\Base\RenderableRegistry; |
14 | -use Nayjest\Grids\DataProvider; |
|
15 | -use Nayjest\Grids\DataRow; |
|
16 | -use Nayjest\Grids\FieldConfig; |
|
17 | 9 | use Nayjest\Grids\Grid; |
18 | 10 | |
19 | 11 | class ExcelDownload extends RenderableComponent |
@@ -67,12 +67,12 @@ |
||
67 | 67 | public function initialize(Grid $grid) |
68 | 68 | { |
69 | 69 | parent::initialize($grid); |
70 | - Event::listen(Grid::EVENT_PREPARE, function (Grid $grid) { |
|
70 | + Event::listen(Grid::EVENT_PREPARE, function(Grid $grid) { |
|
71 | 71 | if ($this->grid !== $grid) { |
72 | 72 | return; |
73 | 73 | } |
74 | 74 | if ($grid->getInputProcessor()->getValue(static::INPUT_PARAM, false)) { |
75 | - foreach (glob(Storage::disk('local')->getDriver()->getAdapter()->getPathPrefix() . 'public/excels/*.xlsx', GLOB_BRACE) as $fileName) { |
|
75 | + foreach (glob(Storage::disk('local')->getDriver()->getAdapter()->getPathPrefix().'public/excels/*.xlsx', GLOB_BRACE) as $fileName) { |
|
76 | 76 | if (strpos($fileName, $this->getBaseName())) { |
77 | 77 | $this->responseWithProtectedFile($fileName); |
78 | 78 | } |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | /** |
208 | 208 | * Returns footer component. |
209 | 209 | * |
210 | - * @return TFoot|null |
|
210 | + * @return null|Components\Base\ComponentInterface |
|
211 | 211 | */ |
212 | 212 | public function footer() |
213 | 213 | { |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | /** |
218 | 218 | * Returns header component. |
219 | 219 | * |
220 | - * @return THead|null |
|
220 | + * @return null|Components\Base\ComponentInterface |
|
221 | 221 | */ |
222 | 222 | public function header() |
223 | 223 | { |
@@ -99,7 +99,7 @@ |
||
99 | 99 | if (empty($trace['class']) || !$this instanceof $trace['class']) { |
100 | 100 | # may be closure |
101 | 101 | if (isset($trace['file'], $trace['line'])) { |
102 | - $str .= $trace['file'] . $trace['line']; |
|
102 | + $str .= $trace['file'].$trace['line']; |
|
103 | 103 | } |
104 | 104 | } |
105 | 105 | } |
@@ -55,7 +55,7 @@ |
||
55 | 55 | public function initialize(Grid $grid) |
56 | 56 | { |
57 | 57 | parent::initialize($grid); |
58 | - Event::listen(Grid::EVENT_PREPARE, function (Grid $grid) { |
|
58 | + Event::listen(Grid::EVENT_PREPARE, function(Grid $grid) { |
|
59 | 59 | $this->config = $grid->getConfig(); |
60 | 60 | if ($grid->getInputProcessor()->getValue(static::INPUT_PARAM, false)) { |
61 | 61 | dispatch(new ExportExcel($this->getDate(), $this->getBaseName(), $this->config)); |