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

FormEditorLight::additionalLanguageOptions()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 8
rs 9.4286
cc 2
eloc 6
nc 2
nop 0
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