diff --git a/bl-plugins/tinymce/languages/de_CH.json b/bl-plugins/tinymce/languages/de_CH.json index fd3a0cfe..b451bc8f 100644 --- a/bl-plugins/tinymce/languages/de_CH.json +++ b/bl-plugins/tinymce/languages/de_CH.json @@ -4,7 +4,8 @@ "name": "TinyMCE", "description": "WYSIWYG HTML Editor, mit dem Inhalte einfach formatiert werden können." }, - "Toolbar top": "Obere Werkzeugleiste", - "Toolbar bottom": "Untere Werkzeugleiste", - "Mobile toolbar": "Werkzeugleiste auf Mobiles" -} + "toolbar-top": "Obere Werkzeugleiste", + "toolbar-bottom": "Untere Werkzeugleiste", + "codesample-languages": "Codesample Programmiersprachen", + "codesample-supported-laguages": "Pragrammiersprachen die von Prism unterstützt werden." +} \ No newline at end of file diff --git a/bl-plugins/tinymce/languages/de_DE.json b/bl-plugins/tinymce/languages/de_DE.json index b8222abb..b451bc8f 100644 --- a/bl-plugins/tinymce/languages/de_DE.json +++ b/bl-plugins/tinymce/languages/de_DE.json @@ -4,7 +4,8 @@ "name": "TinyMCE", "description": "WYSIWYG HTML Editor, mit dem Inhalte einfach formatiert werden können." }, - "Toolbar top": "Obere Werkzeugleiste", - "Toolbar bottom": "Untere Werkzeugleiste", - "Mobile toolbar": "Werkzeugleiste auf Mobiles" -} + "toolbar-top": "Obere Werkzeugleiste", + "toolbar-bottom": "Untere Werkzeugleiste", + "codesample-languages": "Codesample Programmiersprachen", + "codesample-supported-laguages": "Pragrammiersprachen die von Prism unterstützt werden." +} \ No newline at end of file diff --git a/bl-plugins/tinymce/languages/en.json b/bl-plugins/tinymce/languages/en.json index 53cac081..55b87e5a 100644 --- a/bl-plugins/tinymce/languages/en.json +++ b/bl-plugins/tinymce/languages/en.json @@ -3,5 +3,9 @@ { "name": "TinyMCE", "description": "HTML Editor for formatting content. Recommended for the users who don't want to work with Markdown code." - } + }, + "toolbar-top": "Toolbar top", + "toolbar-bottom": "Toolbar bottom", + "codesample-languages": "Codesample languages", + "codesample-supported-laguages": "Programming languages supported by Prism." } \ No newline at end of file diff --git a/bl-plugins/tinymce/plugin.php b/bl-plugins/tinymce/plugin.php index 45e7314a..f8701f2a 100644 --- a/bl-plugins/tinymce/plugin.php +++ b/bl-plugins/tinymce/plugin.php @@ -12,7 +12,8 @@ class pluginTinymce extends Plugin { $this->dbFields = array( 'toolbar1'=>'formatselect bold italic forecolor backcolor removeformat | bullist numlist table | blockquote alignleft aligncenter alignright | link unlink pagebreak image code', 'toolbar2'=>'', - 'plugins'=>'code autolink image link pagebreak advlist lists textpattern table' + 'plugins'=>'code autolink image link pagebreak advlist lists textpattern table', + 'codesampleLanguages'=>'HTML/XML markup|JavaScript javascript|CSS css|PHP php|Ruby ruby|Python python|Java java|C c|C# sharp|C++ cpp' ); } @@ -20,13 +21,17 @@ class pluginTinymce extends Plugin { { global $L; - $html = '
'; - $html .= ''; + $html = ''; + + $html .= '
'; + $html .= ''; $html .= ''; $html .= '
'; $html .= '
'; - $html .= ''; + $html .= ''; $html .= ''; $html .= '
'; @@ -35,6 +40,14 @@ class pluginTinymce extends Plugin { $html .= ''; $html .= '
'; + if (strpos($this->getValue('plugins'), 'codesample') !== false) { + $html .= '
'; + $html .= ''; + $html .= ''; + $html .= ''.$L->get('codesample-supported-laguages').''; + $html .= '
'; + } + return $html; } @@ -64,6 +77,14 @@ class pluginTinymce extends Plugin { $plugins = $this->getValue('plugins'); $version = $this->version(); + if (strpos($this->getValue('plugins'), 'codesample') !== false) { + $codesampleLanguages = explode("|", $this->getValue('codesampleLanguages')); + foreach($codesampleLanguages AS $codesampleLang) { + $values = explode(" ", $codesampleLang); + $codesampleConfig .= "{ text: '" . $values[0] . "', value: '" . $values[1] . "' },"; + } + } + $lang = 'en'; if (file_exists($this->phpPath().'tinymce'.DS.'langs'.DS.$L->currentLanguage().'.js')) { $lang = $L->currentLanguage(); @@ -121,7 +142,8 @@ $html = <<