mirror of
https://github.com/e107inc/e107.git
synced 2025-08-18 04:12:00 +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' />
|
||||
|
Reference in New Issue
Block a user