1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-30 19:30:25 +02:00

TinyMce code-highlighting class preference

This commit is contained in:
Cameron
2017-11-09 10:18:13 -08:00
parent 93ab7996c7
commit c0c1e43a57
4 changed files with 10 additions and 5 deletions

View File

@@ -56,9 +56,10 @@ e107::lan('tinymce4','admin', 'true');
protected $prefs = array(
'paste_as_text' => array('title'=> TMCEALAN_1, 'type'=>'boolean', 'data' => 'int','help'=> ''),
'browser_spellcheck' => array('title'=> TMCEALAN_2, 'type'=>'boolean', 'data' => 'int','help'=> TMCEALAN_3),
'visualblocks' => array('title'=> TMCEALAN_4, 'type'=>'boolean', 'data' => 'int','help'=> TMCEALAN_5),
'paste_as_text' => array('title'=> TMCEALAN_1, 'type'=>'boolean', 'data' => 'int','help'=> ''),
'browser_spellcheck' => array('title'=> TMCEALAN_2, 'type'=>'boolean', 'data' => 'int','help'=> TMCEALAN_3),
'visualblocks' => array('title'=> TMCEALAN_4, 'type'=>'boolean', 'data' => 'int','help'=> TMCEALAN_5),
'code_highlight_class' => array('title'=> TMCEALAN_6, 'type'=>'text', 'data' => 'str','help'=> ''),
);

View File

@@ -14,4 +14,5 @@ define("TMCEALAN_2", "Browser spellcheck");
define("TMCEALAN_3", "Enable this if the browser internal spellchecker should be used.");
define("TMCEALAN_4", "Visual Blocks");
define("TMCEALAN_5", "Enable to make html blocks visible during editing.");
?>
define("TMCEALAN_6", "Code-Highlight CSS class.");

View File

@@ -10,5 +10,6 @@
<pref name="paste_as_text">0</pref>
<pref name="browser_spellcheck">1</pref>
<pref name="visualblocks">1</pref>
<pref name="code_highlight_class">prettyprint linenums</pref>
</pluginPrefs>
</e107Plugin>

View File

@@ -503,6 +503,8 @@ class wysiwyg
//@see http://www.tinymce.com/wiki.php/Configuration:formats
$codeHighlightClass = varset($tPref['code_highlight_class'], 'prettyprint linenums');
$formats = "[
{title: 'Headers', items: [
{title: 'Heading 1', block: 'h1'},
@@ -530,7 +532,7 @@ class wysiwyg
{title: 'Blockquote alt.', block: 'blockquote', classes: 'blockquote-alt blockquote__alternative'},
{title: 'Div', block: 'div'},
{title: 'Pre', block: 'pre'},
{title: 'Code Highlighted', block: 'pre', classes: 'prettyprint linenums' }
{title: 'Code Highlighted', block: 'pre', classes: '".$codeHighlightClass."' }
]},
{title: 'Lists', items: [