mirror of
https://github.com/e107inc/e107.git
synced 2025-07-26 01:11:28 +02:00
TinyMce4: Visual Blocks preference added. (very helpful for bootstrap grid)
This commit is contained in:
@@ -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.'),
|
||||
|
||||
);
|
||||
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user