Completed
Push — develop ( e597fd...e411d3 )
by
unknown
35:22 queued 21:27
created

FormEditorLight   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 4
c 2
b 0
f 1
lcom 1
cbo 1
dl 0
loc 34
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A additionalOptions() 0 7 1
A additionalLanguageOptions() 0 8 2
A setLanguage() 0 3 1
1
<?php
2
/**
3
 * YAWIK
4
 *
5
 * @filesource
6
 * @copyright (c) 2013-2015 Cross Solution (http://cross-solution.de)
7
 * @license   MIT
8
 * @author    [email protected]
9
 */
10
11
namespace Core\Form\View\Helper;
12
13
class FormEditorLight extends FormEditor
14
{
15
    protected $theme = 'light';
16
17
    protected $language="de";
18
19
    protected $languagePath="/js/tinymce-lang/";
20
21
    protected function additionalOptions() {
22
        return '
23
        toolbar: "undo redo | formatselect | alignleft aligncenter alignright",
24
        menubar: false,
25
        block_formats: "Job title=h1;Subtitle=h2",
26
        '.$this->additionalLanguageOptions();
27
    }
28
29
    protected function additionalLanguageOptions(){
30
        $options='';
31
        if (in_array($this->language,['de','fr','it','es'])) {
32
            $options='language: "'.$this->language.'",'.
33
                     'language_url: "'. $this->languagePath . $this->language.'.js",';
34
        }
35
        return $options;
36
    }
37
38
    /**
39
     * Translations of "Job title" and "Subtitle" are directly made in the tinymce language files
40
     *
41
     * @param $language
42
     */
43
    public function setLanguage($language) {
44
        $this->language=$language;
45
    }
46
}
47