SiteConfigExtension::updateCMSFields()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace DorsetDigital\TawkTo;
4
5
6
use SilverStripe\Forms\TextareaField;
7
use SilverStripe\ORM\DataExtension;
8
use SilverStripe\Forms\FieldList;
9
10
class SiteConfigExtension extends DataExtension
11
{
12
    private static $db = [
0 ignored issues
show
introduced by
The private property $db is not used, and could be removed.
Loading history...
13
        'TawkToEmbedCode' => 'Text'
14
    ];
15
16
    public function updateCMSFields(FieldList $fields) {
17
        $fields->addFieldToTab('Root.TawkTo', TextareaField::create('TawkToEmbedCode')
18
            ->setTitle(_t(__CLASS__ . '.EmbedFieldTitle', 'Embed Code'))
19
            ->setDescription(_t(__CLASS__ . '.EmbedFieldDescription', "Tawk.to embed code")));
20
        return $fields;
21
    }
22
}