diff --git a/e107_admin/update_routines.php b/e107_admin/update_routines.php
index efe33b805..702eb5d54 100644
--- a/e107_admin/update_routines.php
+++ b/e107_admin/update_routines.php
@@ -1274,7 +1274,7 @@ function update_706_to_800($type='')
{
$data = '
-
+
';
file_put_contents(e_SYSTEM."filetypes.xml",$data);
diff --git a/e107_plugins/forum/forum_post.php b/e107_plugins/forum/forum_post.php
index 10e1ad674..6f2d9041f 100644
--- a/e107_plugins/forum/forum_post.php
+++ b/e107_plugins/forum/forum_post.php
@@ -17,7 +17,7 @@ if(!defined('e107_INIT'))
}
-
+define('e_TINYMCE_TEMPLATE', 'public');
define('NAVIGATION_ACTIVE','forum'); // ??
$tp = e107::getParser();
diff --git a/e107_plugins/tinymce4/e_footer.php b/e107_plugins/tinymce4/e_footer.php
index cc53ecab8..a2509fb85 100644
--- a/e107_plugins/tinymce4/e_footer.php
+++ b/e107_plugins/tinymce4/e_footer.php
@@ -22,7 +22,15 @@ if((e107::wysiwyg() === true && check_class($pref['post_html'])) || strpos(e_SEL
e107::js('footer', '//cdn.tinymce.com/4/tinymce.min.js');
// e107::js('footer', "//cdn.tinymce.com/4/tinymce.min.js");
- e107::js('footer',e_PLUGIN.'tinymce4/wysiwyg.php','jquery',5);
+
+ $mceScript = e_PLUGIN.'tinymce4/wysiwyg.php';
+
+ if(defined('e_TINYMCE_TEMPLATE'))
+ {
+ $mceScript .= '?config='.e_TINYMCE_TEMPLATE.'&other=';
+ }
+
+ e107::js('footer',$mceScript,'jquery',5);
// Add to e107_config.php to view hidden content when TinyMce not saving correctly
if(deftrue('e_TINYMCE_DEBUG'))
diff --git a/e107_plugins/tinymce4/templates/public.xml b/e107_plugins/tinymce4/templates/public.xml
new file mode 100644
index 000000000..d2ea060c0
--- /dev/null
+++ b/e107_plugins/tinymce4/templates/public.xml
@@ -0,0 +1,12 @@
+
+
+ advlist autosave lists link charmap print preview hr anchor pagebreak searchreplace wordcount visualchars fullscreen
+ insertdatetime nonbreaking table contextmenu directionality emoticons template paste textcolor
+ edit view insert format table tools
+ undo redo | removeformat | bold italic underline forecolor | alignleft aligncenter alignright alignjustify | bullist numlist | outdent indent | link table smileys | fullscreen
+ e107
+ false
+ 800
+ i[*], bbcode[*]
+ { class: 'table table-striped table-bordered' }
+
diff --git a/e107_plugins/tinymce4/wysiwyg.php b/e107_plugins/tinymce4/wysiwyg.php
index 1ed64bba9..b299de7ee 100644
--- a/e107_plugins/tinymce4/wysiwyg.php
+++ b/e107_plugins/tinymce4/wysiwyg.php
@@ -113,12 +113,15 @@ $output = str_replace("{e_PLUGIN_ABS}", e_PLUGIN_ABS, $text);
$wy = new wysiwyg();
-$gen = $wy->renderConfig();
+
+$config = varset($_GET['config'],false); // e_QUERY;
+
+$gen = $wy->renderConfig($config);
define('USE_GZIP', true);
-if(ADMIN && e_QUERY == 'debug')
+if(ADMIN && e_QUERY == 'debug' || !empty($_GET['debug']))
{
define('e_IFRAME', true);
require_once(HEADERF);
@@ -309,23 +312,37 @@ class wysiwyg
$tp = e107::getParser();
$fl = e107::getFile();
-
- if(getperms('0'))
+ if($config !== false)
{
- $template = "mainadmin.xml";
- }
- elseif(ADMIN)
- {
- $template = "admin.xml";
- }
- elseif(USER)
- {
- $template = "member.xml";
+ $template = $tp->filter($config).".xml";
}
else
{
- $template = "public.xml";
+ if(getperms('0'))
+ {
+ $template = "mainadmin.xml";
+ }
+ elseif(ADMIN)
+ {
+ $template = "admin.xml";
+ }
+ elseif(USER)
+ {
+ $template = "member.xml";
+ }
+ else
+ {
+ $template = "public.xml";
+ }
+
+
}
+
+ if(($template == 'mainadmin.xml' && !getperms('0')) || ($template == 'admin.xml' && !ADMIN))
+ {
+ $template = 'public.xml';
+ }
+
$configPath = (is_readable(THEME."templates/tinymce/".$template)) ? THEME."templates/tinymce/".$template : e_PLUGIN."tinymce4/templates/".$template;
$config = e107::getXml()->loadXMLfile($configPath, true);