From c1bec2b6d75445354028a858f98f0c51f5c69a41 Mon Sep 17 00:00:00 2001 From: Achim Ennenbach Date: Fri, 10 Aug 2018 11:49:58 +0200 Subject: [PATCH] fixes #3317 moved the forum template from core to plugin --- e107_core/templates/bbcode_template.php | 8 -------- e107_handlers/bbcode_handler.php | 16 ++++++++++++++-- .../forum/templates/bbcode_template.php | 19 +++++++++++++++++++ 3 files changed, 33 insertions(+), 10 deletions(-) create mode 100644 e107_plugins/forum/templates/bbcode_template.php diff --git a/e107_core/templates/bbcode_template.php b/e107_core/templates/bbcode_template.php index 16cf357d2e..d1e7666a74 100644 --- a/e107_core/templates/bbcode_template.php +++ b/e107_core/templates/bbcode_template.php @@ -50,14 +50,6 @@ "; -$BBCODE_TEMPLATE_FORUM = " -
- {BB=link}{BB=b}{BB=i}{BB=u}{BB=img}{BB=format}{BB=left}{BB=center}{BB=right}{BB=justify} - {BB=list}{BB=fontcol}{BB=fontsize}{BB=emotes}{BB=youtube} -
-"; - - // -------- Admin Templates ---------------------- $BBCODE_TEMPLATE_ADMIN = " diff --git a/e107_handlers/bbcode_handler.php b/e107_handlers/bbcode_handler.php index 77d7096f9b..033f4b3910 100644 --- a/e107_handlers/bbcode_handler.php +++ b/e107_handlers/bbcode_handler.php @@ -547,7 +547,6 @@ function renderButtons($template='', $id='', $options=array()) $BBCODE_TEMPLATE_ADMIN = ''; $BBCODE_TEMPLATE_COMMENT = ''; $BBCODE_TEMPLATE_SIGNATURE = ''; - $BBCODE_TEMPLATE_FORUM = ''; require(e107::coreTemplatePath('bbcode')); //correct way to load a core template. @@ -575,7 +574,20 @@ function renderButtons($template='', $id='', $options=array()) $temp['maintenance']= $BBCODE_TEMPLATE_ADMIN; $temp['comment'] = $BBCODE_TEMPLATE_COMMENT; $temp['signature'] = $BBCODE_TEMPLATE_SIGNATURE; - $temp['forum'] = $BBCODE_TEMPLATE_FORUM; + + if(!isset($temp[$template])) + { + // if template not yet defined, assume that $template is the name of a plugin + // and load the specific bbcode template from the plugin + // see forum plugin "templates/bbcode_template.php" for an example of the definition + $tpl = e107::getTemplate($template, 'bbcode', $template); + if (!empty($tpl)) + { + // If the plugin has a template defined for bbcode, add it to the list + $temp[$template] = $tpl; + } + unset($tpl); + } if(isset($temp[$template])) { diff --git a/e107_plugins/forum/templates/bbcode_template.php b/e107_plugins/forum/templates/bbcode_template.php new file mode 100644 index 0000000000..53f9b2ac9e --- /dev/null +++ b/e107_plugins/forum/templates/bbcode_template.php @@ -0,0 +1,19 @@ + + {BB=link}{BB=b}{BB=i}{BB=u}{BB=img}{BB=format}{BB=left}{BB=center}{BB=right}{BB=justify} + {BB=list}{BB=fontcol}{BB=fontsize}{BB=emotes}{BB=youtube} +
+";