From 5139a7d390947fbfad3543f78f70049951aed81c Mon Sep 17 00:00:00 2001
From: CaMer0n
Date: Mon, 28 May 2012 13:06:09 +0000
Subject: [PATCH] More fixes and enhancements - bbcodes, tinymce, js
---
e107_admin/header.php | 2 +
e107_admin/image.php | 13 +-
e107_admin/newspost.php | 137 +-
.../shortcodes/batch/bbcode_shortcodes.php | 258 +-
e107_files/jslib/core/admin.jquery.js | 477 +-
e107_files/jslib/core/all.jquery.css | 9 +-
e107_files/jslib/core/all.jquery.js | 95 +-
e107_files/jslib/core/mediaManager.js | 22 +-
e107_handlers/form_handler.php | 39 +-
e107_handlers/media_class.php | 5 +-
e107_handlers/ren_help.php | 29 +-
e107_images/bbcode/blockquote.png | Bin 484 -> 2986 bytes
e107_images/bbcode/bold.png | Bin 498 -> 2856 bytes
e107_images/bbcode/center.png | Bin 399 -> 2850 bytes
e107_images/bbcode/emotes.png | Bin 4100 -> 280 bytes
e107_images/bbcode/flash.png | Bin 558 -> 3723 bytes
e107_images/bbcode/fontcol.png | Bin 935 -> 3152 bytes
e107_images/bbcode/fontsize.png | Bin 869 -> 3719 bytes
e107_images/bbcode/image.png | Bin 454 -> 3094 bytes
e107_images/bbcode/italic.png | Bin 415 -> 2888 bytes
e107_images/bbcode/left.png | Bin 382 -> 2844 bytes
e107_images/bbcode/link.png | Bin 671 -> 3168 bytes
e107_images/bbcode/list.png | Bin 407 -> 2952 bytes
e107_images/bbcode/newpage.png | Bin 1018 -> 3012 bytes
e107_images/bbcode/prefile.png | Bin 790 -> 3794 bytes
e107_images/bbcode/preimage.png | Bin 790 -> 3806 bytes
e107_images/bbcode/right.png | Bin 389 -> 2850 bytes
e107_images/bbcode/underline.png | Bin 413 -> 2875 bytes
e107_images/bbcode/youtube.png | Bin 1323 -> 3716 bytes
e107_plugins/tinymce/e_meta.php | 67 +-
e107_plugins/tinymce/langs/en.js | 2 +-
.../tinymce/plugins/advlink/js/advlink.js | 4 +-
.../plugins/e107bbcode/editor_plugin.js | 9 +-
.../plugins/fullscreen/editor_plugin.js | 2 +-
.../plugins/fullscreen/editor_plugin_src.js | 2 +-
.../plugins/noneditable/editor_plugin.js | 2 +-
.../plugins/noneditable/editor_plugin_src.js | 567 +-
.../tinymce/plugins/paste/editor_plugin.js | 2 +-
.../plugins/paste/editor_plugin_src.js | 2 +-
.../plugins/searchreplace/searchreplace.htm | 2 +-
.../plugins/spellchecker/editor_plugin.js | 2 +-
.../plugins/spellchecker/editor_plugin_src.js | 8 +-
.../tinymce/plugins/style/css/props.css | 1 +
.../tinymce/plugins/style/editor_plugin.js | 2 +-
.../plugins/style/editor_plugin_src.js | 22 +-
.../tinymce/plugins/style/js/props.js | 65 +-
.../tinymce/plugins/style/langs/en_dlg.js | 2 +-
e107_plugins/tinymce/plugins/style/props.htm | 5 +
.../tinymce/plugins/tabfocus/editor_plugin.js | 2 +-
.../plugins/tabfocus/editor_plugin_src.js | 2 +-
.../tinymce/plugins/table/editor_plugin.js | 2 +-
.../plugins/table/editor_plugin_src.js | 4 +-
e107_plugins/tinymce/plugins/table/js/cell.js | 4 +-
.../tinymce/plugins/table/js/table.js | 7 +-
.../tinymce/themes/advanced/color_picker.htm | 8 +-
.../themes/advanced/editor_template.js | 2 +-
.../themes/advanced/editor_template_src.js | 181 +-
.../tinymce/themes/advanced/img/icons.gif | Bin 11790 -> 11982 bytes
.../tinymce/themes/advanced/js/anchor.js | 23 +-
.../themes/advanced/js/color_picker.js | 674 +-
.../tinymce/themes/advanced/js/image.js | 6 +-
.../themes/advanced/js/source_editor.js | 32 +-
.../tinymce/themes/advanced/langs/en_dlg.js | 2 +-
.../themes/advanced/skins/default/content.css | 1 +
.../themes/advanced/skins/default/dialog.css | 5 +-
.../themes/advanced/skins/default/ui.css | 7 +-
.../themes/advanced/skins/o2k7/content.css | 1 +
.../themes/advanced/skins/o2k7/dialog.css | 5 +-
.../tinymce/themes/advanced/skins/o2k7/ui.css | 7 +-
e107_plugins/tinymce/tiny_mce.js | 2 +-
e107_plugins/tinymce/tiny_mce_popup.js | 2 +-
e107_plugins/tinymce/tiny_mce_src.js | 8637 +++++++++--------
e107_plugins/tinymce/wysiwyg.php | 25 +-
e107_themes/_blank/admin_theme.php | 24 -
e107_themes/templates/bbcode_template.php | 24 +-
75 files changed, 6196 insertions(+), 5347 deletions(-)
diff --git a/e107_admin/header.php b/e107_admin/header.php
index 0768e3d82..338405ce1 100644
--- a/e107_admin/header.php
+++ b/e107_admin/header.php
@@ -46,6 +46,8 @@ e107::js("core", "plupload/customUpload.js","jquery",3);
e107::js("core", "core/mediaManager.js","jquery",3);
+e107::js("core", "tooltip/jquery.qtip-1.0.0-rc3.min.js","jquery",3);
+
e107::css('core', 'core/admin.jquery.css', 'jquery');
e107::css('core', 'core/all.jquery.css', 'jquery');
diff --git a/e107_admin/image.php b/e107_admin/image.php
index def8d6868..65c505bb1 100644
--- a/e107_admin/image.php
+++ b/e107_admin/image.php
@@ -209,8 +209,10 @@ class media_form_ui extends e_admin_form_ui
$tagid = $_GET['tagid'];
$path = $this->getController()->getListModel()->get('media_url');
$preview = basename($path);
+
+ $bbcode = ($_GET['bbcode']==1) ? "file" : "";
- return "";
+ return "";
}
@@ -380,9 +382,12 @@ class media_admin_ui extends e_admin_ui
if($this->getQuery('iframe'))
{
+
+
+
if($this->getQuery('bbcode'))
{
- e107::getJs()->headerFile(e_PLUGIN_ABS.'tinymce/tiny_mce_popup.js',2);
+
e107::getJS()->headerInline("
/* Send the generated IMG bbcode back to the textarea/window */
@@ -591,8 +596,8 @@ class media_admin_ui extends e_admin_ui
$text .= "
-
+
+ ";
+
+ return $text;
+ }
+
+
+
+
+
+ // shouldn't be needed when js css selectors are enabled.
+ function getEvent($func,$func_var,$hint_diz,$emote = '')
+ {
+ if($emote)
+ {
+ $emote = ",".$emote;
+ }
+ $text = "onclick=\"{$func}('".$func_var."'{$emote})\" ";
+ $bbcode_help = $this->var['hint_func'];
+ $bbcode_tag = $this->var['tagid'];
+ $_helptxt = $hint_diz;
+ // onclick="addtext('[justify][/justify]')" onmouseout="help('','admin')" onmouseover="help('Justify align: [justify]This text will be justified[/justify]','admin')">
+ $text .= ($this->var['hint_active'] ? "onmouseout=\"{$bbcode_help}('','{$bbcode_tag}')\" onmouseover=\"{$bbcode_help}('".$_helptxt."','{$bbcode_tag}')\"" : "" );
+ return $text;
+ }
+
+
+
+
+
function sc_bb($parm)
{
+ if(method_exists($this,"bb_".$parm)) // start of the big cleanup.
+ {
+ $meth = "bb_".$parm;
+ $mes = e107::getMessage();
+ $mes->debug("Loaded BB: ".$parm);
+ $unique = $this->var['template']."--".$parm; // works in conjunction with media-manager category
+ return "\n\n\n".$this->$meth($unique);
+ }
+
+
//FIXME - cachevars/getcachedvars!
global $pref, $eplug_bb, $bbcode_func, $bbcode_help, $bbcode_filedir, $bbcode_imagedir, $bbcode_helpactive, $bbcode_helptag, $register_bb;
@@ -71,13 +306,14 @@ class bbcode_shortcodes
$bbcode['flash'] = array($bbcode_func,"[flash=width,height][/flash]", LANHELP_47,"flash.png");
$bbcode['youtube'] = array($bbcode_func,"[youtube][/youtube]", LANHELP_48,"youtube.png");
$bbcode['sanitised'] = array('', '', '');
+ $bbcode['format'] = array('dropdown', '[format]', 'da',"");
$bbcode['nobr'] = array($bbcode_func,"[nobr][/nobr]", LANHELP_51, "nobr.png"); // FIXME bbcode icon
$bbcode['br'] = array($bbcode_func,"[br]", LANHELP_52, "br.png"); // FIXME bbcode icon
$bbcode['block'] = array($bbcode_func,"[block][/block]", LANHELP_54,"block.png"); // FIXME bbcode icon, interactive interface, theme hooks
$bbcode['fontsize'] = array("expandit","size_selector_".$rand, LANHELP_22,"fontsize.png","Size_Select",'size_selector_'.$rand);
- $bbcode['fontcol'] = array("expandit","col_selector_".$rand, LANHELP_21,"fontcol.png","Color_Select",'col_selector_'.$rand);
+ $bbcode['fontcol'] = array("e-expandit","col_selector_".$rand, LANHELP_21,"fontcol.png","Color_Select",'col_selector_'.$rand);
$bbcode['preimage'] = array("e-dialog","preimage_selector_".$rand, LANHELP_45.$imagedir_display,"preimage.png","PreImage_Select","preimage_selector_".$rand);
$bbcode['prefile'] = array("expandit","prefile_selector_".$rand, LANHELP_39,"prefile.png","PreFile_Select",'prefile_selector_'.$rand);
@@ -125,11 +361,12 @@ class bbcode_shortcodes
$_function_var = (isset($bbcode[$parm][5])) ? $bbcode[$parm][5] : '';
if($_onclick_func == 'e-dialog')
- { $tagid = "news-body";
+ { // $tagid = "news-body";
$pre = "\n";
$post = "\n";
}
+
if($bbcode[$parm]) // default - insert text.
@@ -138,6 +375,8 @@ class bbcode_shortcodes
$text .= "
";
$text .= $post;
}
+
+
if($_function)
{
@@ -152,15 +391,20 @@ class bbcode_shortcodes
function sc_bb_help($parm)
{
- // if(defsettrue('e_WYSIWYG')) { return; }
+ /*
global $bbcode_helpactive,$bbcode_helptag, $bbcode_helpsize;
if($parm) $bbcode_helptag = $parm;
elseif(!varset($bbcode_helptag)) $bbcode_helptag = 'helpb';
if($bbcode_helpsize) $bbcode_helpsize = ' '.$bbcode_helpsize;
$bbcode_helpactive = TRUE;
-
+ */
//FIXME - better bb help
- return "";
+
+ $bbcode_helptag = ($this->var['tagid']) ? $this->var['tagid'] : 'data_';
+ $bbcode_helpsize = $this->var['size'];
+ $bbcode_helpactive = $this->var['hint_active'];
+
+ return "";
}
function sc_bb_preimagedir($parm)
diff --git a/e107_files/jslib/core/admin.jquery.js b/e107_files/jslib/core/admin.jquery.js
index d7ddeda4c..6165204d1 100644
--- a/e107_files/jslib/core/admin.jquery.js
+++ b/e107_files/jslib/core/admin.jquery.js
@@ -1,135 +1,39 @@
$(document).ready(function()
{
- $(".e-hideme").hide();
- $(".e-expandit").show();
-
- $(".e-expandit").click(function () {
- var id = $(this).attr("href");
- $(id).toggle("slow");
- });
-
- // Date
- $(function() {
-
- $("input.e-date").each(function() {
- $(this).datepicker({
- dateFormat: $(this).attr("data-date-format"),
- ampm: $(this).attr("data-date-ampm")
- });
- });
-
- $("input.e-datetime").each(function() {
- $(this).datetimepicker({
- dateFormat: $(this).attr("data-date-format"),
- timeFormat: $(this).attr("data-time-format"),
- ampm: $(this).attr("data-date-ampm")
- });
- });
-
- // Inline versions
- $("div.e-date").each(function() {
- var id = $(this).attr("id");
- var newid = id.replace("inline-", "");
- $(this).datepicker({
- dateFormat: $(this).attr("data-date-format"),
- ampm: $(this).attr("data-date-ampm"),
- defaultDate: $("#"+newid).val(),
- onSelect: function(dateText, inst) {
- $("#"+newid).val(dateText);
- }
-
- });
- });
-
- $("div.e-datetime").each(function() {
- var id = $(this).attr("id");
- var newid = id.replace("inline-", "");
- $(this).datetimepicker({
- dateFormat: $(this).attr("data-date-format"),
- ampm: $(this).attr("data-date-ampm"),
- showButtonPanel: false,
- onSelect: function(dateText, inst) {
- $("#"+newid).val(dateText);
- }
- });
- $(this).datetimepicker('setDate', $("#"+newid).val());
- });
-
-
-
-
-
-
- });
+ /*
+ $(".field-help").each(function(c) {
- // Tabs
- $(function() {
- $( "#tab-container" ).tabs();
- });
+ $(this).before("
");
+ $(this).hide();
+ $(".field-tip-"+c).qtip({
+ content: $(this).html(),
+ show: 'mouseover',
+ hide: 'mouseout',
+ style: {
+ name: 'dark', // Inherit from preset style
+ border: { width: 1, radius: 5 },
+ tip: 'topLeft'
+ }
+ })
- // Tabs
- $(function() {
- $( ".e-tabs" ).tabs();
- });
+ });
+ */
+
+
$(".e-multiselect").chosen();
- // Password
- $(function() {
-
- $("#password1").pwdMeter({
- minLength: 6,
- displayGeneratePassword: true,
- generatePassText: "Generate",
- randomPassLength: 12
- });
-
- });
-
+
// Decorate
$(".adminlist tr:even").addClass("even");
$(".adminlist tr:odd").addClass("odd");
$(".adminlist tr:first").addClass("first");
$(".adminlist tr:last").addClass("last");
- // Character Counter
- $("textarea").before("
");
- $("textarea").keyup(function(){
-
- // var max=$(this).attr("maxlength");
- var max = 100;
- var el = "#" + $(this).attr("name") + "-remainingCharacters";
- var valLen=$(this).val().length;
- $(el).text( valLen + " characters")
- });
-
- // Dialog
- $("a.e-dialog").colorbox({
- iframe:true,
- width:"60%",
- height:"70%",
- speed:100
- });
-
- $(".e-dialog-close").click(function () {
- parent.$.colorbox.close()
- });
-
-
- // Modal Box - uses inline hidden content
- $(".e-modal").click(function () {
- var id = $(this).attr("href");
- $(id).dialog({
- minWidth: 800,
- maxHeight: 700,
- modal: true
- });
- });
-
// Modal Box - uses inline hidden content // NEEDS work - see customize link for admin-infopanel.
$(".e-modal-iframe").click(function (e) {
@@ -509,348 +413,5 @@ $(document).ready(function()
})
-// Legacy Stuff to be converted.
-
-// BC Expandit() function
-
- function expandit(e) {
-
- var href = $(e).attr("href");
-
- if(href === "#" || href == "")
- {
- idt = $(e).next("div");
- $(idt).toggle("slow");
- return false;;
- }
-
- var id = "#" + e;
- $(id).toggle("slow");
- return false;
- };
-
-
- var addinput = function(text) {
-
- // quick fix to prevent JS errors - proper match was done only for latin words
- var rep = text.match(/\=([^\]]*)\]/);
- var val = rep ? prompt(rep[1]) : prompt('http://');
-
- if(!val)
- {
- return;
- }
- var newtext = text.replace(rep[1], val);
- emote = '';
- addtext(newtext, emote);
- return;
- }
-
-
-
-
- function SyncWithServerTime(serverTime,domain)
- {
- if (serverTime)
- {
- /* update time difference cookie */
- var serverDelta=Math.floor(localTime-serverTime);
-
- document.cookie = 'e107_tdOffset='+serverDelta+'; path=/; domain= .'+domain;
- document.cookie = 'e107_tdSetTime='+(localTime-serverDelta)+'; path=/; domain=.'+domain; /* server time when set */
- }
-
- var tzCookie = 'e107_tzOffset=';
- // if (document.cookie.indexOf(tzCookie) < 0) {
- /* set if not already set */
- var timezoneOffset = nowLocal.getTimezoneOffset(); /* client-to-GMT in minutes */
- document.cookie = tzCookie + timezoneOffset+'; path=/; domain=.'+domain;
- // }
- }
-
-
- function urljump(url){
- top.window.location = url;
- }
-
- function setInner(id, txt) {
- document.getElementById(id).innerHTML = txt;
- }
-
- function jsconfirm(thetext){
- return confirm(thetext);
- }
-
- function insertext(str,tagid,display){
- document.getElementById(tagid).value = str;
- if(display){
- document.getElementById(display).style.display='none';
- }
- }
-
- function appendtext(str,tagid,display){
- document.getElementById(tagid).value += str;
- document.getElementById(tagid).focus();
- if(display){
- document.getElementById(display).style.display='none';
- }
- }
-
- function open_window(url,wth,hgt) {
- if('full' == wth){
- pwindow = window.open(url);
- } else {
- if (wth) {
- mywidth=wth;
- } else {
- mywidth=600;
- }
-
- if (hgt) {
- myheight=hgt;
- } else {
- myheight=400;
- }
-
- pwindow = window.open(url,'Name', 'top=100,left=100,resizable=yes,width='+mywidth+',height='+myheight+',scrollbars=yes,menubar=yes');
- }
- pwindow.focus();
- }
-
- function ejs_preload(ejs_path, ejs_imageString){
- var ejs_imageArray = ejs_imageString.split(',');
- for(ejs_loadall=0; ejs_loadall
");
+ // $("textarea").before("
");
$("textarea").keyup(function(){
// var max=$(this).attr("maxlength");
@@ -154,7 +220,7 @@ $(document).ready(function()
// targetType : 'number',
targetText : $('#e-rate-'+tmp).text(),
// cancel : true,
- css : 'e-rate-star',
+ // css : 'e-rate-star',
click: function(score, evt) {
$(this).find('img').unbind('click');
$(this).find('img').unbind();
@@ -177,12 +243,18 @@ $(document).ready(function()
});
});
-
+ // $( ".field-help" ).tooltip();
+ // Allow Tabs to be used inside textareas.
+ $( 'textarea' ).keypress( function( e ) {
+ if ( e.keyCode == 9 ) {
+ e.preventDefault();
+ $( this ).val( $( this ).val() + '\t' );
+ }
+ });
-
- // Text-area AutoGrow
- // $("textarea.e-autoheight").elastic();
+ // Text-area AutoGrow
+ $("textarea.e-autoheight").elastic();
@@ -215,17 +287,18 @@ $(document).ready(function()
};
- var addinput = function(text) {
+ var addinput = function(text,rep) {
// quick fix to prevent JS errors - proper match was done only for latin words
- var rep = text.match(/\=([^\]]*)\]/);
- var val = rep ? prompt(rep[1]) : prompt('http://');
+ // var rep = text.match(/\=([^\]]*)\]/);
+ // var rep = '';
+ var val = rep ? prompt(rep) : prompt('http://');
if(!val)
{
return;
}
- var newtext = text.replace(rep[1], val);
+ var newtext = text.replace('*', val);
emote = '';
addtext(newtext, emote);
return;
@@ -397,7 +470,7 @@ function mozSwap(txtarea, newtext){
/**
* New improved version - fixed scroll to top behaviour when inserting BBcodes
- * @TODO - improve it more (0.8) - Prototype
+ * @TODO - improve it more (0.8)
*/
function addtext(text, emote) {
diff --git a/e107_files/jslib/core/mediaManager.js b/e107_files/jslib/core/mediaManager.js
index f065feb47..0e3e1a569 100644
--- a/e107_files/jslib/core/mediaManager.js
+++ b/e107_files/jslib/core/mediaManager.js
@@ -3,13 +3,17 @@ $(document).ready(function()
$(".e-dialog-save").click(function () { // FIXME TODO missing caret , text selection overwrite etc.
+ //alert('hello');
var newval = $('#bbcode_holder').val();
+ // alert(newval);
var target = $(this).attr('data-target');
- ('#' + target, window.top.document).insertAtCaret(newVal);
+ //('#' + target, window.top.document).insertAtCaret(newVal);
// $('#' + target, window.parent.document).append(newval); //FIXME caret!!
// var t = $('#' + target, window.parent.document).text();
- // addtext(newval);
+
+ $('#' + target, window.top.document).attr('value',newval); // set new value
+ // inserttext(newval,target);
// alert(newval);
});
@@ -106,11 +110,21 @@ $(document).ready(function()
var path = $(this).attr('data-path');
var preview = $(this).attr('data-preview');
var src = $(this).attr('data-src');
+ var bbcode = $(this).attr('data-bbcode');
$(this).addClass("media-select-active");
$(this).closest("img").addClass("active");
-
- $('#' + target, window.top.document).attr('value',path); // set new value
+
+ // TinyMce?
+ $('input#' + target, window.top.document).attr('value',path); // set new value
+
+ if(bbcode)
+ {
+ bbpath = '['+bbcode+']'+ path + '[/' + bbcode + ']';
+ $('textarea#' + target, window.top.document).attr('value',bbpath);
+ }
+
+
$('img#' + target + "_prev", window.top.document).attr('src',preview); // set new value
$('div#' + target + "_prev", window.top.document).html(preview); // set new value
$('span#' + target + "_prev", window.top.document).html(preview); // set new value
diff --git a/e107_handlers/form_handler.php b/e107_handlers/form_handler.php
index 80007739c..7235036f4 100644
--- a/e107_handlers/form_handler.php
+++ b/e107_handlers/form_handler.php
@@ -629,33 +629,36 @@ class e_form
// auto-height support
$options = array('class' => 'tbox bbarea '.($size ? ' '.$size : '').' e-wysiwyg');
$bbbar = '';
+
// FIXME - see ren_help.php
- // if(!deftrue('e_WYSIWYG'))
- {
- require_once(e_HANDLER."ren_help.php");
- $options['other'] = "onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'";
- $bbbar = display_help($help_tagid, $help_mod, 'addtext', 'help', $size);
- }
+
+ require_once(e_HANDLER."ren_help.php");
+ $help_tagid = $this->name2id($name)."--preview"; // required as it needs to have some matching name with textarea.
+ $options['other'] = "onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'";
+ $bbbar = display_help($help_tagid, $help_mod, 'addtext', 'help', $size);
- $toggleID = "bbcode-panel-".$help_tagid;
- $tinyMceID = str_replace("_","-",$name);
$ret = "
- ".$this->textarea($name, $value, $rows, 50, $options, $counter)."
-
-
+
{$bbbar}
+ ".$this->textarea($name, $value, $rows, 50, $options, $counter)."
+
+
";
+
// Quick fix - hide TinyMCE links if not installed, dups are handled by JS handler
- e107::getJs()->footerInline("
- if(typeof tinyMCE === 'undefined')
- {
- \$$('a.e-wysiwyg-switch').invoke('hide');
- }
- ");
-
+ /*
+
+ e107::getJs()->footerInline("
+ if(typeof tinyMCE === 'undefined')
+ {
+ \$$('a.e-wysiwyg-switch').invoke('hide');
+ }
+ ");
+ */
+
return $ret;
}
diff --git a/e107_handlers/media_class.php b/e107_handlers/media_class.php
index 83261172f..7e18ab17e 100644
--- a/e107_handlers/media_class.php
+++ b/e107_handlers/media_class.php
@@ -508,14 +508,17 @@ class e_media
document.getElementById('preview').src = '{$realPath}';
return false;";
+ $onclicki = "";
$class .= " e-media-select";
$onclicki = "";
}
+
+ $data_bb = ($bbcode) ? "img" : "";
$img_url = ($cat !='_icon') ? e107::getParser()->thumbUrl($im['media_url'], $att) : $media_path;
- $text .= "";
+ $text .= "";
$text .= "
";
$text .= "\n\n";
}
diff --git a/e107_handlers/ren_help.php b/e107_handlers/ren_help.php
index 0f32858ed..cc19883b0 100644
--- a/e107_handlers/ren_help.php
+++ b/e107_handlers/ren_help.php
@@ -37,6 +37,9 @@ function display_help($tagid="helpb", $mode = 1, $addtextfunc = "addtext", $help
$bbcode_func = $addtextfunc;
$bbcode_help = $helpfunc;
$bbcode_helptag = $tagid;
+
+ // $arr = get_defined_vars();
+ // print_a($arr);
// load the template
if(is_readable(THEME."bbcode_template.php"))
@@ -84,8 +87,26 @@ function display_help($tagid="helpb", $mode = 1, $addtextfunc = "addtext", $help
if(is_readable(e_CORE."shortcodes/batch/bbcode_shortcodes.php"))
{
- require_once(e_CORE."shortcodes/batch/bbcode_shortcodes.php");
- return "".$tp->parseTemplate($BBCODE_TEMPLATE)."
";
+
+ $sc = e107::getScBatch('bbcode');
+
+ if($tagid == 'data') // BC fix.
+ {
+ $tagid = 'data_';
+ }
+
+ $data = array(
+ 'tagid' => $tagid,
+ 'template' => $mode,
+ 'trigger' => $addtextfunc,
+ 'hint_func' => $helpfunc,
+ 'hint_active' => $bbcode_helpactive,
+ 'size' => $helpsize
+ );
+
+ $sc->setParserVars($data);
+
+ return "".$tp->parseTemplate($BBCODE_TEMPLATE)."
";
}
else
{
@@ -118,8 +139,8 @@ function Size_Select($formid='size_selector') {
function Color_Select($formid='col_selector') {
$text = "
-