Conditions | 2 |
Paths | 2 |
Total Lines | 27 |
Code Lines | 20 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | public function getEditForm($id = null, $fields = null) { |
||
15 | $form = parent::getEditForm($id, $fields); |
||
16 | |||
17 | $grid = $form->Fields()->fieldByName($this->sanitiseClassName($this->modelClass)); |
||
18 | |||
19 | $grid->getConfig() |
||
20 | ->removeComponentsByType('GridFieldPaginator') |
||
21 | ->removeComponentsByType('GridFieldAddNewButton') |
||
22 | ->removeComponentsByType('GridFieldPrintButton') |
||
23 | ->removeComponentsByType('GridFieldExportButton') |
||
24 | ->addComponents( |
||
25 | new GridFieldPaginatorWithShowAll(30), |
||
26 | $multiClass = new MultiClassSelector(), |
||
27 | $sortable = new GridFieldOrderableRows('SortOrder') |
||
28 | ); |
||
29 | |||
30 | $subBlocks = ClassInfo::subclassesFor('SHBlock'); |
||
31 | if (is_null($subBlocks)) { |
||
32 | $subBlocks = array('SHBlock'); |
||
33 | }else{ |
||
34 | unset($subBlocks['SHBlock']); |
||
35 | } |
||
36 | |||
37 | $multiClass->setClasses($subBlocks); |
||
38 | $grid->setTitle('All Blcoks'); |
||
39 | return $form; |
||
40 | } |
||
41 | } |