diff --git a/e107_plugins/tinymce4/admin_config.php b/e107_plugins/tinymce4/admin_config.php index 2114108c0..aea7d13de 100644 --- a/e107_plugins/tinymce4/admin_config.php +++ b/e107_plugins/tinymce4/admin_config.php @@ -55,9 +55,12 @@ if( !e107::isInstalled('tinymce4')) + protected $prefs = array( 'paste_as_text' => array('title'=> 'Paste as text by default', 'type'=>'boolean', 'data' => 'int','help'=> ''), 'browser_spellcheck' => array('title'=> 'Browser spellcheck', 'type'=>'boolean', 'data' => 'int','help'=> 'Enable this if the browser internal spellchecker should be used.'), + 'visualblocks' => array('title'=> 'Visual Blocks', 'type'=>'boolean', 'data' => 'int','help'=> 'Enable to make html blocks visible during editing.'), + ); diff --git a/e107_plugins/tinymce4/wysiwyg.php b/e107_plugins/tinymce4/wysiwyg.php index bdd500794..f3a1688fa 100644 --- a/e107_plugins/tinymce4/wysiwyg.php +++ b/e107_plugins/tinymce4/wysiwyg.php @@ -351,6 +351,16 @@ class wysiwyg $ret['browser_spellcheck'] = true; } + if(!empty($tPref['visualblocks'])) + { + $ret['visualblocks_default_state'] = true; + } + + + // plugins: "visualblocks", + + + $formats = array( 'hilitecolor' => array('inline'=> 'span', 'classes'=> 'hilitecolor', 'styles'=> array('backgroundColor'=> '%value')) // block : 'h1', attributes : {title : "Header"}, styles : {color : red} @@ -751,6 +761,8 @@ class wysiwyg $plug_array = explode(",",$plugs); + $tinymce_plugins = array(); + foreach($plug_array as $val) { if(in_array($val,$admin_only) && !ADMIN) @@ -766,6 +778,14 @@ class wysiwyg $tinymce_plugins[] = $val; } + + $tPref = e107::pref('tinymce4'); + + if(!empty($tPref['visualblocks'])) + { + $tinymce_plugins[] = 'visualblocks'; + } + return $tinymce_plugins; }