mirror of
https://github.com/e107inc/e107.git
synced 2025-08-05 22:27:34 +02:00
Bootstrap3 styling fixes and embedded featurebox layout added.
This commit is contained in:
@@ -2,6 +2,11 @@
|
||||
|
||||
function wmessage_shortcode($parm)
|
||||
{
|
||||
if($parm == 'hide')
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$e107 = e107::getInstance();
|
||||
$e107cache = e107::getCache();
|
||||
$pref = e107::getPref();
|
||||
|
@@ -28,9 +28,16 @@ class featurebox_shortcodes// must match the plugin's folder name. ie. [PLUGIN_F
|
||||
* @param string $mod category template
|
||||
* @example {FEATUREBOX=cols=2|tabs}
|
||||
*/
|
||||
function sc_featurebox($parm, $mod = '')
|
||||
function sc_featurebox($parm=null, $mod = '')
|
||||
{
|
||||
|
||||
if($parm == null && $mod == '') // ie {FEATUREBOX}
|
||||
{
|
||||
$type = vartrue(e107::getPlugPref('featurebox','menu_category'),'bootstrap_carousel');
|
||||
$text = e107::getParser()->parseTemplate("{FEATUREBOX|".$type."}");
|
||||
return $text;
|
||||
}
|
||||
|
||||
// TODO cache
|
||||
if(!e107::isInstalled('featurebox')) //just in case
|
||||
{
|
||||
|
@@ -40,36 +40,37 @@ class featurebox_setup
|
||||
$count = 0;
|
||||
foreach($e107_featurebox_category as $insert)
|
||||
{
|
||||
$count = e107::getDb()->db_Insert('featurebox_category', $insert) ? $count + 1 : $count;
|
||||
$count = e107::getDb()->insert('featurebox_category', $insert) ? $count + 1 : $count;
|
||||
}
|
||||
|
||||
|
||||
$status = ($count == 3) ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR;
|
||||
|
||||
$mes->add(FBLAN_INSTALL_01, $status);
|
||||
|
||||
if($status)
|
||||
{
|
||||
$query = array();
|
||||
$query['fb_id'] = 0;
|
||||
$query['fb_category'] = $inserted;
|
||||
$query['fb_title'] = 'Default Title';
|
||||
$query['fb_text'] = 'Default Message';
|
||||
$query['fb_mode'] = 0;
|
||||
$query['fb_class'] = e_UC_PUBLIC;
|
||||
$query['fb_rendertype'] = 0;
|
||||
$query['fb_template'] = 'bootstrap_carousel';
|
||||
$query['fb_order'] = 0;
|
||||
$query['fb_image'] = '';
|
||||
$query['fb_imageurl'] = '';
|
||||
$e107_featurebox = array(
|
||||
array('fb_id'=>'4','fb_title'=>'Slide 1','fb_text'=>'Default Message - this is the default','fb_mode'=>'0','fb_class'=>'0','fb_rendertype'=>'0','fb_template'=>'bootstrap_carousel_default','fb_order'=>'3','fb_image'=>'','fb_imageurl'=>'','fb_category'=>'1'),
|
||||
array('fb_id'=>'6','fb_title'=>'Slide 2','fb_text'=>'Suspendisse ac dui purus. Cras eleifend, velit sed dapibus pharetra, elit dolor mattis tellus, ac luctus nisi massa at ligula. Ut sagittis, neque consequat elementum convallis, lorem nulla molestie arcu, eu rutrum velit quam at metus! Nullam eu eleifend magna. Praesent eget leo felis, vel euismod nibh. Morbi sem eros, pellentesque eu scelerisque id, pretium id enim. Mauris aliquet molestie dui vel ultricies. Etiam consequat quam sed tellus facilisis sollicitudin. Vivamus malesuada iaculis metus.
|
||||
','fb_mode'=>'0','fb_class'=>'0','fb_rendertype'=>'0','fb_template'=>'bootstrap_carousel_left','fb_order'=>'4','fb_image'=>'','fb_imageurl'=>'','fb_category'=>'1'),
|
||||
array('fb_id'=>'10','fb_title'=>'Slide 3','fb_text'=>'Suspendisse ac dui purus. Cras eleifend, velit sed dapibus pharetra, elit dolor mattis tellus, ac luctus nisi massa at ligula. Ut sagittis, neque consequat elementum convallis, lorem nulla molestie arcu, eu rutrum velit quam at metus! Nullam eu eleifend magna. Praesent eget leo felis, vel euismod nibh. Morbi sem eros, pellentesque eu scelerisque id, pretium id enim. Mauris aliquet molestie dui vel ultricies. Etiam consequat quam sed tellus facilisis sollicitudin. Vivamus malesuada iaculis metus.
|
||||
','fb_mode'=>'0','fb_class'=>'0','fb_rendertype'=>'0','fb_template'=>'bootstrap_carousel_right','fb_order'=>'4','fb_image'=>'','fb_imageurl'=>'','fb_category'=>'1')
|
||||
);
|
||||
|
||||
$status = e107::getDb('sql2')->db_Insert('featurebox', $query) ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR;
|
||||
foreach($e107_featurebox as $qry)
|
||||
{
|
||||
$status = e107::getDb('sql2')->insert('featurebox', $qry) ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR;
|
||||
}
|
||||
$mes->add(FBLAN_INSTALL_02, $status);
|
||||
}
|
||||
else
|
||||
{
|
||||
$status = E_MESSAGE_ERROR;
|
||||
}
|
||||
$mes->add(FBLAN_INSTALL_02, $status);
|
||||
}
|
||||
|
||||
}
|
||||
/*
|
||||
function uninstall_options()
|
||||
{
|
||||
|
@@ -120,27 +120,29 @@ class plugin_featurebox_item extends e_model
|
||||
*/
|
||||
public function sc_featurebox_image($parm = '')
|
||||
{
|
||||
if(!$this->get('fb_image'))
|
||||
if(!$this->get('fb_image') && $parm != 'placeholder')
|
||||
{
|
||||
return '';
|
||||
}
|
||||
parse_str($parm, $parm);
|
||||
$tp = e107::getParser();
|
||||
|
||||
$imageSrc = ($parm != 'placeholder') ? $this->get('fb_image') : "";
|
||||
|
||||
if($tp->thumbWidth > 100 || $tp->thumbHeight > 100) //Guessing it's a featurebox image. Use {SETIMAGE} inside theme.php to configure.
|
||||
{
|
||||
$src = $tp->thumbUrl($this->get('fb_image')); //XXX TODO TBD Add a pref to use without resizing? Or, detect {SETIMAGE} in template to enable?
|
||||
$src = $tp->thumbUrl($imageSrc); //XXX TODO TBD Add a pref to use without resizing? Or, detect {SETIMAGE} in template to enable?
|
||||
}
|
||||
else
|
||||
{
|
||||
$src = $tp->replaceConstants($this->get('fb_image'), 'full');
|
||||
$src = $tp->replaceConstants($imageSrc, 'full');
|
||||
}
|
||||
|
||||
if(isset($parm['src']))
|
||||
{
|
||||
return $src;
|
||||
}
|
||||
$tag = '<img id="featurebox-image-'.$this->getId().'" src="'.$src.'" alt="'.$tp->toAttribute($this->get('fb_title')).'" class="featurebox" />';
|
||||
$tag = '<img id="featurebox-image-'.$this->getId().'" src="'.$src.'" alt="'.$tp->toAttribute($this->get('fb_title')).'" class="featurebox img-responsive" />';
|
||||
if(isset($parm['nourl']) || !$this->get('fb_imageurl'))
|
||||
{
|
||||
return $tag;
|
||||
|
@@ -11,12 +11,24 @@ global $sc_style;
|
||||
|
||||
// e107 v2.x Defaults.
|
||||
|
||||
$FEATUREBOX_TEMPLATE['bootstrap_carousel_left'] = '
|
||||
<!-- slide -->
|
||||
$FEATUREBOX_TEMPLATE['bootstrap_carousel_default'] = '{SETIMAGE: w=1900&h=500&crop=1}
|
||||
<div class="{FEATUREBOX_ACTIVE} item slide{FEATUREBOX_COUNTER}">
|
||||
<div class="media">
|
||||
{FEATUREBOX_IMAGE=placeholder}
|
||||
<div class="container">
|
||||
<div class="carousel-caption">
|
||||
<h1>{FEATUREBOX_TITLE}</h1>
|
||||
<p>{FEATUREBOX_TEXT}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>';
|
||||
|
||||
|
||||
$FEATUREBOX_TEMPLATE['bootstrap_carousel_left'] = '
|
||||
<!-- slide --> {SETIMAGE: w=600&h=500&crop=1}
|
||||
<div class="{FEATUREBOX_ACTIVE} item slide{FEATUREBOX_COUNTER}">
|
||||
<div class="media container">
|
||||
<div class="media-object featurebox-item-image pull-left ">
|
||||
{FEATUREBOX_IMAGE}
|
||||
{FEATUREBOX_IMAGE=placeholder}
|
||||
</div>
|
||||
<div class="media-body featurebox-item-text span4">
|
||||
<h1>
|
||||
@@ -31,27 +43,32 @@ $FEATUREBOX_TEMPLATE['bootstrap_carousel_left'] = '
|
||||
';
|
||||
|
||||
$FEATUREBOX_TEMPLATE['bootstrap_carousel_right'] = '
|
||||
{SETIMAGE: w=600&h=500&crop=1}
|
||||
<div class="{FEATUREBOX_ACTIVE} item slide{FEATUREBOX_COUNTER}">
|
||||
<div class="media">
|
||||
<div class="media container">
|
||||
<div class="featurebox-item-image media-object pull-right span6 animated fadeInDownBig">
|
||||
{FEATUREBOX_IMAGE=placeholder}
|
||||
</div>
|
||||
<div class="featurebox-item-text media-body animated fadeInUpBig">
|
||||
<h1>{FEATUREBOX_TITLE}</h1>
|
||||
{FEATUREBOX_TEXT}
|
||||
</div>
|
||||
<div class="featurebox-item-image media-object span6 animated fadeInDownBig">
|
||||
{FEATUREBOX_IMAGE}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
|
||||
|
||||
$FEATUREBOX_TEMPLATE['bootstrap_carousel_image'] = '
|
||||
<div class="item slide3 animated fadeInUpBig">
|
||||
{FEATUREBOX_IMAGE}
|
||||
$FEATUREBOX_TEMPLATE['bootstrap_carousel_image'] = '{SETIMAGE: w=1900&h=500&crop=1}
|
||||
|
||||
<div class="item">
|
||||
{FEATUREBOX_IMAGE=placeholder}
|
||||
</div>
|
||||
';
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// ----------------------------
|
||||
|
||||
|
||||
|
@@ -52,3 +52,33 @@ body {
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* CUSTOMIZE THE CAROUSEL
|
||||
-------------------------------------------------- */
|
||||
|
||||
/* Carousel base class */
|
||||
.carousel {
|
||||
height: 500px;
|
||||
margin-bottom: 60px;
|
||||
}
|
||||
/* Since positioning the image, we need to help out the caption */
|
||||
.carousel-caption {
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
/* Declare heights because of positioning of img element */
|
||||
.carousel .item {
|
||||
height: 500px;
|
||||
background-color: #777;
|
||||
}
|
||||
.carousel-inner > .item > img {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
min-width: 100%;
|
||||
height: 500px;
|
||||
}
|
@@ -30,7 +30,7 @@ function tablestyle($caption, $text, $mode='')
|
||||
$type = 'box';
|
||||
}
|
||||
|
||||
if($style == 'navdoc')
|
||||
if($style == 'navdoc' || $mode == 'featurebox')
|
||||
{
|
||||
echo $text;
|
||||
return;
|
||||
@@ -101,9 +101,7 @@ $LAYOUT['_header_'] = '
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Main jumbotron for a primary marketing message or call to action -->
|
||||
{SETSTYLE=jumbotron}
|
||||
{WMESSAGE}
|
||||
|
||||
|
||||
';
|
||||
|
||||
@@ -121,6 +119,10 @@ $LAYOUT['_footer_'] = ' <hr>
|
||||
// $LAYOUT is a combined $HEADER and $FOOTER, automatically split at the point of "{---}"
|
||||
|
||||
$LAYOUT['jumbotron_home'] = '
|
||||
<!-- Main jumbotron for a primary marketing message or call to action -->
|
||||
{SETSTYLE=jumbotron}
|
||||
|
||||
{WMESSAGE=force}
|
||||
|
||||
{SETSTYLE=default}
|
||||
<div class="container">
|
||||
@@ -141,6 +143,31 @@ $LAYOUT['jumbotron_home'] = '
|
||||
';
|
||||
|
||||
|
||||
$LAYOUT['jumbotron_carousel'] = '
|
||||
<!-- Main jumbotron for a primary marketing message or call to action -->
|
||||
{SETSTYLE=jumbotron}
|
||||
|
||||
{WMESSAGE=hide}
|
||||
|
||||
{FEATUREBOX}
|
||||
|
||||
{SETSTYLE=default}
|
||||
<div class="container">
|
||||
{ALERTS}
|
||||
|
||||
{---}
|
||||
|
||||
</div>
|
||||
<div class="container">
|
||||
<!-- Example row of columns -->
|
||||
<div class="row">
|
||||
{SETSTYLE=col-md-4}
|
||||
{CMENU=jumbotron-menu-1}
|
||||
{CMENU=jumbotron-menu-2}
|
||||
{CMENU=jumbotron-menu-3}
|
||||
</div>
|
||||
|
||||
';
|
||||
|
||||
$LAYOUT['jumbotron_full'] = '
|
||||
|
||||
|
@@ -18,8 +18,9 @@
|
||||
<layout name='jumbotron_home' title='Jumbotron (home)' default='false'>
|
||||
<custompages>FRONTPAGE</custompages>
|
||||
</layout>
|
||||
<layout name='jumbotron_full' title='Jumbotron (full-width)' default='true' />
|
||||
<layout name='jumbotron_sidebar_right' title='Jumbotron (sidebar-right)' >
|
||||
<layout name='jumbotron_carousel' title='Jumbotron (home with carousel)' />
|
||||
<layout name='jumbotron_full' title='Jumbotron (full-width)' />
|
||||
<layout name='jumbotron_sidebar_right' title='Jumbotron (sidebar-right)' default='true' >
|
||||
<custompages>/news</custompages>
|
||||
<menuPresets>
|
||||
<area id='1'>
|
||||
|
Reference in New Issue
Block a user