mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 12:20:44 +02:00
fixes #3317 added bbcode template "forum"
Fixed issue with bbcode youtube to display the mediamanager only if the current user is an admin. Otherwise it will just add the plain bbcode string "[youtube]dkhkj[/youtube]" to the textarea.
This commit is contained in:
@@ -132,7 +132,16 @@ class bbcode_shortcodes extends e_shortcode
|
||||
list($tag,$tmp) = explode("--",$this->var['tagid']); // works with $frm->bbarea to detect textarea from first half of tag.
|
||||
}
|
||||
|
||||
$text = "<a class='e-modal btn btn-primary' data-modal-caption='Media Manager' data-target='#uiModal' title='Insert a Youtube video via Media Manager : ".$this->var['template']."' id='{$id}' href='".e_ADMIN."image.php?mode=main&action=dialog&for=".$this->var['template']."&tagid=".$tag."&iframe=1&bbcode=video' >";
|
||||
if (ADMIN)
|
||||
{
|
||||
$text = "<a class='e-modal btn btn-primary' data-modal-caption='Media Manager' data-target='#uiModal' title='Insert a Youtube video via Media Manager : " . $this->var['template'] . "' id='{$id}' href='" . e_HTTP . e_ADMIN . "image.php?mode=main&action=dialog&for=" . $this->var['template'] . "&tagid=" . $tag . "&iframe=1&bbcode=video' >";
|
||||
}
|
||||
else
|
||||
{
|
||||
$data = "[youtube=tiny | small | medium | big | huge | width,height]6kYjxJmk0wc[/youtube]";
|
||||
$event = $this->getEvent('addtext',$data,LANHELP_48);
|
||||
$text = "<a {$event} class='btn btn-default' id='{$id}' data-function='insert' href='#{$this->var['tagid']}' data-bbcode='{$data}' title='".$this->br2nl(LANHELP_48)."'>";
|
||||
}
|
||||
$text .= $this->button(e_IMAGE_ABS."bbcode/youtube.png", 'youtube', LANHELP_48);
|
||||
|
||||
$text .= "</a>";
|
||||
@@ -152,7 +161,7 @@ class bbcode_shortcodes extends e_shortcode
|
||||
}
|
||||
|
||||
|
||||
$text = "<a class='e-modal btn btn-primary' data-modal-caption='Media Manager' data-target='#uiModal' title='Insert a Glyphicon via Media Manager : ".$this->var['template']."' id='{$id}' href='".e_ADMIN."image.php?mode=main&action=dialog&for=".$this->var['template']."&tagid=".$tag."&iframe=1&bbcode=glyph' >";
|
||||
$text = "<a class='e-modal btn btn-primary' data-modal-caption='Media Manager' data-target='#uiModal' title='Insert a Glyphicon via Media Manager : ".$this->var['template']."' id='{$id}' href='".e_HTTP.e_ADMIN."image.php?mode=main&action=dialog&for=".$this->var['template']."&tagid=".$tag."&iframe=1&bbcode=glyph' >";
|
||||
$text .= $this->button(e_IMAGE_ABS."bbcode/youtube.png", 'youtube', LANHELP_48);
|
||||
|
||||
$text .= "</a>";
|
||||
@@ -211,7 +220,7 @@ class bbcode_shortcodes extends e_shortcode
|
||||
{
|
||||
list($tag,$tmp) = explode("--",$this->var['tagid']); // works with $frm->bbarea to detect textarea from first half of tag.
|
||||
}
|
||||
$text = "<a class='e-modal btn btn-primary' data-modal-caption='Media Manager' data-target='#uiModal' title='Insert an Image from the Media Manager : ".$this->var['template']."' id='{$id}' href='".e_ADMIN."image.php?mode=main&action=dialog&for=".$this->var['template']."&tagid=".$tag."&iframe=1&bbcode=img' >";
|
||||
$text = "<a class='e-modal btn btn-primary' data-modal-caption='Media Manager' data-target='#uiModal' title='Insert an Image from the Media Manager : ".$this->var['template']."' id='{$id}' href='".e_HTTP.e_ADMIN."image.php?mode=main&action=dialog&for=".$this->var['template']."&tagid=".$tag."&iframe=1&bbcode=img' >";
|
||||
|
||||
$text .= $this->button(e_IMAGE_ABS."bbcode/preimage.png",'picture-o');
|
||||
// $text .= "<img class='btn btn-small bbcode bbcode_buttons e-pointer' src='".e_IMAGE_ABS."bbcode/preimage.png' title='".LANHELP_45."' alt='' />";
|
||||
@@ -229,7 +238,7 @@ class bbcode_shortcodes extends e_shortcode
|
||||
{
|
||||
list($tag,$tmp) = explode("--",$this->var['tagid']); // works with $frm->bbarea to detect textarea from first half of tag.
|
||||
}
|
||||
$text = "<a class='e-modal btn btn-primary' data-modal-caption='Media Manager' data-target='#uiModal' id='{$id}' title='Insert a file from the Media-Manager' href='".e_ADMIN."image.php?mode=main&action=dialog&for=_common_file&tagid=".$tag."&iframe=1&bbcode=file' >";
|
||||
$text = "<a class='e-modal btn btn-primary' data-modal-caption='Media Manager' data-target='#uiModal' id='{$id}' title='Insert a file from the Media-Manager' href='".e_HTTP.e_ADMIN."image.php?mode=main&action=dialog&for=_common_file&tagid=".$tag."&iframe=1&bbcode=file' >";
|
||||
|
||||
$text .= $this->button(e_IMAGE_ABS."bbcode/prefile.png", 'file');
|
||||
// $text .= "<img class='btn btn-small bbcode bbcode_buttons e-pointer' src='".e_IMAGE_ABS."bbcode/prefile.png' title='".LANHELP_39."' alt='' />";
|
||||
|
@@ -50,6 +50,14 @@ $BBCODE_TEMPLATE_SUBMITNEWS = "
|
||||
";
|
||||
|
||||
|
||||
$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 = "
|
||||
|
@@ -547,6 +547,7 @@ class e_bbcode
|
||||
$BBCODE_TEMPLATE_ADMIN = '';
|
||||
$BBCODE_TEMPLATE_COMMENT = '';
|
||||
$BBCODE_TEMPLATE_SIGNATURE = '';
|
||||
$BBCODE_TEMPLATE_FORUM = '';
|
||||
|
||||
|
||||
require(e107::coreTemplatePath('bbcode')); //correct way to load a core template.
|
||||
@@ -574,6 +575,7 @@ class e_bbcode
|
||||
$temp['maintenance']= $BBCODE_TEMPLATE_ADMIN;
|
||||
$temp['comment'] = $BBCODE_TEMPLATE_COMMENT;
|
||||
$temp['signature'] = $BBCODE_TEMPLATE_SIGNATURE;
|
||||
$temp['forum'] = $BBCODE_TEMPLATE_FORUM;
|
||||
|
||||
if(isset($temp[$template]))
|
||||
{
|
||||
|
Reference in New Issue
Block a user