CopyFactorySiteConfigExtension::updateCMSFields()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 17

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 17
rs 9.7
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
4
class CopyFactorySiteConfigExtension extends DataExtension
5
{
6
    private static $db = array(
7
        'AllowCopyingOfRecords' => 'Int'
8
    );
9
10
11
    public function updateCMSFields(FieldList $fields)
12
    {
13
        $fields->addFieldToTab(
14
            'Root.Copy',
15
            $myDD = new DropdownField(
16
                "AllowCopyingOfRecords",
17
                _t("CopyFactory.ALLOW_COPYING_OF_RECORDS", "Allow Copying of Records"),
18
                array(
19
                    0 => _t("CopyFactory.NO_COPYING_AT_ALL", "Do not allow copying of records (default setting)"),
20
                    1 => _t("CopyFactory.DRY_RUN_ONLY", "Dry run only (not actual changes will be made)"),
21
                    2 => _t("CopyFactory.ALLOW_COPYING", "Allow copying of records (please use with care)")
22
                )
23
            )
24
        );
25
        $myDD->setRightTitle(_t("CopyFactory.TURN_IT_OFF", "It is recommended to turn on the ability to copy records only when required and to turn it off between copy sessions."));
26
        return $fields;
27
    }
28
}
29