Completed
Push — develop ( f03bf3...36b331 )
by
unknown
14:10 queued 07:24
created

FormEditorLight::setLanguagePath()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
eloc 2
nc 1
nop 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
     /**
48
     * Sets the language path for tinyMCE language files
49
     *
50
     * @param $languagePath
51
     */
52
    public function setLanguagePath($languagePath) {
53
        $this->languagePath=$languagePath;
54
    }
55
}
56