mirror of
https://github.com/e107inc/e107.git
synced 2025-07-31 20:00:37 +02:00
TinyMce code-highlighting class preference
This commit is contained in:
@@ -56,9 +56,10 @@ e107::lan('tinymce4','admin', 'true');
|
|||||||
|
|
||||||
|
|
||||||
protected $prefs = array(
|
protected $prefs = array(
|
||||||
'paste_as_text' => array('title'=> TMCEALAN_1, 'type'=>'boolean', 'data' => 'int','help'=> ''),
|
'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),
|
'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),
|
'visualblocks' => array('title'=> TMCEALAN_4, 'type'=>'boolean', 'data' => 'int','help'=> TMCEALAN_5),
|
||||||
|
'code_highlight_class' => array('title'=> TMCEALAN_6, 'type'=>'text', 'data' => 'str','help'=> ''),
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@@ -14,4 +14,5 @@ define("TMCEALAN_2", "Browser spellcheck");
|
|||||||
define("TMCEALAN_3", "Enable this if the browser internal spellchecker should be used.");
|
define("TMCEALAN_3", "Enable this if the browser internal spellchecker should be used.");
|
||||||
define("TMCEALAN_4", "Visual Blocks");
|
define("TMCEALAN_4", "Visual Blocks");
|
||||||
define("TMCEALAN_5", "Enable to make html blocks visible during editing.");
|
define("TMCEALAN_5", "Enable to make html blocks visible during editing.");
|
||||||
?>
|
define("TMCEALAN_6", "Code-Highlight CSS class.");
|
||||||
|
|
||||||
|
@@ -10,5 +10,6 @@
|
|||||||
<pref name="paste_as_text">0</pref>
|
<pref name="paste_as_text">0</pref>
|
||||||
<pref name="browser_spellcheck">1</pref>
|
<pref name="browser_spellcheck">1</pref>
|
||||||
<pref name="visualblocks">1</pref>
|
<pref name="visualblocks">1</pref>
|
||||||
|
<pref name="code_highlight_class">prettyprint linenums</pref>
|
||||||
</pluginPrefs>
|
</pluginPrefs>
|
||||||
</e107Plugin>
|
</e107Plugin>
|
@@ -503,6 +503,8 @@ class wysiwyg
|
|||||||
|
|
||||||
//@see http://www.tinymce.com/wiki.php/Configuration:formats
|
//@see http://www.tinymce.com/wiki.php/Configuration:formats
|
||||||
|
|
||||||
|
$codeHighlightClass = varset($tPref['code_highlight_class'], 'prettyprint linenums');
|
||||||
|
|
||||||
$formats = "[
|
$formats = "[
|
||||||
{title: 'Headers', items: [
|
{title: 'Headers', items: [
|
||||||
{title: 'Heading 1', block: 'h1'},
|
{title: 'Heading 1', block: 'h1'},
|
||||||
@@ -530,7 +532,7 @@ class wysiwyg
|
|||||||
{title: 'Blockquote alt.', block: 'blockquote', classes: 'blockquote-alt blockquote__alternative'},
|
{title: 'Blockquote alt.', block: 'blockquote', classes: 'blockquote-alt blockquote__alternative'},
|
||||||
{title: 'Div', block: 'div'},
|
{title: 'Div', block: 'div'},
|
||||||
{title: 'Pre', block: 'pre'},
|
{title: 'Pre', block: 'pre'},
|
||||||
{title: 'Code Highlighted', block: 'pre', classes: 'prettyprint linenums' }
|
{title: 'Code Highlighted', block: 'pre', classes: '".$codeHighlightClass."' }
|
||||||
]},
|
]},
|
||||||
|
|
||||||
{title: 'Lists', items: [
|
{title: 'Lists', items: [
|
||||||
|
Reference in New Issue
Block a user