1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-30 09:39:55 +02:00

Featurebox work and other fixes

This commit is contained in:
Cameron
2013-03-08 02:19:18 -08:00
parent bfd095e0c4
commit 3fcd499f9f
11 changed files with 249 additions and 33 deletions

View File

@@ -69,8 +69,8 @@ class fb_category_ui extends e_admin_ui
'checkboxes' => array('title'=> '', 'type' => null, 'width' =>'5%', 'forced'=> TRUE, 'thclass'=>'center', 'class'=>'center first'),
'fb_category_id' => array('title'=> LAN_ID, 'type' => 'number', 'data' => 'int', 'width' =>'5%', 'forced'=> TRUE),
'fb_category_icon' => array('title'=> LAN_ICON, 'type' => 'icon', 'data' => 'str', 'width' => '5%', 'thclass' => 'center', 'class'=>'center'),
'fb_category_title' => array('title'=> LAN_TITLE, 'type' => 'text', 'data' => 'str', 'inline'=>true, 'width' => 'auto', 'validate' => 'str', 'rule' => '1-200', 'error' => 'String between 1-200 characters expected', 'help' => 'up to 200 characters', 'thclass' => 'left'),
'fb_category_template' => array('title'=> 'Category template', 'type' => 'layouts', 'data' => 'str', 'width' => 'auto', 'thclass' => 'left', 'writeParms' => 'plugin=featurebox&id=featurebox_category&merge=1', 'filter' => true),
'fb_category_title' => array('title'=> LAN_TITLE, 'type' => 'text', 'data' => 'str', 'inline'=>true, 'width' => 'auto', 'help' => 'up to 200 characters', 'thclass' => 'left'),
'fb_category_template' => array('title'=> 'Category template', 'type' => 'layouts', 'inline'=>true, 'data' => 'str', 'width' => 'auto', 'thclass' => 'left', 'writeParms' => 'plugin=featurebox&id=featurebox_category&merge=1', 'filter' => true),
'fb_category_random' => array('title'=> 'Random', 'type' => 'boolean', 'data' => 'int', 'width' => '5%', 'thclass' => 'center', 'class' => 'center', 'batch' => true, 'filter' => true),
'fb_category_class' => array('title'=> LAN_VISIBILITY, 'type' => 'userclass', 'data' => 'int', 'inline'=>true, 'width' => 'auto', 'filter' => true, 'batch' => true),
'fb_category_limit' => array('title'=> 'Limit', 'type' => 'number', 'data' => 'int', 'width' => '5%', 'thclass' => 'left', 'help' => 'number of items to be shown, 0 - show all'),

View File

@@ -148,6 +148,19 @@ class plugin_featurebox_item extends e_model
}
}
/**
* Returns 'active' for the first-slide. - often used by Bootstrap.
*/
public function sc_featurebox_active()
{
$count = $this->getParam('counter', 1);
return ($count == 1) ? "active" : "";
}
/**
* Item counter number (starting from 1)

View File

@@ -1,16 +1,54 @@
<?php
/*
* Copyright (c) e107 Inc 2009 - e107.org, Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
* $Id$
* Copyright (c) e107 Inc 2013 - e107.org, Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
*
* Featurebox core category templates
*/
// TODO - list of all available shortcodes & schortcode parameters
// avoid PHP warnings
$FEATUREBOX_CATEGORY_TEMPLATE = array();
// v2.x Default - Bootstrap.
$FEATUREBOX_CATEGORY_TEMPLATE['bootstrap_carousel']['list_start'] = '
<!-- starts carousel -->
<div class="row animated fadeInDown">
<div class="span12">
<div id="myCarousel" class="carousel slide">
<!-- carousel items -->
<div class="carousel-inner">
';
$FEATUREBOX_CATEGORY_TEMPLATE['bootstrap_carousel']['list_end'] = '
</div>
<!-- Carousel nav -->
<a class="carousel-control left" href="#myCarousel" data-slide="prev">&lsaquo;</a>
<a class="carousel-control right" href="#myCarousel" data-slide="next">&rsaquo;</a>
</div><!-- end myCarousel -->
</div><!-- end span12 -->
</div><!-- end row -->
<!-- end carousel -->
';
$FEATUREBOX_CATEGORY_TEMPLATE['bootstrap_carousel']['col_start'] = '';
$FEATUREBOX_CATEGORY_TEMPLATE['bootstrap_carousel']['col_end'] = '';
$FEATUREBOX_CATEGORY_TEMPLATE['bootstrap_carousel']['item_start'] = '';
$FEATUREBOX_CATEGORY_TEMPLATE['bootstrap_carousel']['item_end'] = '';
$FEATUREBOX_CATEGORY_TEMPLATE['bootstrap_carousel']['item_separator'] = '';
$FEATUREBOX_CATEGORY_TEMPLATE['bootstrap_carousel']['item_empty'] = '';
// GENERIC template avoid PHP warnings
/*
* Default Template
* Example call: {FEATUREBOX} or {FEATUREBOX|default}
@@ -34,9 +72,10 @@ $FEATUREBOX_CATEGORY_TEMPLATE['default']['item_start'] = '';
$FEATUREBOX_CATEGORY_TEMPLATE['default']['item_end'] = '';
$FEATUREBOX_CATEGORY_TEMPLATE['default']['item_separator'] = '<div class="clear"><!-- --></div>';
// empty item - used with col templates, no shortcodes just basic markup
$FEATUREBOX_CATEGORY_TEMPLATE['default']['item_empty'] = '';
// no dynamic load support
//$FEATUREBOX_CATEGORY_TEMPLATE['default']['nav_start'] = '';
//$FEATUREBOX_CATEGORY_TEMPLATE['default']['nav_item'] = '';
@@ -48,6 +87,9 @@ $FEATUREBOX_CATEGORY_TEMPLATE['default']['item_empty'] = '';
// inline JS, without <script> tags
//$FEATUREBOX_CATEGORY_TEMPLATE['default']['js_inline'] = '';
/*
* Dynamic Template
* Example call: {FEATUREBOX|dynamic}
@@ -247,11 +289,12 @@ $FEATUREBOX_CATEGORY_TEMPLATE['camera']['js_type'] = 'jquery';
* @var array
*/
$FEATUREBOX_CATEGORY_INFO = array(
'tabs' => array('title' => 'Tabs (jquery)' , 'description' => 'Tabbed Feature box items utlizing jQuery UI'),
'camera' => array('title' => 'Image-Slider (jquery)' , 'description' => 'Image transitions using the "Camera" jquery plugin'),
'accordion' => array('title' => 'Accordion (jquery)' , 'description' => 'Accordion utilizing jQuery UI'),
'default' => array('title' => 'Default (prototype.js)', 'description' => 'Flat - show by category limit'),
'dynamic' => array('title' => 'Dynamic (prototype.js)', 'description' => 'Load items on click (AJAX)'),
'tabs-proto' => array('title' => 'Tabs (prototype.js)' , 'description' => 'Tabbed Feature box items')
'bootstrap_carousel' => array('title' => 'Bootstrap Carousel', 'description' => "Bootstrap's Hero slider"),
'tabs' => array('title' => 'Tabs (jquery UI)' , 'description' => 'Tabbed Feature box items utlizing jQuery UI'),
'camera' => array('title' => 'Image-Slider (jquery)' , 'description' => 'Image transitions using the "Camera" jquery plugin'),
'accordion' => array('title' => 'Accordion (jquery)' , 'description' => 'Accordion utilizing jQuery UI'),
'default' => array('title' => 'Default (prototype.js)', 'description' => 'Flat - show by category limit'),
'dynamic' => array('title' => 'Dynamic (prototype.js)', 'description' => 'Load items on click (AJAX)'),
'tabs-proto' => array('title' => 'Tabs (prototype.js)' , 'description' => 'Tabbed Feature box items')
);
?>

View File

@@ -8,6 +8,67 @@
global $sc_style;
// e107 v2.x Defaults.
$FEATUREBOX_TEMPLATE['bootstrap_carousel_left'] = '
<!-- slide -->
<div class="{FEATUREBOX_ACTIVE} item slide{FEATUREBOX_COUNTER}">
<div class="row">
<div class="span6">
{FEATUREBOX_IMAGE}
</div>
<div class="span4">
<h1>
{FEATUREBOX_TITLE}
</h1>
{FEATUREBOX_TEXT}
</div>
</div>
</div>
<!-- -->
';
$FEATUREBOX_TEMPLATE['bootstrap_carousel_right'] = '
<div class="{FEATUREBOX_ACTIVE} item slide{FEATUREBOX_COUNTER}">
<div class="row">
<div class="span4 animated fadeInUpBig">
<h1>{FEATUREBOX_TITLE}</h1>
{FEATUREBOX_TEXT}
</div>
<div class="span6 animated fadeInDownBig">
{FEATUREBOX_IMAGE}
</div>
</div>
</div>
';
$FEATUREBOX_TEMPLATE['bootstrap_carousel_image'] = '
<div class="item slide3 animated fadeInUpBig">
{FEATUREBOX_IMAGE}
</div>
';
// ----------------------------
$sc_style['FEATUREBOX_IMAGE|image_left']['pre'] = '<img class="f-left" src="';
$sc_style['FEATUREBOX_IMAGE|image_left']['post'] = '" alt="" />';
$FEATUREBOX_TEMPLATE['default'] = '<!-- Feature box Item -->
<div class="featurebox-item" >
<h3>{FEATUREBOX_TITLE|default}</h3>
@@ -16,8 +77,7 @@ $FEATUREBOX_TEMPLATE['default'] = '<!-- Feature box Item -->
';
$sc_style['FEATUREBOX_IMAGE|image_left']['pre'] = '<img class="f-left" src="';
$sc_style['FEATUREBOX_IMAGE|image_left']['post'] = '" alt="" />';
$FEATUREBOX_TEMPLATE['image_left'] = '
<div class="featurebox-item">
{FEATUREBOX_IMAGE|image_left=src}<h3>{FEATUREBOX_TITLE|image_left}</h3>{FEATUREBOX_TEXT|image_left}
@@ -77,12 +137,19 @@ $FEATUREBOX_TEMPLATE['tabs'] = '
$FEATUREBOX_INFO = array(
'default' => array('title' => 'Default (core)', 'description' => 'Title and description - no image'),
'image_right' => array('title' => 'Right image (core)', 'description' => 'Right floated image'),
'image_left' => array('title' => 'Left image (core)' , 'description' => 'Left floated image'),
'camera' => array('title' => 'Camera item', 'description' => 'For use with the "camera" category'),
'camera_caption' => array('title' => 'Camera item with caption', 'description' => 'For use with the "camera" category'),
'accordion' => array('title' => 'Accordion Item', 'description' => 'For use with accordion'),
'tabs' => array('title' => 'Tab Item', 'description' => 'For use with tabs')
'bootstrap_carousel_default' => array('title' => 'Bootstrap', 'description' => 'Title and Description'),
'bootstrap_carousel_image' => array('title' => 'Bootstrap Carousel (Image-Only)', 'description' => 'Image Only'),
'bootstrap_carousel_left' => array('title' => 'Bootstrap Carousel (Image-left)', 'description' => 'Image aligned left with title and text on the right'),
'bootstrap_carousel_right' => array('title' => 'Bootstrap Carousel (Image-right)', 'description' => 'Image aligned right with title and text on the left'),
'default' => array('title' => 'Generic', 'description' => 'Title and description - no image'),
'image_left' => array('title' => 'Generic - (Image-left)' , 'description' => 'Left floated image'),
'image_right' => array('title' => 'Generic - (Image-right)', 'description' => 'Right floated image'),
'camera' => array('title' => 'Camera item', 'description' => 'For use with the "camera" category'),
'camera_caption' => array('title' => 'Camera item with caption', 'description' => 'For use with the "camera" category'),
'accordion' => array('title' => 'Accordion Item', 'description' => 'For use with accordion'),
'tabs' => array('title' => 'Tab Item', 'description' => 'For use with tabs')
);
?>