Passed
Pull Request — master (#13)
by
unknown
02:45
created
src/SettingsField.php 1 patch
Indentation   +80 added lines, -80 removed lines patch added patch discarded remove patch
@@ -20,90 +20,90 @@
 block discarded – undo
20 20
  */
21 21
 class SettingsField extends CompositeField
22 22
 {
23
-    /**
24
-     * Reference to the inner upload field (ImportField).
25
-     */
26
-    private $innerField = null;
23
+	/**
24
+	 * Reference to the inner upload field (ImportField).
25
+	 */
26
+	private $innerField = null;
27 27
 
28
-    /**
29
-     * Augments a simple CompositeField with uploader and import options.
30
-     *
31
-     * @param $children FieldSet/array Any additional children.
32
-     */
33
-    public function __construct($children = null)
34
-    {
35
-        if ($children) {
36
-            $class = get_class();
37
-            throw new InvalidArgumentException(
38
-                "${class}::__construct does not accept extra parameters."
39
-            );
40
-        }
28
+	/**
29
+	 * Augments a simple CompositeField with uploader and import options.
30
+	 *
31
+	 * @param $children FieldSet/array Any additional children.
32
+	 */
33
+	public function __construct($children = null)
34
+	{
35
+		if ($children) {
36
+			$class = get_class();
37
+			throw new InvalidArgumentException(
38
+				"${class}::__construct does not accept extra parameters."
39
+			);
40
+		}
41 41
 
42
-        // Add JS specific to this field.
43
-        Requirements::javascript('silverstripe/documentconverter: javascript/DocumentConversionField.js');
42
+		// Add JS specific to this field.
43
+		Requirements::javascript('silverstripe/documentconverter: javascript/DocumentConversionField.js');
44 44
 
45
-        $fields = FieldList::create([
46
-            LiteralField::create(
47
-                'FileWarningHeader',
48
-                '<div class="alert alert-warning">' . _t(
49
-                    __CLASS__ . '.FileWarningHeader',
50
-                    'Warning: import will remove all content and subpages of this page.'
51
-                ) . '</div>',
52
-                4
53
-            ),
54
-            $splitHeader = DropdownField::create(
55
-                'DocumentConversionSettings-SplitHeader',
56
-                _t(
57
-                    __CLASS__ . '.SplitHeader',
58
-                    'Split document into pages'
59
-                ),
60
-                [
61
-                    0 => _t(__CLASS__ . '.No', 'no'),
62
-                    1 => _t(__CLASS__ . '.EachH1', 'for each heading 1'),
63
-                    2 => _t(__CLASS__ . '.EachH2', 'for each heading 2')
64
-                ]
65
-            ),
66
-            $keepSource = CheckboxField::create(
67
-                'DocumentConversionSettings-KeepSource',
68
-                _t(
69
-                    __CLASS__ . '.KeepSource',
70
-                    'Keep the original document. Adds a link to it on TOC, if enabled.'
71
-                )
72
-            ),
73
-            $chosenFolderID = TreeDropdownField::create(
74
-                'DocumentConversionSettings-ChosenFolderID',
75
-                _t(__CLASS__ . '.ChooseFolder', 'Choose a folder to save this file'),
76
-                Folder::class
77
-            ),
78
-            $includeTOC = CheckboxField::create(
79
-                'DocumentConversionSettings-IncludeTOC',
80
-                _t(__CLASS__ . '.IncludeTOC', 'Replace this page with a Table of Contents.')
81
-            ),
82
-            $publishPages = CheckboxField::create(
83
-                'DocumentConversionSettings-PublishPages',
84
-                _t(
85
-                    __CLASS__ . '.publishPages',
86
-                    'Publish modified pages (not recommended unless you are sure about the conversion outcome)'
87
-                )
88
-            ),
89
-            $this->innerField = ImportField::create(
90
-                'ImportedFromFile',
91
-                _t(__CLASS__ . '.ImportedFromFile', 'Import content from a word document')
92
-            )
93
-        ]);
45
+		$fields = FieldList::create([
46
+			LiteralField::create(
47
+				'FileWarningHeader',
48
+				'<div class="alert alert-warning">' . _t(
49
+					__CLASS__ . '.FileWarningHeader',
50
+					'Warning: import will remove all content and subpages of this page.'
51
+				) . '</div>',
52
+				4
53
+			),
54
+			$splitHeader = DropdownField::create(
55
+				'DocumentConversionSettings-SplitHeader',
56
+				_t(
57
+					__CLASS__ . '.SplitHeader',
58
+					'Split document into pages'
59
+				),
60
+				[
61
+					0 => _t(__CLASS__ . '.No', 'no'),
62
+					1 => _t(__CLASS__ . '.EachH1', 'for each heading 1'),
63
+					2 => _t(__CLASS__ . '.EachH2', 'for each heading 2')
64
+				]
65
+			),
66
+			$keepSource = CheckboxField::create(
67
+				'DocumentConversionSettings-KeepSource',
68
+				_t(
69
+					__CLASS__ . '.KeepSource',
70
+					'Keep the original document. Adds a link to it on TOC, if enabled.'
71
+				)
72
+			),
73
+			$chosenFolderID = TreeDropdownField::create(
74
+				'DocumentConversionSettings-ChosenFolderID',
75
+				_t(__CLASS__ . '.ChooseFolder', 'Choose a folder to save this file'),
76
+				Folder::class
77
+			),
78
+			$includeTOC = CheckboxField::create(
79
+				'DocumentConversionSettings-IncludeTOC',
80
+				_t(__CLASS__ . '.IncludeTOC', 'Replace this page with a Table of Contents.')
81
+			),
82
+			$publishPages = CheckboxField::create(
83
+				'DocumentConversionSettings-PublishPages',
84
+				_t(
85
+					__CLASS__ . '.publishPages',
86
+					'Publish modified pages (not recommended unless you are sure about the conversion outcome)'
87
+				)
88
+			),
89
+			$this->innerField = ImportField::create(
90
+				'ImportedFromFile',
91
+				_t(__CLASS__ . '.ImportedFromFile', 'Import content from a word document')
92
+			)
93
+		]);
94 94
 
95
-        // Prevent the warning popup that appears when navigating away from the page.
96
-        $splitHeader->addExtraClass('no-change-track');
97
-        $keepSource->addExtraClass('no-change-track');
98
-        $chosenFolderID->addExtraClass('no-change-track');
99
-        $includeTOC->addExtraClass('no-change-track');
100
-        $publishPages->addExtraClass('no-change-track');
95
+		// Prevent the warning popup that appears when navigating away from the page.
96
+		$splitHeader->addExtraClass('no-change-track');
97
+		$keepSource->addExtraClass('no-change-track');
98
+		$chosenFolderID->addExtraClass('no-change-track');
99
+		$includeTOC->addExtraClass('no-change-track');
100
+		$publishPages->addExtraClass('no-change-track');
101 101
 
102
-        return parent::__construct($fields);
103
-    }
102
+		return parent::__construct($fields);
103
+	}
104 104
 
105
-    public function getInnerField()
106
-    {
107
-        return $this->innerField;
108
-    }
105
+	public function getInnerField()
106
+	{
107
+		return $this->innerField;
108
+	}
109 109
 }
Please login to merge, or discard this patch.