codesample languges added
This commit is contained in:
parent
35a39cff65
commit
717b196594
2 changed files with 20 additions and 3 deletions
|
@ -6,7 +6,7 @@ AddDefaultCharset UTF-8
|
|||
RewriteEngine on
|
||||
|
||||
# Base directory
|
||||
#RewriteBase /
|
||||
RewriteBase /bludit/
|
||||
|
||||
# Deny direct access to the next directories
|
||||
RewriteRule ^bl-content/(databases|workspaces|pages|tmp)/.*$ - [R=404,L]
|
||||
|
|
|
@ -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'
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -35,6 +36,13 @@ class pluginTinymce extends Plugin {
|
|||
$html .= '<input name="plugins" id="jsplugins" type="text" value="'.$this->getValue('plugins').'">';
|
||||
$html .= '</div>';
|
||||
|
||||
if (strpos($this->getValue('plugins'), 'codesample') !== false) {
|
||||
$html .= '<div>';
|
||||
$html .= '<label>'.$L->get('Codesample Languages').'</label>';
|
||||
$html .= '<input name="codesampleLanguages" id="jsCodesampleLanguages" type="text" value="'.$this->getValue('codesampleLanguages').'">';
|
||||
$html .= '</div>';
|
||||
}
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
|
@ -64,6 +72,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 +137,8 @@ $html = <<<EOF
|
|||
toolbar1: "$toolbar1",
|
||||
toolbar2: "$toolbar2",
|
||||
language: "$lang",
|
||||
content_css: "$content_css"
|
||||
content_css: "$content_css",
|
||||
codesample_languages: [$codesampleConfig],
|
||||
});
|
||||
|
||||
</script>
|
||||
|
|
Loading…
Reference in a new issue