CwpHtmlEditorConfig::getHtmlEditorConfig()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 0
dl 0
loc 9
rs 10
c 0
b 0
f 0
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