mirror of
https://github.com/e107inc/e107.git
synced 2025-08-17 20:01:47 +02:00
more featurebox front-end fixes
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* Copyright (c) e107 Inc 2009 - e107.org, Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
|
* Copyright (c) e107 Inc 2009 - e107.org, Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
|
||||||
* $Id: e_shortcode.php,v 1.5 2009-12-11 12:51:10 secretr Exp $
|
* $Id: e_shortcode.php,v 1.6 2009-12-11 13:11:35 secretr Exp $
|
||||||
*
|
*
|
||||||
* Featurebox shortcode batch class - shortcodes available site-wide. ie. equivalent to multiple .sc files.
|
* Featurebox shortcode batch class - shortcodes available site-wide. ie. equivalent to multiple .sc files.
|
||||||
*/
|
*/
|
||||||
@@ -196,11 +196,13 @@ class featurebox_shortcodes // must match the plugin's folder name. ie. [PLUGIN_
|
|||||||
|
|
||||||
$base = vartrue($parm['base'], 'nav').'_';
|
$base = vartrue($parm['base'], 'nav').'_';
|
||||||
$ret = $category->toHTML(varset($tmpl[$base.'start']), true);
|
$ret = $category->toHTML(varset($tmpl[$base.'start']), true);
|
||||||
|
|
||||||
if(isset($parm['loop']) && $tree->getTotal() > 0 && vartrue($tmpl[$base.'item']))
|
if(isset($parm['loop']) && $tree->getTotal() > 0 && vartrue($tmpl[$base.'item']))
|
||||||
{
|
{
|
||||||
$total = ceil($tree->getTotal() / $category->sc_featurebox_category_limit());
|
$total = ceil($tree->getTotal() / ($category->sc_featurebox_category_limit() ? intval($category->sc_featurebox_category_limit()) : $tree->getTotal()) );
|
||||||
$model = clone $category;
|
$model = clone $category;
|
||||||
$tmp = array();
|
$tmp = array();
|
||||||
|
var_dump($category->sc_featurebox_category_limit());
|
||||||
for ($index = 1; $index <= $total; $index++)
|
for ($index = 1; $index <= $total; $index++)
|
||||||
{
|
{
|
||||||
$tmp[] = $model->setParam('counter', $index)
|
$tmp[] = $model->setParam('counter', $index)
|
||||||
@@ -226,7 +228,7 @@ class featurebox_shortcodes // must match the plugin's folder name. ie. [PLUGIN_
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Render featurebox navigation
|
* Get & Render featurebox items (custom)
|
||||||
* Available parameters (GET string format)
|
* Available parameters (GET string format)
|
||||||
* - cols (integer): number of items per column, default 1
|
* - cols (integer): number of items per column, default 1
|
||||||
* - no_fill_empty (boolean): don't fill last column with empty items (if required), default 0
|
* - no_fill_empty (boolean): don't fill last column with empty items (if required), default 0
|
||||||
@@ -282,6 +284,7 @@ class featurebox_shortcodes // must match the plugin's folder name. ie. [PLUGIN_
|
|||||||
$counter = 1;
|
$counter = 1;
|
||||||
$col_counter = 1;
|
$col_counter = 1;
|
||||||
$ret = '';
|
$ret = '';
|
||||||
|
|
||||||
foreach ($tree->getTree() as $id => $node)
|
foreach ($tree->getTree() as $id => $node)
|
||||||
{
|
{
|
||||||
$tmpl_item = e107::getTemplate('featurebox', 'featurebox', $node->get('fb_template'));
|
$tmpl_item = e107::getTemplate('featurebox', 'featurebox', $node->get('fb_template'));
|
||||||
|
@@ -9,9 +9,9 @@
|
|||||||
* Featurebox Item model
|
* Featurebox Item model
|
||||||
*
|
*
|
||||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/featurebox/includes/item.php,v $
|
* $Source: /cvs_backup/e107_0.8/e107_plugins/featurebox/includes/item.php,v $
|
||||||
* $Revision: 1.4 $
|
* $Revision: 1.5 $
|
||||||
* $Date: 2009-12-11 00:36:30 $
|
* $Date: 2009-12-11 13:11:35 $
|
||||||
* $Author: e107coders $
|
* $Author: secretr $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -103,37 +103,62 @@ class plugin_featurebox_item extends e_model
|
|||||||
return '<a id="featurebox-imageurl-"'.$this->getId().' href="'.$tp->replaceConstants($this->get('fb_imageurl'), 'full').'" title="'.$tp->toAttribute($this->get('fb_title')).'" rel="'.$tp->toAttribute(vartrue($parm['rel'], 'external')).'">'.$tag.'</a>';
|
return '<a id="featurebox-imageurl-"'.$this->getId().' href="'.$tp->replaceConstants($this->get('fb_imageurl'), 'full').'" title="'.$tp->toAttribute($this->get('fb_title')).'" rel="'.$tp->toAttribute(vartrue($parm['rel'], 'external')).'">'.$tag.'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Item counter number (starting from 1)
|
||||||
|
*/
|
||||||
public function sc_featurebox_counter()
|
public function sc_featurebox_counter()
|
||||||
{
|
{
|
||||||
return $this->getParam('counter', 1);
|
return $this->getParam('counter', 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Item limit number
|
||||||
|
*/
|
||||||
public function sc_featurebox_limit()
|
public function sc_featurebox_limit()
|
||||||
{
|
{
|
||||||
return $this->getParam('limit', 0);
|
return $this->getParam('limit', 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Number of items (real) currently loaded
|
||||||
|
*/
|
||||||
public function sc_featurebox_total()
|
public function sc_featurebox_total()
|
||||||
{
|
{
|
||||||
return $this->getParam('total', 0);
|
return $this->getParam('total', 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Total Number of items (no matter of the limit)
|
||||||
|
*/
|
||||||
public function sc_featurebox_all()
|
public function sc_featurebox_all()
|
||||||
{
|
{
|
||||||
return $this->getCategory()->sc_featurebox_category_all();
|
return $this->getCategory()->sc_featurebox_category_all();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Number of items per column
|
||||||
|
*/
|
||||||
public function sc_featurebox_cols()
|
public function sc_featurebox_cols()
|
||||||
{
|
{
|
||||||
return $this->getParam('cols', 1);
|
return $this->getParam('cols', 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Item counter number inside a column (1 to sc_featurebox_cols)
|
||||||
|
*/
|
||||||
public function sc_featurebox_colcount()
|
public function sc_featurebox_colcount()
|
||||||
{
|
{
|
||||||
return $this->getParam('col_counter', 1);
|
return $this->getParam('col_counter', 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Column counter
|
||||||
|
*/
|
||||||
|
public function sc_featurebox_colscount()
|
||||||
|
{
|
||||||
|
return $this->getParam('cols_counter', 1);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set current category
|
* Set current category
|
||||||
* @param plugin_featurebox_category $category
|
* @param plugin_featurebox_category $category
|
||||||
|
@@ -30,15 +30,15 @@ $FEATUREBOX_CATEGORY_TEMPLATE['default']['item_separator'] = '<div class="clear"
|
|||||||
$FEATUREBOX_CATEGORY_TEMPLATE['default']['item_empty'] = '';
|
$FEATUREBOX_CATEGORY_TEMPLATE['default']['item_empty'] = '';
|
||||||
|
|
||||||
// no dynamic load support
|
// no dynamic load support
|
||||||
$FEATUREBOX_CATEGORY_TEMPLATE['default']['nav_start'] = '';
|
//$FEATUREBOX_CATEGORY_TEMPLATE['default']['nav_start'] = '';
|
||||||
$FEATUREBOX_CATEGORY_TEMPLATE['default']['nav_item'] = '';
|
//$FEATUREBOX_CATEGORY_TEMPLATE['default']['nav_item'] = '';
|
||||||
$FEATUREBOX_CATEGORY_TEMPLATE['default']['nav_end'] = '';
|
//$FEATUREBOX_CATEGORY_TEMPLATE['default']['nav_end'] = '';
|
||||||
$FEATUREBOX_CATEGORY_TEMPLATE['default']['nav_separator'] = '';
|
//$FEATUREBOX_CATEGORY_TEMPLATE['default']['nav_separator'] = '';
|
||||||
|
|
||||||
// external JS, comma separated list
|
// external JS, comma separated list
|
||||||
$FEATUREBOX_CATEGORY_TEMPLATE['dynamic']['js'] = '';
|
//$FEATUREBOX_CATEGORY_TEMPLATE['default']['js'] = '';
|
||||||
// inline JS, without <script> tags
|
// inline JS, without <script> tags
|
||||||
$FEATUREBOX_CATEGORY_TEMPLATE['dynamic']['js_inline'] = '';
|
//$FEATUREBOX_CATEGORY_TEMPLATE['default']['js_inline'] = '';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Dynamic Template
|
* Dynamic Template
|
||||||
|
Reference in New Issue
Block a user