Completed
Pull Request — master (#7)
by
unknown
02:33
created

PageExtension   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 23
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A updateCMSFields() 0 16 1
1
<?php
2
3
namespace SilverStripe\DocumentConverter;
4
5
use SilverStripe\Assets\File;
6
use SilverStripe\Forms\FieldList;
7
use SilverStripe\ORM\DataExtension;
8
9
class PageExtension extends DataExtension
10
{
11
12
    private static $has_one = [
0 ignored issues
show
introduced by
The private property $has_one is not used, and could be removed.
Loading history...
13
        'ImportedFromFile' => File::class
14
    ];
15
16
    public function updateCMSFields(FieldList $fields)
17
    {
18
        /*
19
		// Currently the ToggleCompositeField plays badly with TreeDropdownField formatting.
20
		// Could be switched back in the future, if this is fixed.
21
		$fields->addFieldToTab('Root.Main', 
22
			ToggleCompositeField::create('Import', 'Import', [
23
				SettingsField::create()
24
			])->setHeadingLevel(4)
25
		);
26
		 */
27
        $fields->findOrMakeTab(
28
            'Root.Import',
29
            _t(__CLASS__ . '.ImportTab', 'Import')
30
        );
31
        $fields->addFieldToTab('Root.Import', SettingsField::create());
32
    }
33
}
34