Conditions | 1 |
Paths | 1 |
Total Lines | 21 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 13 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
43 | public function getCMSFields() |
||
44 | { |
||
45 | 1 | $this->beforeUpdateCMSFields(function (FieldList $fields) { |
|
46 | 1 | $fields->removeByName('ElementPromos'); |
|
47 | |||
48 | 1 | $config = GridFieldConfig_RecordViewer::create(); |
|
49 | 1 | $fields->addFieldToTab( |
|
50 | 1 | 'Root.Elements', |
|
51 | 1 | GridField::create( |
|
52 | 1 | 'ElementPromos', |
|
53 | 1 | 'Elements', |
|
54 | 1 | $this->ElementPromos(), |
|
55 | 1 | $config |
|
56 | ) |
||
57 | ); |
||
58 | |||
59 | 1 | $fields->dataFieldByName('Image') |
|
60 | 1 | ->setFolderName('Uploads/Elements/Promos'); |
|
61 | 1 | }); |
|
62 | |||
63 | return parent::getCMSFields(); |
||
64 | } |
||
66 |