CwpHtmlEditorConfig   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 18
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A getHtmlEditorConfig() 0 9 2
1
<?php
2
3
namespace CWP\Core\Extension;
4
5
use SilverStripe\ORM\DataExtension;
6
7
class CwpHtmlEditorConfig extends DataExtension
8
{
9
10
    /**
11
     * @return string
12
     *
13
     * Override the default HtmlEditorConfig from 'cms' to 'cwp' defined in cwp-core/_config.php
14
     * However if the group has a custom editor configuration set, use that instead.
15
     */
16
    public function getHtmlEditorConfig()
17
    {
18
        $originalConfig = $this->owner->getField("HtmlEditorConfig");
19
20
        if ($originalConfig) {
21
            return $originalConfig;
22
        }
23
24
        return 'cwp';
25
    }
26
}
27