mirror of
https://github.com/e107inc/e107.git
synced 2025-08-11 09:04:38 +02:00
choose wysiwyg editor
Now it is possible to have TinyMCE in the backend and SimpleMDE on the forum pages. wysiwyg() got a new parameter $returnEditor to return the name of the editor. wysiwyg() now checks if the choosen editor is installed. wysiwyg() setting a value is not systemwide anymore (static var instead of registry) Use the bbarea() $options array to define the editor to use e.g. $options['wysiwyg'] = 'tinymce4'; Updated forum_admin.php to support SimpleMDE. Updated tinymce4/e_footer.php to support the new return value (editor name)
This commit is contained in:
@@ -232,12 +232,11 @@ if(!deftrue('OLD_FORUMADMIN'))
|
||||
$this->prefs['editor']['writeParms']['optArray']['default'] = 'System default'; //todo LAN
|
||||
$this->prefs['editor']['writeParms']['optArray']['bbcode'] = 'BBCode';
|
||||
|
||||
//@ global pref should override plugins due to security considerations and allowance of posting html.
|
||||
/*
|
||||
if (e107::isInstalled('tinymce4'))
|
||||
$editors = e107::getPlug()->getInstalledWysiwygEditors();
|
||||
if (!empty($editors))
|
||||
{
|
||||
$this->prefs['editor']['writeParms']['optArray']['tinymce4'] = 'TinyMCE';
|
||||
}*/
|
||||
$this->prefs['editor']['writeParms']['optArray'] = array_merge($this->prefs['editor']['writeParms']['optArray'], $editors);
|
||||
}
|
||||
|
||||
$this->prefs['quickreply']['writeParms']['optArray'] = array(
|
||||
'default' => 'Textarea', //todo LAN
|
||||
|
@@ -179,7 +179,8 @@ class plugin_forum_post_shortcodes extends e_shortcode
|
||||
|
||||
$editor = $this->forum->prefs->get('editor');
|
||||
|
||||
$wysiwyg = ($editor === 'bbcode') ? false : null;
|
||||
//$wysiwyg = ($editor === 'bbcode') ? false : null;
|
||||
$wysiwyg = is_null($editor) ? 'default' : $editor;
|
||||
|
||||
return e107::getForm()->bbarea('post',$text,'forum','_common','large', array('wysiwyg' => $wysiwyg));
|
||||
|
||||
|
@@ -1214,10 +1214,12 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
$editor = $this->forum->prefs->get('editor');
|
||||
$editor = is_null($editor) ? 'default' : $editor;
|
||||
$text = "
|
||||
<form action='" . $url . "' method='post'>
|
||||
<div class='form-group'>" .
|
||||
e107::getForm()->bbarea('post','','forum', '_common', 'small', array('id' => 'forum-quickreply-text')) .
|
||||
e107::getForm()->bbarea('post','','forum', '_common', 'small', array('id' => 'forum-quickreply-text', 'wysiwyg' => $editor)) .
|
||||
"</div>
|
||||
<div class='center text-center form-group'>
|
||||
<input type='submit' data-token='" . e_TOKEN . "' data-forum-insert='" . $ajaxInsert . "' data-forum-post='" . $this->var['thread_forum_id'] . "' data-forum-thread='" . $this->var['thread_id'] . "' data-forum-action='quickreply' name='reply' value='" . LAN_FORUM_2006 . "' class='btn btn-success button' />
|
||||
|
@@ -13,7 +13,7 @@ if (!defined('e107_INIT')) { exit; }
|
||||
$pref = e107::getPref();
|
||||
|
||||
|
||||
if((e107::wysiwyg() === true && check_class($pref['post_html'])) || strpos(e_SELF,"tinymce4/admin_config.php") )
|
||||
if((e107::wysiwyg(null, true) === 'tinymce4' && check_class($pref['post_html'])) || strpos(e_SELF,"tinymce4/admin_config.php") )
|
||||
{
|
||||
if(e_PAGE != 'image.php')
|
||||
{
|
||||
|
@@ -3,6 +3,11 @@
|
||||
<author name="e107 Inc." url="http://e107.org" />
|
||||
<description>TinyMce4 CDN version</description>
|
||||
<category>misc</category>
|
||||
<keywords>
|
||||
<word>default</word>
|
||||
<word>editor</word>
|
||||
<word>wysiwyg</word>
|
||||
</keywords>
|
||||
<adminLinks>
|
||||
<link url='admin_config.php' description='Configure' icon='images/icon_32.png' iconSmall='images/icon_16.png' primary='true' >Configure</link>
|
||||
</adminLinks>
|
||||
|
Reference in New Issue
Block a user