@@ -181,7 +181,7 @@ |
||
181 | 181 | |
182 | 182 | /** |
183 | 183 | * Set confirm dialog |
184 | - * @param string $messgae |
|
184 | + * @param string $message |
|
185 | 185 | * @param string $column |
186 | 186 | */ |
187 | 187 | public function setConfirm($message, $column = NULL) |
@@ -8,8 +8,8 @@ |
||
8 | 8 | |
9 | 9 | namespace Ublaboo\DataGrid\Column; |
10 | 10 | |
11 | -use Nette\Utils\Html, |
|
12 | - Ublaboo\DataGrid\DataGrid; |
|
11 | +use Nette\Utils\Html; |
|
12 | +use Ublaboo\DataGrid\DataGrid; |
|
13 | 13 | |
14 | 14 | class Action extends Column |
15 | 15 | { |
@@ -96,7 +96,7 @@ |
||
96 | 96 | ->href($this->grid->getPresenter()->link($this->href, $this->getItemParams($item))); |
97 | 97 | |
98 | 98 | if ($this->icon) { |
99 | - $a->add(Html::el('span')->class(DataGrid::$icon_prefix . $this->icon)); |
|
99 | + $a->add(Html::el('span')->class(DataGrid::$icon_prefix.$this->icon)); |
|
100 | 100 | |
101 | 101 | if (strlen($this->name)) { |
102 | 102 | $a->add(' '); |
@@ -71,8 +71,8 @@ discard block |
||
71 | 71 | |
72 | 72 | |
73 | 73 | /** |
74 | - * @param stirng $column |
|
75 | - * @param stirng $name |
|
74 | + * @param string $column |
|
75 | + * @param string $name |
|
76 | 76 | */ |
77 | 77 | public function __construct($column, $name) |
78 | 78 | { |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | /** |
188 | 188 | * Set column replacements |
189 | 189 | * @param array $replacements |
190 | - * @return void |
|
190 | + * @return Column |
|
191 | 191 | */ |
192 | 192 | public function setReplacement(array $replacements) |
193 | 193 | { |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | |
271 | 271 | /** |
272 | 272 | * Return custom renderer callback |
273 | - * @return callable |
|
273 | + * @return Renderer|null |
|
274 | 274 | */ |
275 | 275 | public function getRenderer() |
276 | 276 | { |
@@ -8,8 +8,8 @@ |
||
8 | 8 | |
9 | 9 | namespace Ublaboo\DataGrid\Column; |
10 | 10 | |
11 | -use Ublaboo\DataGrid\DataGridException, |
|
12 | - Ublaboo; |
|
11 | +use Ublaboo\DataGrid\DataGridException; |
|
12 | +use Ublaboo; |
|
13 | 13 | |
14 | 14 | abstract class Column extends Ublaboo\DataGrid\Object |
15 | 15 | { |
@@ -235,19 +235,19 @@ |
||
235 | 235 | public function setRenderer($renderer, $condition_callback = NULL) |
236 | 236 | { |
237 | 237 | if ($this->hasReplacements()) { |
238 | - throw new DataGridException ( |
|
238 | + throw new DataGridException( |
|
239 | 239 | "Use either Column::setReplacement() or Column::setRenderer, not both." |
240 | 240 | ); |
241 | 241 | } |
242 | 242 | |
243 | 243 | if (!is_callable($renderer)) { |
244 | - throw new DataGridException ( |
|
244 | + throw new DataGridException( |
|
245 | 245 | "Renderer (method Column::setRenderer()) must be callable." |
246 | 246 | ); |
247 | 247 | } |
248 | 248 | |
249 | 249 | if (NULL != $condition_callback && !is_callable($condition_callback)) { |
250 | - throw new DataGridException ( |
|
250 | + throw new DataGridException( |
|
251 | 251 | "Renderer (method Column::setRenderer()) must be callable." |
252 | 252 | ); |
253 | 253 | } |
@@ -105,7 +105,6 @@ discard block |
||
105 | 105 | |
106 | 106 | /** |
107 | 107 | * Get attribute title |
108 | - * @param string $title |
|
109 | 108 | */ |
110 | 109 | public function getTitle() |
111 | 110 | { |
@@ -127,7 +126,6 @@ discard block |
||
127 | 126 | |
128 | 127 | /** |
129 | 128 | * Get attribute class |
130 | - * @param string $class |
|
131 | 129 | */ |
132 | 130 | public function getClass() |
133 | 131 | { |
@@ -8,8 +8,8 @@ |
||
8 | 8 | |
9 | 9 | namespace Ublaboo\DataGrid\Column; |
10 | 10 | |
11 | -use Nette\Utils\Html, |
|
12 | - Ublaboo\DataGrid\DataGrid; |
|
11 | +use Nette\Utils\Html; |
|
12 | +use Ublaboo\DataGrid\DataGrid; |
|
13 | 13 | |
14 | 14 | class ColumnLink extends Column |
15 | 15 | { |
@@ -275,7 +275,7 @@ |
||
275 | 275 | |
276 | 276 | /** |
277 | 277 | * Get item detail renderer |
278 | - * @return callable |
|
278 | + * @return string |
|
279 | 279 | */ |
280 | 280 | public function getRenderer() |
281 | 281 | { |
@@ -8,9 +8,9 @@ |
||
8 | 8 | |
9 | 9 | namespace Ublaboo\DataGrid\Column; |
10 | 10 | |
11 | -use Nette\Utils\Html, |
|
12 | - Ublaboo\DataGrid\DataGrid, |
|
13 | - Ublaboo; |
|
11 | +use Nette\Utils\Html; |
|
12 | +use Ublaboo\DataGrid\DataGrid; |
|
13 | +use Ublaboo; |
|
14 | 14 | |
15 | 15 | class ItemDetail extends Ublaboo\DataGrid\Object |
16 | 16 | { |
@@ -92,7 +92,7 @@ |
||
92 | 92 | ->data('toggle-detail-grid', $this->grid->getName()); |
93 | 93 | |
94 | 94 | if ($this->icon) { |
95 | - $a->add(Html::el('span')->class(DataGrid::$icon_prefix . $this->icon)); |
|
95 | + $a->add(Html::el('span')->class(DataGrid::$icon_prefix.$this->icon)); |
|
96 | 96 | |
97 | 97 | if (strlen($this->text)) { |
98 | 98 | $a->add(' '); |
@@ -47,7 +47,7 @@ |
||
47 | 47 | |
48 | 48 | |
49 | 49 | /** |
50 | - * @return Nette\Paginator |
|
50 | + * @return Nette\Utils\Paginator |
|
51 | 51 | */ |
52 | 52 | public function getPaginator() |
53 | 53 | { |
@@ -42,7 +42,7 @@ |
||
42 | 42 | |
43 | 43 | public function getTemplateFile() |
44 | 44 | { |
45 | - return $this->template_file ?: __DIR__ . '/templates/data_grid_paginator.latte'; |
|
45 | + return $this->template_file ?: __DIR__.'/templates/data_grid_paginator.latte'; |
|
46 | 46 | } |
47 | 47 | |
48 | 48 |
@@ -830,7 +830,7 @@ discard block |
||
830 | 830 | /** |
831 | 831 | * Fill array of Filter\Filter[] with values from $this->filter persistent parameter |
832 | 832 | * Fill array of Column\Column[] with values from $this->sort persistent parameter |
833 | - * @return array $this->filters === Filter\Filter[] |
|
833 | + * @return Filter\Filter[] $this->filters === Filter\Filter[] |
|
834 | 834 | */ |
835 | 835 | public function assableFilters() |
836 | 836 | { |
@@ -982,7 +982,7 @@ discard block |
||
982 | 982 | |
983 | 983 | /** |
984 | 984 | * Get collection of all group actions |
985 | - * @return array |
|
985 | + * @return GroupAction\GroupActionCollection |
|
986 | 986 | */ |
987 | 987 | public function getGroupActionCollection() |
988 | 988 | { |
@@ -1289,7 +1289,6 @@ discard block |
||
1289 | 1289 | /** |
1290 | 1290 | * Set $this->filter values after filter form submitted |
1291 | 1291 | * @param Form $form |
1292 | - * @param Nette\Utils\ArrayHash $values |
|
1293 | 1292 | * @return void |
1294 | 1293 | */ |
1295 | 1294 | public function filterSucceeded(Form $form) |
@@ -1377,7 +1376,7 @@ discard block |
||
1377 | 1376 | |
1378 | 1377 | /** |
1379 | 1378 | * Get set of set columns |
1380 | - * @return array |
|
1379 | + * @return Column\IColumn[] |
|
1381 | 1380 | */ |
1382 | 1381 | public function getColumns() |
1383 | 1382 | { |
@@ -8,9 +8,9 @@ |
||
8 | 8 | |
9 | 9 | namespace Ublaboo\DataGrid; |
10 | 10 | |
11 | -use Nette, |
|
12 | - Ublaboo\DataGrid\Utils\ArraysHelper, |
|
13 | - Nette\Application\UI\Form; |
|
11 | +use Nette; |
|
12 | +use Ublaboo\DataGrid\Utils\ArraysHelper; |
|
13 | +use Nette\Application\UI\Form; |
|
14 | 14 | |
15 | 15 | class DataGrid extends Nette\Application\UI\Control |
16 | 16 | { |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | */ |
217 | 217 | public function getSessionSectionName() |
218 | 218 | { |
219 | - return $this->getPresenter()->getName() . ':' . $this->getName(); |
|
219 | + return $this->getPresenter()->getName().':'.$this->getName(); |
|
220 | 220 | } |
221 | 221 | |
222 | 222 | |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | } else if ($source instanceof Nette\Database\Table\Selection) { |
341 | 341 | $data_source = new DataSource\NetteDatabaseTableDataSource($source, $this->primary_key); |
342 | 342 | |
343 | - } else if ($source instanceof \Kdyby\Doctrine\QueryBuilder) { |
|
343 | + } else if ($source instanceof \Kdyby\Doctrine\QueryBuilder) { |
|
344 | 344 | $data_source = new DataSource\DoctrineDataSource($source, $this->primary_key); |
345 | 345 | |
346 | 346 | } else { |
@@ -430,7 +430,7 @@ discard block |
||
430 | 430 | */ |
431 | 431 | public function getOriginalTemplateFile() |
432 | 432 | { |
433 | - return __DIR__ . '/templates/datagrid.latte'; |
|
433 | + return __DIR__.'/templates/datagrid.latte'; |
|
434 | 434 | } |
435 | 435 | |
436 | 436 | |
@@ -517,7 +517,7 @@ discard block |
||
517 | 517 | * Set tree view template file |
518 | 518 | */ |
519 | 519 | if (!$this->template_file) { |
520 | - $this->setTemplateFile(__DIR__ . '/templates/datagrid_tree.latte'); |
|
520 | + $this->setTemplateFile(__DIR__.'/templates/datagrid_tree.latte'); |
|
521 | 521 | } |
522 | 522 | |
523 | 523 | return $this; |
@@ -1187,7 +1187,7 @@ discard block |
||
1187 | 1187 | */ |
1188 | 1188 | public function redrawItem($id, $primary_where_column = NULL) |
1189 | 1189 | { |
1190 | - $this->redraw_item = [($primary_where_column?: $this->primary_key) => $id]; |
|
1190 | + $this->redraw_item = [($primary_where_column ?: $this->primary_key) => $id]; |
|
1191 | 1191 | |
1192 | 1192 | $this->redrawControl('items'); |
1193 | 1193 | $this->getPresenter()->payload->_datagrid_url = $this->refresh_url; |
@@ -340,7 +340,7 @@ |
||
340 | 340 | } else if ($source instanceof Nette\Database\Table\Selection) { |
341 | 341 | $data_source = new DataSource\NetteDatabaseTableDataSource($source, $this->primary_key); |
342 | 342 | |
343 | - } else if ($source instanceof \Kdyby\Doctrine\QueryBuilder) { |
|
343 | + } else if ($source instanceof \Kdyby\Doctrine\QueryBuilder) { |
|
344 | 344 | $data_source = new DataSource\DoctrineDataSource($source, $this->primary_key); |
345 | 345 | |
346 | 346 | } else { |
@@ -87,7 +87,7 @@ |
||
87 | 87 | /** |
88 | 88 | * Filter data - get one row |
89 | 89 | * @param array $condition |
90 | - * @return void |
|
90 | + * @return ArrayDataSource |
|
91 | 91 | */ |
92 | 92 | public function filterOne(array $condition) |
93 | 93 | { |
@@ -8,9 +8,9 @@ |
||
8 | 8 | |
9 | 9 | namespace Ublaboo\DataGrid\DataSource; |
10 | 10 | |
11 | -use Ublaboo\DataGrid\Filter\Filter, |
|
12 | - Nette\Utils\Callback, |
|
13 | - Nette\Utils\Strings; |
|
11 | +use Ublaboo\DataGrid\Filter\Filter; |
|
12 | +use Nette\Utils\Callback; |
|
13 | +use Nette\Utils\Strings; |
|
14 | 14 | |
15 | 15 | class ArrayDataSource |
16 | 16 | { |
@@ -143,8 +143,8 @@ |
||
143 | 143 | } |
144 | 144 | |
145 | 145 | $this->data = array(); |
146 | - foreach($data as $i) { |
|
147 | - foreach($i as $item) { |
|
146 | + foreach ($data as $i) { |
|
147 | + foreach ($i as $item) { |
|
148 | 148 | $this->data[] = $item; |
149 | 149 | } |
150 | 150 | } |
@@ -8,10 +8,10 @@ |
||
8 | 8 | |
9 | 9 | namespace Ublaboo\DataGrid\DataSource; |
10 | 10 | |
11 | -use DibiFluent, |
|
12 | - Nette\Utils\Callback, |
|
13 | - Nette\Utils\Strings, |
|
14 | - Ublaboo\DataGrid\Filter; |
|
11 | +use DibiFluent; |
|
12 | +use Nette\Utils\Callback; |
|
13 | +use Nette\Utils\Strings; |
|
14 | +use Ublaboo\DataGrid\Filter; |
|
15 | 15 | |
16 | 16 | class DibiFluentDataSource implements IDataSource |
17 | 17 | { |
@@ -114,7 +114,7 @@ |
||
114 | 114 | |
115 | 115 | /** |
116 | 116 | * Filter by date |
117 | - * @param Filter\FilterDate $filter |
|
117 | + * @param Filter\FilterText $filter |
|
118 | 118 | * @return void |
119 | 119 | */ |
120 | 120 | public function applyFilterText(Filter\FilterText $filter) |
@@ -8,9 +8,8 @@ |
||
8 | 8 | |
9 | 9 | namespace Ublaboo\DataGrid\DataSource; |
10 | 10 | |
11 | -use DibiFluent, |
|
12 | - Nette\Utils\Callback, |
|
13 | - Ublaboo\DataGrid\Filter; |
|
11 | +use DibiFluent; |
|
12 | +use Ublaboo\DataGrid\Filter; |
|
14 | 13 | |
15 | 14 | class DibiFluentMssqlDataSource extends DibiFluentDataSource |
16 | 15 | { |