mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 20:30:39 +02:00
Added alert bbcode. menu-name shortcode for custom menus. And a 'Bootstrap Row' css style in Tinymce4.
This commit is contained in:
60
e107_core/bbcodes/bb_alert.php
Normal file
60
e107_core/bbcodes/bb_alert.php
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright (C) e107 Inc (e107.org), Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
|
||||||
|
*
|
||||||
|
* DIV block bbcode
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (!defined('e107_INIT')) { exit; }
|
||||||
|
|
||||||
|
// This is a generic and 'responsive' video bbcode. Handles Youtube and eventually html5 video tags.
|
||||||
|
|
||||||
|
class bb_alert extends e_bb_base
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Called prior to save
|
||||||
|
* Re-assemble the bbcode
|
||||||
|
*/
|
||||||
|
function toDB($code_text, $parm)
|
||||||
|
{
|
||||||
|
if(!empty($parm))
|
||||||
|
{
|
||||||
|
$ins = '='.$parm;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$ins = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
return '[alert'.$ins.']'.$code_text.'[/alert]';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Bootstrap Alert container.
|
||||||
|
* @param $code_text :
|
||||||
|
*/
|
||||||
|
function toHTML($code_text, $parm='')
|
||||||
|
{
|
||||||
|
|
||||||
|
if(!empty($parm))
|
||||||
|
{
|
||||||
|
$style = "alert alert-".$parm;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$style = "alert alert-default";
|
||||||
|
}
|
||||||
|
|
||||||
|
return "<div class='".$style."'>".$code_text."</div>";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
@@ -267,12 +267,14 @@ class cpage_shortcodes extends e_shortcode
|
|||||||
|
|
||||||
$buttonText = (empty($this->var['menu_button_text'])) ? LAN_READ_MORE : $this->var['menu_button_text'];
|
$buttonText = (empty($this->var['menu_button_text'])) ? LAN_READ_MORE : $this->var['menu_button_text'];
|
||||||
$buttonUrl = (empty($this->var['menu_button_url'])) ? $url : $tp->replaceConstants($this->var['menu_button_url']);
|
$buttonUrl = (empty($this->var['menu_button_url'])) ? $url : $tp->replaceConstants($this->var['menu_button_url']);
|
||||||
|
$buttonTarget = (empty($this->var['menu_button_target'])) ? '' : ' target="'.$this->var['menu_button_target'].'" '; //TODO add pref to admin area.
|
||||||
|
|
||||||
$text = vartrue($options['text'], $buttonText);
|
$text = vartrue($options['text'], $buttonText);
|
||||||
$size = vartrue($options['size'], "");
|
$size = vartrue($options['size'], "");
|
||||||
|
|
||||||
$inc = ($size) ? " btn-".$size : "";
|
$inc = ($size) ? " btn-".$size : "";
|
||||||
|
|
||||||
return '<a class="cpage btn btn-primary btn-cpage'.$inc.'" href="'.$buttonUrl.'">'.$text.'</a>';
|
return '<a class="cpage btn btn-primary btn-cpage'.$inc.'" href="'.$buttonUrl.'" '.$buttonTarget.'>'.$text.'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -281,7 +283,12 @@ class cpage_shortcodes extends e_shortcode
|
|||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
//
|
//
|
||||||
return $tp->toHTML($this->var['menu_title'], true, 'TITLE');
|
return $tp->toHTML($this->var['menu_title'], true, 'TITLE');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function sc_cmenuname($parm='')
|
||||||
|
{
|
||||||
|
return $this->var['menu_name'];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function sc_cmenubody($parm='')
|
function sc_cmenubody($parm='')
|
||||||
|
@@ -37,6 +37,7 @@ class e_bbcode
|
|||||||
$pref = e107::getPref();
|
$pref = e107::getPref();
|
||||||
|
|
||||||
$this->core_bb = array(
|
$this->core_bb = array(
|
||||||
|
'alert',
|
||||||
'blockquote', 'img', 'i', 'u', 'center',
|
'blockquote', 'img', 'i', 'u', 'center',
|
||||||
'_br', 'color', 'size', 'code',
|
'_br', 'color', 'size', 'code',
|
||||||
'flash', 'link', 'email',
|
'flash', 'link', 'email',
|
||||||
|
@@ -450,6 +450,7 @@ class wysiwyg
|
|||||||
{title: 'Float Clear', block: 'div', classes: 'clearfix'},
|
{title: 'Float Clear', block: 'div', classes: 'clearfix'},
|
||||||
{title: 'Lead', block: 'p', classes: 'lead'},
|
{title: 'Lead', block: 'p', classes: 'lead'},
|
||||||
{title: 'Well', block: 'div', classes: 'well'},
|
{title: 'Well', block: 'div', classes: 'well'},
|
||||||
|
{title: 'Row', block: 'div', classes: 'row'},
|
||||||
{title: '1/4 Width Block', block: 'div', classes: 'col-md-3 col-sm-12'},
|
{title: '1/4 Width Block', block: 'div', classes: 'col-md-3 col-sm-12'},
|
||||||
{title: '3/4 Width Block', block: 'div', classes: 'col-md-9 col-sm-12'},
|
{title: '3/4 Width Block', block: 'div', classes: 'col-md-9 col-sm-12'},
|
||||||
{title: '1/3 Width Block', block: 'div', classes: 'col-md-4 col-sm-12'},
|
{title: '1/3 Width Block', block: 'div', classes: 'col-md-4 col-sm-12'},
|
||||||
|
Reference in New Issue
Block a user