1
0
mirror of https://github.com/e107inc/e107.git synced 2025-04-30 01:08:46 +02:00

Issue #435 - More Bootstrap 3 tweaks

This commit is contained in:
Cameron 2013-12-19 22:45:09 -08:00
parent 7874cd1060
commit 62509f09fb
7 changed files with 69 additions and 11 deletions

View File

@ -228,10 +228,11 @@ class news_shortcodes extends e_shortcode
function sc_adminoptions()
{
$tp = e107::getParser();
if (ADMIN && getperms('H'))
{
//TODO - discuss - a pref for 'new browser window' loading, or a parm or leave 'new browser window' as default?
$default = (deftrue('BOOTSTRAP')) ? "<i class='icon-edit'></i>" : "<img src='".e_IMAGE_ABS."admin_images/edit_16.png' alt='".LAN_NEWS_25."' class='icon' />";
$default = (deftrue('BOOTSTRAP')) ? $tp->toGlyph('icon-edit.glyph',false) : "<img src='".e_IMAGE_ABS."admin_images/edit_16.png' alt='".LAN_NEWS_25."' class='icon' />";
$adop_icon = (file_exists(THEME."images/newsedit.png") ? "<img src='".THEME_ABS."images/newsedit.png' alt='".LAN_NEWS_25."' class='icon' />" : $default);
return " <a rel='external' href='".e_ADMIN_ABS."newspost.php?action=create&amp;sub=edit&amp;id=".$this->news_item['news_id']."' title=\"".LAN_NEWS_25."\">".$adop_icon."</a>\n";
@ -489,7 +490,7 @@ class news_shortcodes extends e_shortcode
{
if(trim($val))
{
$words[] = "<a href='".e_BASE."news.php?tag=".$val."'><span class='label'>".$val."</span></a>";
$words[] = "<a href='".e_BASE."news.php?tag=".$val."'><span class='label label-default'>".$val."</span></a>";
}
}

View File

@ -8,7 +8,7 @@
// TEMPLATE FOR {NAVIGATION=main}
$NAVIGATION_TEMPLATE['main']['start'] = '<ul class="nav nav-pills">';
$NAVIGATION_TEMPLATE['main']['start'] = '<ul class="nav navbar-nav">';
// Main Link
$NAVIGATION_TEMPLATE['main']['item'] = '

View File

@ -112,6 +112,7 @@ class ecache {
* @return string
* @param string $query
* @param int $MaximumAge the time in minutes before the cache file 'expires'
* @param Forced check if cache is disabled.
* @desc Returns the data from the cache file associated with $query, else it returns false if there is no cache for $query.
* @scope public
*/

View File

@ -158,6 +158,8 @@ class featurebox_shortcodes// must match the plugin's folder name. ie. [PLUGIN_F
$base = vartrue($parm['base'], 'nav').'_';
$tree_ids = array_keys($tree->getTree()); //all available item ids
$ret = $category->toHTML(varset($tmpl[$base.'start']), true);
$cols = $category->getParam('cols', 1);
@ -168,6 +170,7 @@ class featurebox_shortcodes// must match the plugin's folder name. ie. [PLUGIN_F
{
$total = $tree->getTotal();
}
// loop for limit number
elseif(isset($parm['uselimit']))
{
@ -186,14 +189,19 @@ class featurebox_shortcodes// must match the plugin's folder name. ie. [PLUGIN_F
{
$total = ceil($total / $cols);
}
$model = clone $category;
$item = new plugin_featurebox_item();
$tmp = array();
for ($index = 1; $index <= $total; $index++)
{
$nodeid = varset($tree_ids[($index - 1) * $cols], 0);
if($nodeid && $tree->hasNode($nodeid))
{
$model->setParam('counter', $index)
->setParam('total', $total)
->setParam('active', $index == varset($parm['from'], 1));

View File

@ -186,10 +186,12 @@ class plugin_featurebox_item extends e_model
/**
* Item counter number (starting from 1)
* @param optional - to strat from 0 if needed. (bootstrap 3)
*/
public function sc_featurebox_counter()
{
return $this->getParam('counter', 1);
public function sc_featurebox_counter($parm=1)
{
$count = $this->getParam('counter', 1);
return ($oarm == 0) ? $count - 1 : $count;
}
/**

View File

@ -8,6 +8,51 @@
// TODO - list of all available shortcodes & schortcode parameters
$FEATUREBOX_CATEGORY_TEMPLATE = array();
// Bootstrap 3
$FEATUREBOX_CATEGORY_TEMPLATE['bootstrap3_carousel']['list_start'] = '
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
{FEATUREBOX_NAVIGATION|bootstrap3_carousel=loop&uselimit=1}
<!-- Wrapper for slides -->
<div class="carousel-inner">
';
$FEATUREBOX_CATEGORY_TEMPLATE['bootstrap3_carousel']['list_end'] = '
</div>
<!-- Controls -->
<a class="left carousel-control" href="#carousel-example-generic" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left"></span>
</a>
<a class="right carousel-control" href="#carousel-example-generic" data-slide="next">
<span class="glyphicon glyphicon-chevron-right"></span>
</a>
</div><!-- end row -->
<!-- end carousel -->
';
$FEATUREBOX_CATEGORY_TEMPLATE['bootstrap3_carousel']['nav_start'] = '<!-- Indicators --><ol class="carousel-indicators">';
$FEATUREBOX_CATEGORY_TEMPLATE['bootstrap3_carousel']['nav_item'] = '<li data-target="#carousel-example-generic" data-slide-to="{FEATUREBOX_COUNTER=0}" class="{FEATUREBOX_ACTIVE}"></li>';
$FEATUREBOX_CATEGORY_TEMPLATE['bootstrap3_carousel']['nav_end'] = '</ol>';
$FEATUREBOX_CATEGORY_TEMPLATE['bootstrap3_carousel']['nav_separator'] = '';
$FEATUREBOX_CATEGORY_TEMPLATE['bootstrap3_carousel']['col_start'] = '';
$FEATUREBOX_CATEGORY_TEMPLATE['bootstrap3_carousel']['col_end'] = '';
$FEATUREBOX_CATEGORY_TEMPLATE['bootstrap3_carousel']['item_start'] = '';
$FEATUREBOX_CATEGORY_TEMPLATE['bootstrap3_carousel']['item_end'] = '';
$FEATUREBOX_CATEGORY_TEMPLATE['bootstrap3_carousel']['item_separator'] = '';
$FEATUREBOX_CATEGORY_TEMPLATE['bootstrap3_carousel']['item_empty'] = '';
// v2.x Default - Bootstrap.
@ -289,7 +334,8 @@ $FEATUREBOX_CATEGORY_TEMPLATE['camera']['js_type'] = 'jquery';
* @var array
*/
$FEATUREBOX_CATEGORY_INFO = array(
'bootstrap_carousel' => array('title' => 'Bootstrap Carousel', 'description' => "Bootstrap's Hero slider"),
'bootstrap_carousel' => array('title' => 'Bootstrap v2 Carousel', 'description' => "Bootstrap's Hero slider"),
'bootstrap3_carousel' => array('title' => 'Bootstrap v3 Carousel', 'description' => "Bootstrap's Hero slider"),
'bootstrap_tabs' => array('title' => 'Bootstrap Tabs' , 'description' => 'Tabbed Feature box items'),
// 'camera' => array('title' => 'Image-Slider (jquery)' , 'description' => 'Image transitions using the "Camera" jquery plugin'),
// 'accordion' => array('title' => 'Accordion (jquery)' , 'description' => 'Accordion utilizing jQuery UI'),

View File

@ -15,10 +15,10 @@ $FEATUREBOX_TEMPLATE['bootstrap_carousel_left'] = '
<!-- slide -->
<div class="{FEATUREBOX_ACTIVE} item slide{FEATUREBOX_COUNTER}">
<div class="row">
<div class="span6">
<div class="featurebox-item-image pull-left span6">
{FEATUREBOX_IMAGE}
</div>
<div class="span4">
<div class="featurebox-item-text span4">
<h1>
{FEATUREBOX_TITLE}
</h1>
@ -33,11 +33,11 @@ $FEATUREBOX_TEMPLATE['bootstrap_carousel_left'] = '
$FEATUREBOX_TEMPLATE['bootstrap_carousel_right'] = '
<div class="{FEATUREBOX_ACTIVE} item slide{FEATUREBOX_COUNTER}">
<div class="row">
<div class="span4 animated fadeInUpBig">
<div class="featurebox-item-text col-md-4 span4 animated fadeInUpBig">
<h1>{FEATUREBOX_TITLE}</h1>
{FEATUREBOX_TEXT}
</div>
<div class="span6 animated fadeInDownBig">
<div class="featurebox-item-image col-md-6 span6 animated fadeInDownBig">
{FEATUREBOX_IMAGE}
</div>
</div>