CopyFactorySiteConfigExtension   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 25
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A updateCMSFields() 0 17 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