1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-06 06:38:00 +02:00

more convrol over bbarea, some code need more attention/rewrite

This commit is contained in:
secretr
2009-09-19 15:21:51 +00:00
parent c475b061bc
commit a0c9a66cae
4 changed files with 75 additions and 61 deletions

View File

@@ -11,9 +11,9 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_files/shortcode/batch/bbcode_shortcodes.php,v $
| $Revision: 1.12 $
| $Date: 2009-07-21 06:31:23 $
| $Author: e107coders $
| $Revision: 1.13 $
| $Date: 2009-09-19 15:21:50 $
| $Author: secretr $
+----------------------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
@@ -133,12 +133,14 @@ class bbcode_shortcodes
function sc_bb_help($parm)
{
if(defsettrue('e_WYSIWYG')) { return; }
global $bbcode_helpactive,$bbcode_helptag;
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 "<input id='{$bbcode_helptag}' class='tbox large helpbox' type='text' name='{$bbcode_helptag}' size='90' readonly='readonly' />";
return "<input id='{$bbcode_helptag}' class='tbox helpbox{$bbcode_helpsize}' type='text' name='{$bbcode_helptag}' size='90' readonly='readonly' />";
}
function sc_bb_preimagedir($parm)

View File

@@ -9,8 +9,8 @@
* Form Handler
*
* $Source: /cvs_backup/e107_0.8/e107_handlers/form_handler.php,v $
* $Revision: 1.42 $
* $Date: 2009-09-14 21:54:16 $
* $Revision: 1.43 $
* $Date: 2009-09-19 15:21:51 $
* $Author: secretr $
*
*/
@@ -159,21 +159,39 @@ class e_form
return "<textarea name='{$name}' rows='{$rows}' cols='{$cols}'".$this->get_attributes($options, $name).">{$value}</textarea>";
}
function bbarea($name, $value, $help_mod = '', $help_tagid='')
function bbarea($name, $value, $help_mod = '', $help_tagid='', $size = 'large')
{
$options = array('class' => 'tbox large e-wysiwyg');
//size - large|medium|small
//width should be explicit set by current admin theme
switch($size)
{
case 'medium':
$rows = '10';
break;
case 'small':
$rows = '7';
break;
case 'large':
default:
$rows = '15';
$size = 'large';
break;
}
$options = array('class' => 'tbox'.($size ? ' '.$size : '').' e-wysiwyg');
$bbbar = '';
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);
$bbbar = display_help($help_tagid, $help_mod, 'addtext', 'help', $size);
}
$ret = "
<div class='bbarea'>
<div class='field-spacer'>
".$this->textarea($name, $value, 15, 50, $options)."
</div>
<div class='bbarea {$size}'>
".$this->textarea($name, $value, $rows, 50, $options)."
<div class='field-spacer'><!-- --></div>
{$bbbar}
</div>
";

View File

@@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_handlers/ren_help.php,v $
| $Revision: 1.9 $
| $Date: 2009-01-15 15:42:24 $
| $Revision: 1.10 $
| $Date: 2009-09-19 15:21:50 $
| $Author: secretr $
+----------------------------------------------------------------------------+
*/
@@ -31,10 +31,11 @@ function ren_help($mode = 1, $addtextfunc = "addtext", $helpfunc = "help")
function display_help($tagid="helpb", $mode = 1, $addtextfunc = "addtext", $helpfunc = "help")
function display_help($tagid="helpb", $mode = 1, $addtextfunc = "addtext", $helpfunc = "help", $helpsize = '')
{
if(defsettrue('e_WYSIWYG')) { return; }
global $tp, $pref, $eplug_bb, $bbcode_func, $register_bb, $bbcode_help, $bbcode_helpactive, $bbcode_helptag;
global $tp, $pref, $eplug_bb, $bbcode_func, $register_bb, $bbcode_help, $bbcode_helpactive, $bbcode_helptag, $bbcode_helpsize;
$bbcode_helpsize = $helpsize;
$bbcode_func = $addtextfunc;
$bbcode_help = $helpfunc;
@@ -67,6 +68,7 @@ function display_help($tagid="helpb", $mode = 1, $addtextfunc = "addtext", $help
}
}
$temp = array();
$temp['news'] = $BBCODE_TEMPLATE_NEWSPOST;
$temp['submitnews'] = $BBCODE_TEMPLATE_SUBMITNEWS;
$temp['extended'] = $BBCODE_TEMPLATE_NEWSPOST;
@@ -76,7 +78,7 @@ function display_help($tagid="helpb", $mode = 1, $addtextfunc = "addtext", $help
$temp['maintenance']= $BBCODE_TEMPLATE_ADMIN;
$temp['comment'] = "{BB_HELP}<br />".$BBCODE_TEMPLATE;
if($temp[$mode])
if(isset($temp[$mode]))
{
$BBCODE_TEMPLATE = $temp[$mode];
}

View File

@@ -11,9 +11,9 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_themes/templates/bbcode_template.php,v $
| $Revision: 1.6 $
| $Date: 2009-07-07 07:25:27 $
| $Author: e107coders $
| $Revision: 1.7 $
| $Date: 2009-09-19 15:21:50 $
| $Author: secretr $
+----------------------------------------------------------------------------+
*/
// How to register your own BBcode button.
@@ -22,10 +22,9 @@
// $register_bb['blank'] = array("", "[blank][/blank]","Blank example helper text",e_IMAGE."bbcode/template.png");
$BBCODE_TEMPLATE = "
<div class='field-spacer'>
{BB=link}{BB=b}{BB=i}{BB=u}{BB=img}{BB=center}{BB=left}{BB=right}
{BB=bq}{BB=code}{BB=list}{BB=fontcol}{BB=fontsize}{BB=emotes}
</div>
<div class='field-spacer'><!-- --></div>
";
// $BBCODE_TEMPLATE .= "{BB=blank}";
@@ -35,54 +34,47 @@ $BBCODE_TEMPLATE = "
// $sc_style['BB_HELP']['post'] = "</div>";
$BBCODE_TEMPLATE_SUBMITNEWS = "
<div class='field-spacer'>
{BB_HELP}
</div>
<div class='field-spacer'>
<div class='field-spacer'><!-- --></div>
{BB=link}{BB=b}{BB=i}{BB=u}{BB=img}{BB=center}{BB=left}{BB=right}
{BB=bq}{BB=code}{BB=list}{BB=fontcol}{BB=fontsize}{BB=emotes}{BB=flash}
</div>
<div class='field-spacer'><!-- --></div>
";
// -------- Admin Templates ----------------------
$BBCODE_TEMPLATE_ADMIN = "
<div class='field-spacer'>
{BB_HELP=admin}
</div>
<div class='field-spacer'>
<div class='field-spacer'><!-- --></div>
{BB=link}{BB=b}{BB=i}{BB=u}{BB=img}{BB=center}{BB=left}
{BB=right}{BB=bq}{BB=code}{BB=list}{BB=fontcol}{BB=fontsize}{BB=emotes}
{BB_PREIMAGEDIR=".e_IMAGE."}
{BB=preimage}{BB=prefile}{BB=flash}
</div>
<div class='field-spacer'><!-- --></div>
";
// $BBCODE_TEMPLATE_ADMIN .= "{BB=blank}";
$BBCODE_TEMPLATE_NEWSPOST = "
<div class='field-spacer'>
{BB_HELP=$mode}
</div>
<div class='field-spacer'>
<div class='field-spacer'><!-- --></div>
{BB=link}{BB=b}{BB=i}{BB=u}{BB=img}{BB=center}{BB=left}
{BB=right}{BB=bq}{BB=code}{BB=list}{BB=fontcol}{BB=fontsize}{BB=emotes}
{BB_PREIMAGEDIR=".e_IMAGE."newspost_images/}
{BB=preimage}{BB=prefile}{BB=flash}
</div>
<div class='field-spacer'><!-- --></div>
";
$BBCODE_TEMPLATE_CPAGE = "
<div class='field-spacer'>
{BB_HELP}
</div>
<div class='field-spacer'>
<div class='field-spacer'><!-- --></div>
{BB=newpage}
{BB=link}{BB=b}{BB=i}{BB=u}{BB=img}{BB=center}{BB=left}{BB=right}
{BB=bq}{BB=code}{BB=list}{BB=fontcol}{BB=fontsize}{BB=emotes}
{BB_PREIMAGEDIR=".e_IMAGE."custom/}
{BB=preimage}{BB=prefile}{BB=flash}
</div>
<div class='field-spacer'><!-- --></div>
";
?>