Skip to content

Commit

Permalink
fixes e107inc#3317 moved the forum template from core to plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Achim Ennenbach authored and Achim Ennenbach committed Aug 10, 2018
1 parent fe7bb66 commit c1bec2b
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 10 deletions.
8 changes: 0 additions & 8 deletions e107_core/templates/bbcode_template.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,6 @@
";


$BBCODE_TEMPLATE_FORUM = "
<div class='field-spacer'><!-- --></div>
{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}
<div class='field-spacer'><!-- --></div>
";


// -------- Admin Templates ----------------------

$BBCODE_TEMPLATE_ADMIN = "
Expand Down
16 changes: 14 additions & 2 deletions e107_handlers/bbcode_handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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]))
{
Expand Down
19 changes: 19 additions & 0 deletions e107_plugins/forum/templates/bbcode_template.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php
/*
* e107 website system
*
* Copyright (C) 2008-2013 e107 Inc (e107.org)
* Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
*
* BBCODE template - to be used by the bbcode editor
*
*/


$BBCODE_TEMPLATE['forum'] = "
<div class='field-spacer'><!-- --></div>
{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}
<div class='field-spacer'><!-- --></div>
";

0 comments on commit c1bec2b

Please sign in to comment.