diff --git a/e107_files/e_ajax.php b/e107_files/e_ajax.php index e85c7fea1..fc14e38b4 100644 --- a/e107_files/e_ajax.php +++ b/e107_files/e_ajax.php @@ -1,36 +1,33 @@ replaceConstants($_POST['ajax_scfile']); - $shortcodes = $tp -> e_sc -> parse_scbatch($file); + //include_once(e_HANDLER.'shortcode_handler.php'); + $file = e107::getParser()->replaceConstants($_POST['ajax_scfile']); + $shortcodes = e107::getScParser()->parse_scbatch($file); } if(vartrue($_POST['ajax_sc']) && e_AJAX_REQUEST) diff --git a/e107_files/e_css.php b/e107_files/e_css.php index aac97a111..f62b58075 100644 --- a/e107_files/e_css.php +++ b/e107_files/e_css.php @@ -9,9 +9,9 @@ * Unobtrusive JS support * * $Source: /cvs_backup/e107_0.8/e107_files/e_css.php,v $ - * $Revision: 1.4 $ - * $Date: 2009-11-18 01:04:43 $ - * $Author: e107coders $ + * $Revision: 1.5 $ + * $Date: 2009-12-10 22:46:45 $ + * $Author: secretr $ */ if (!defined('e107_INIT')) { exit; } // No JavaScript support using CSS @@ -40,7 +40,9 @@ echo " button.e-hide-if-js { display: inline; } "; ?> \ No newline at end of file diff --git a/e107_handlers/e107_class.php b/e107_handlers/e107_class.php index 3e32e405f..effc3a219 100644 --- a/e107_handlers/e107_class.php +++ b/e107_handlers/e107_class.php @@ -9,8 +9,8 @@ * e107 Main * * $Source: /cvs_backup/e107_0.8/e107_handlers/e107_class.php,v $ - * $Revision: 1.90 $ - * $Date: 2009-12-09 18:33:43 $ + * $Revision: 1.91 $ + * $Date: 2009-12-10 22:46:45 $ * $Author: secretr $ */ @@ -1369,7 +1369,7 @@ class e107 return self::getRegistry($regPath); } $ret = self::getRegistry($regPath); - return ($ret && is_array($ret) && isset($ret[$key]) ? $ret[$key] : $ret); + return ($ret && is_array($ret) && isset($ret[$key]) ? $ret[$key] : (is_array($ret) ? array() : '')); } /** diff --git a/e107_handlers/js_manager.php b/e107_handlers/js_manager.php index 621a26390..1d0af2136 100644 --- a/e107_handlers/js_manager.php +++ b/e107_handlers/js_manager.php @@ -7,9 +7,9 @@ * GNU General Public License (http://gnu.org). * * $Source: /cvs_backup/e107_0.8/e107_handlers/js_manager.php,v $ - * $Revision: 1.7 $ - * $Date: 2009-11-18 01:49:18 $ - * $Author: marj_nl_fr $ + * $Revision: 1.8 $ + * $Date: 2009-12-10 22:46:45 $ + * $Author: secretr $ * */ global $pref, $eplug_admin, $THEME_JSLIB, $THEME_CORE_JSLIB; @@ -443,6 +443,11 @@ class e_jsmanager { foreach ($file_path as $fp => $loc) { + if(is_numeric($fp)) + { + $fp = $loc; + $loc = $runtime_location; + } $this->addJs($type, $fp, $loc); } return $this; @@ -698,6 +703,8 @@ class e_jsmanager { return ''; } + + $js_content_array = array_unique($js_content_array); //TODO quick fix, we need better control! echo "\n"; if($label) //TODO - print comments only if site debug is on { diff --git a/e107_handlers/model_class.php b/e107_handlers/model_class.php index 97bdf3c06..c794c9280 100644 --- a/e107_handlers/model_class.php +++ b/e107_handlers/model_class.php @@ -9,8 +9,8 @@ * e107 Base Model * * $Source: /cvs_backup/e107_0.8/e107_handlers/model_class.php,v $ - * $Revision: 1.47 $ - * $Date: 2009-12-08 17:21:33 $ + * $Revision: 1.48 $ + * $Date: 2009-12-10 22:46:45 $ * $Author: secretr $ */ @@ -2107,7 +2107,6 @@ class e_tree_model extends e_model { // TODO - $sql->total_results variable type!!! $this->_total = is_integer($sql->total_results) ? $sql->total_results : false; //requires SQL_CALC_FOUND_ROWS in query - see db handler - while($tmp = $sql->db_Fetch()) { $tmp = new $class_name($tmp); diff --git a/e107_handlers/mysql_class.php b/e107_handlers/mysql_class.php index bbcb5a069..582f983c0 100644 --- a/e107_handlers/mysql_class.php +++ b/e107_handlers/mysql_class.php @@ -9,8 +9,8 @@ * mySQL Handler * * $Source: /cvs_backup/e107_0.8/e107_handlers/mysql_class.php,v $ - * $Revision: 1.68 $ - * $Date: 2009-12-02 16:51:00 $ + * $Revision: 1.69 $ + * $Date: 2009-12-10 22:46:46 $ * $Author: secretr $ */ @@ -51,30 +51,33 @@ $db_ConnectionID = NULL; // Stores ID for the first DB connection used - which s * * @package e107 * @category e107_handlers - * @version $Revision: 1.68 $ + * @version $Revision: 1.69 $ * @author $Author: secretr $ * */ class e_db_mysql { - var $mySQLserver; - var $mySQLuser; - var $mySQLpassword; - var $mySQLdefaultdb; - var $mySQLPrefix; - var $mySQLaccess; - var $mySQLresult; - var $mySQLrows; - var $mySQLerror = ''; // Error reporting mode - TRUE shows messages - var $mySQLlastErrNum = 0; // Number of last error - var $mySQLlastErrText; // Text of last error (empty string if no error) - var $mySQLcurTable; - var $mySQLlanguage; - var $mySQLinfo; - var $tabset; - var $mySQLtableList = array(); // list of all Db tables. + // TODO switch to protected vars where needed + public $mySQLserver; + public $mySQLuser; + public $mySQLpassword; + public $mySQLdefaultdb; + public $mySQLPrefix; + public $mySQLaccess; + public $mySQLresult; + public $mySQLrows; + public $mySQLerror = ''; // Error reporting mode - TRUE shows messages + + protected $mySQLlastErrNum = 0; // Number of last error - now protected, use getLastErrNum() + protected $mySQLlastErrText = ''; // Text of last error - now protected, use getLastErrText() + + public $mySQLcurTable; + public $mySQLlanguage; + public $mySQLinfo; + public $tabset; + public $mySQLtableList = array(); // list of all Db tables. - var $mySQLtableListLanguage = array(); // Db table list for the currently selected language + public $mySQLtableListLanguage = array(); // Db table list for the currently selected language /** * MySQL Charset @@ -83,7 +86,7 @@ class e_db_mysql { */ public $mySQLcharset; - var $total_results; // Total number of results + public $total_results = false; // Total number of results /** * Constructor - gets language options from the cookie or session @@ -264,12 +267,13 @@ class e_db_mysql { $db_time += $mytime; $this->mySQLresult = $sQryRes; + $this->total_results = false; if ((strpos($query,'SQL_CALC_FOUND_ROWS') !== FALSE) && (strpos($query,'SELECT') !== FALSE)) { // Need to get the total record count as well. Return code is a resource identifier // Have to do this before any debug action, otherwise this bit gets messed up $fr = mysql_query('SELECT FOUND_ROWS()', $this->mySQLaccess); $rc = mysql_fetch_array($fr); - $this->total_results = $rc['FOUND_ROWS()']; + $this->total_results = (int) $rc['FOUND_ROWS()']; } if (E107_DEBUG_LEVEL) diff --git a/e107_plugins/featurebox/admin_config.php b/e107_plugins/featurebox/admin_config.php index 76499e7f3..6646d090b 100644 --- a/e107_plugins/featurebox/admin_config.php +++ b/e107_plugins/featurebox/admin_config.php @@ -9,8 +9,8 @@ * Featurebox administration * * $Source: /cvs_backup/e107_0.8/e107_plugins/featurebox/admin_config.php,v $ -* $Revision: 1.12 $ -* $Date: 2009-12-09 18:33:40 $ +* $Revision: 1.13 $ +* $Date: 2009-12-10 22:46:45 $ * $Author: secretr $ * */ @@ -160,14 +160,14 @@ class fb_main_ui extends e_admin_ui 'fb_id' => array('title'=> LAN_ID, 'type' => 'number', 'data'=> 'int', 'width' =>'5%', 'forced'=> TRUE), 'fb_category' => array('title'=> LAN_CATEGORY, 'type' => 'dropdown', 'data'=> 'int', 'width' => '5%', 'filter'=>TRUE, 'batch'=>TRUE), 'fb_title' => array('title'=> LAN_TITLE, 'type' => 'text', 'width' => 'auto', 'thclass' => 'left'), - 'fb_text' => array('title'=> "Message Text", 'type' => 'bbarea', 'width' => '30%', 'readParms' => 'expand=...&truncate=50&bb=1'), // Display name + 'fb_text' => array('title'=> "Message Text", 'type' => 'bbarea', 'width' => '30%', 'readParms' => 'expand=...&truncate=50&bb=1'), //DEPRECATED 'fb_mode' => array('title'=> FBLAN_12, 'type' => 'dropdown', 'data'=> 'int', 'width' => '5%', 'filter'=>TRUE, 'batch'=>TRUE), //DEPRECATED 'fb_rendertype' => array('title'=> FBLAN_22, 'type' => 'dropdown', 'data'=> 'int', 'width' => 'auto', 'noedit' => TRUE), - 'fb_template' => array('title'=> FBLAN_25, 'type' => 'layouts', 'data'=> 'str', 'width' => 'auto', 'thclass' => 'center', 'class'=>'center', 'writeParms' => 'plugin=featurebox', 'filter' => true, 'batch' => true), // Photo - 'fb_image' => array('title'=> "Image", 'type' => 'image', 'width' => 'auto', 'thclass' => 'left first'), - 'fb_imageurl' => array('title'=> "Image Link", 'type' => 'url', 'width' => 'auto', 'thclass' => 'left first'), + 'fb_template' => array('title'=> FBLAN_25, 'type' => 'layouts', 'data'=> 'str', 'width' => 'auto', 'writeParms' => 'plugin=featurebox', 'filter' => true, 'batch' => true), // Photo + 'fb_image' => array('title'=> "Image", 'type' => 'image', 'width' => 'auto'), + 'fb_imageurl' => array('title'=> "Image Link", 'type' => 'url', 'width' => 'auto'), 'fb_class' => array('title'=> LAN_VISIBILITY, 'type' => 'userclass', 'data' => 'int', 'width' => 'auto'), // User id - 'fb_order' => array('title'=> LAN_ORDER, 'type' => 'number', 'data'=> 'int','width' => '5%', 'thclass' => 'center' ), + 'fb_order' => array('title'=> LAN_ORDER, 'type' => 'number', 'data'=> 'int','width' => '5%' ), 'options' => array('title'=> LAN_OPTIONS, 'type' => null, 'forced'=>TRUE, 'width' => '10%', 'thclass' => 'center last', 'class' => 'center') ); diff --git a/e107_plugins/featurebox/e_shortcode.php b/e107_plugins/featurebox/e_shortcode.php index da6d5adf7..57bc876cb 100644 --- a/e107_plugins/featurebox/e_shortcode.php +++ b/e107_plugins/featurebox/e_shortcode.php @@ -1,7 +1,7 @@ loadByTemplate($ctemplate); + $category = $this->getCategoryModel($ctemplate); if(!$category->hasData()) { return ''; @@ -63,6 +64,10 @@ class featurebox_shortcodes // must match the plugin's folder name. ie. [PLUGIN_ $counter = 1; $col_counter = 1; $total = count($tree->getTree()); + $category->setParam('total', $total) + ->setParam('cols', $cols) + ->setParam('no_fill_empty', isset($parm['no_fill_empty']) ? 1 : 0); + foreach ($tree->getTree() as $id => $node) { $tmpl_item = e107::getTemplate('featurebox', 'featurebox', $node->get('fb_template')); @@ -94,19 +99,19 @@ class featurebox_shortcodes // must match the plugin's folder name. ie. [PLUGIN_ // else add item separator else { - $tmpl_item .= $ret['item_separator']; + $tmpl_item .= $tmpl['item_separator']; } } // no more items - clean & close else { $empty_cnt = $cols - $col_counter; - if($empty_cnt > 0 && !isset($parm['no_fill_empty'])) + if($empty_cnt > 0 && !$category->getParam('no_fill_empty')) { // empty items fill for ($index = 1; $index <= $empty_cnt; $index++) { - $tmpl_item .= $ret['item_separator'].varset($ret['item_empty'], '
'); + $tmpl_item .= $tmpl['item_separator'].varset($tmpl['item_empty'], ''); } } // add column end @@ -114,6 +119,10 @@ class featurebox_shortcodes // must match the plugin's folder name. ie. [PLUGIN_ } $ret[$counter] = $node->setParam('counter', $counter) + ->setParam('cols', $cols) + ->setParam('col_counter', $col_counter) + ->setParam('limit', $category->get('fb_category_limit')) + ->setParam('total', $total) ->setCategory($category) ->toHTML($tmpl_item); @@ -134,10 +143,8 @@ class featurebox_shortcodes // must match the plugin's folder name. ie. [PLUGIN_ /** * Render featurebox navigation * Available parameters (GET string format) - * - 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 - * - tablestyle (string): mode to be used withtablerender()
, default 'featurebox'
- * - notablestyle (null): if isset - disable tablerender()
+ * - loop (boolean): loop using 'nav_loop' template, default 0
+ * - base (string): template key prefix, default is 'nav'. Example: 'mynav' base key will search templates 'mynav_start', 'mynav_loop', 'mynav_end'.
*
* @param string $parm parameters
* @param string $mod category template
@@ -158,16 +165,13 @@ class featurebox_shortcodes // must match the plugin's folder name. ie. [PLUGIN_
{
$ctemplate = $mod;
}
-
parse_str($parm, $parm);
- $category = new plugin_featurebox_category();
- $category->loadByTemplate($ctemplate);
+ $category = $this->getCategoryModel($ctemplate);
if(!$category->hasData())
{
return '';
}
-
$tree = $category->getItemTree();
if($tree->isEmpty())
{
@@ -175,6 +179,162 @@ class featurebox_shortcodes // must match the plugin's folder name. ie. [PLUGIN_
}
$tmpl = $this->getFboxTemplate($category);
+ if($category->get('fb_category_random'))
+ {
+ $parm['loop'] = 0;
+ }
+
+ $base = vartrue($parm['base'], 'nav').'_';
+ $ret = $category->toHTML(varset($tmpl[$base.'start']), true);
+ if(isset($parm['loop']) && $tree->getTotal() > 0 && vartrue($tmpl[$base.'item']))
+ {
+ $total = ceil($tree->getTotal() / $category->sc_featurebox_category_limit());
+ $model = clone $category;
+ $tmp = array();
+ for ($index = 1; $index <= $total; $index++)
+ {
+ $tmp[] = $model->setParam('counter', $index)
+ ->setParam('active', $index == varset($parm['from'], 1))
+ ->toHTML($tmpl[$base.'item'], true);
+ }
+ $ret .= implode(varset($tmpl[$base.'separator']), $tmp);
+ unset($model, $tmp);
+ }
+ $ret .= $category->toHTML(varset($tmpl[$base.'end']), true);
+
+ if(vartrue($tmpl['js']))
+ {
+ e107::getJs()->footerFile(explode(',', $tmpl['js']));
+ }
+
+ if(vartrue($tmpl['js_inline']))
+ {
+ e107::getJs()->footerInline($tmpl['js_inline'], 3);
+ }
+
+ return $ret;
+ }
+
+ /**
+ * Render featurebox navigation
+ * Available parameters (GET string format)
+ * - 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
+ * - from (integer): start load at
+ * - limit (integer): load to
+ *
+ * @param string $parm parameters
+ * @param string $mod category template
+ */
+ function sc_featurebox_items($parm, $mod = '')
+ {
+ // TODO cache
+ if(!e107::isInstalled('featurebox')) //just in case
+ {
+ return '';
+ }
+
+ if(!$mod)
+ {
+ $ctemplate = 'default';
+ }
+ else
+ {
+ $ctemplate = $mod;
+ }
+
+ parse_str($parm, $parm);
+
+ $category = clone $this->getCategoryModel($ctemplate);
+
+ if(!$category->hasData())
+ {
+ return '';
+ }
+
+ $cols = intval(vartrue($parm['cols'], 1));
+ $limit = intval(varset($parm['limit'], $category->sc_featurebox_category_limit()));
+ $from = (intval(vartrue($parm['from'], 1)) - 1) * $cols;
+
+ $category->setParam('cols', $cols)
+ ->setParam('no_fill_empty', isset($parm['no_fill_empty']) ? 1 : 0)
+ ->setParam('limit', $limit)
+ ->setParam('from', $from);
+
+ $tree = $category->getItemTree(true);
+ if($tree->isEmpty())
+ {
+ return '';
+ }
+
+ $total = count($tree->getTree());
+ $category->setParam('total', $total);
+ $counter = 1;
+ $col_counter = 1;
+ $ret = '';
+ foreach ($tree->getTree() as $id => $node)
+ {
+ $tmpl_item = e107::getTemplate('featurebox', 'featurebox', $node->get('fb_template'));
+ if(!$tmpl_item)
+ {
+ $tmpl_item = e107::getTemplate('featurebox', 'featurebox', 'default');
+ }
+
+ // reset column counter
+ if($col_counter > $cols)
+ {
+ $col_counter = 1;
+ }
+
+ // add column start
+ if(1 == $col_counter && vartrue($tmpl['col_start']))
+ {
+ $tmpl_item = $tmpl['col_start'].$tmpl_item;
+ }
+
+ // there is more
+ if(($total - $counter) > 0)
+ {
+ // add column end if column end reached
+ if($cols == $col_counter && vartrue($tmpl['col_end']))
+ {
+ $tmpl_item .= $tmpl['col_end'];
+ }
+ // else add item separator
+ else
+ {
+ $tmpl_item .= $tmpl['item_separator'];
+ }
+ }
+ // no more items - clean & close
+ else
+ {
+ $empty_cnt = $cols - $col_counter;
+ if($empty_cnt > 0 && !$category->getParam('no_fill_empty'))
+ {
+ // empty items fill
+ for ($index = 1; $index <= $empty_cnt; $index++)
+ {
+ $tmpl_item .= $tmpl['item_separator'].varset($tmpl['item_empty'], '');
+ }
+ }
+ // add column end
+ $tmpl_item .= varset($tmpl['col_end']);
+ }
+
+ $ret .= $node->setParam('counter', $counter)
+ ->setParam('cols', $cols)
+ ->setParam('col_counter', $col_counter)
+ ->setParam('limit', $category->get('fb_category_limit'))
+ ->setParam('total', $total)
+ ->setCategory($category)
+ ->toHTML($tmpl_item);
+
+
+ $counter++;
+ $col_counter++;
+ }
+ return $ret;
}
/**
@@ -200,4 +360,19 @@ class featurebox_shortcodes // must match the plugin's folder name. ie. [PLUGIN_
}
return $tmpl;
}
+
+ /**
+ * Get category model by template
+ * @param string $template
+ * @return plugin_featurebox_category
+ */
+ public function getCategoryModel($template, $force = false)
+ {
+ if(!isset($this->_categories[$template]))
+ {
+ $this->_categories[$template] = new plugin_featurebox_category();
+ $this->_categories[$template]->loadByTemplate($template, $force);
+ }
+ return $this->_categories[$template];
+ }
}
diff --git a/e107_plugins/featurebox/featurebox.js b/e107_plugins/featurebox/featurebox.js
new file mode 100644
index 000000000..9942c840c
--- /dev/null
+++ b/e107_plugins/featurebox/featurebox.js
@@ -0,0 +1,128 @@
+/*
+ * e107 website system
+ *
+ * Copyright (C) 2008-2009 e107 Inc (e107.org)
+ * Released under the terms and conditions of the
+ * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
+ *
+ * Featurebox Javascript Class
+ *
+ * $Source: /cvs_backup/e107_0.8/e107_plugins/featurebox/featurebox.js,v $
+ * $Revision: 1.1 $
+ * $Date: 2009-12-10 22:46:45 $
+ * $Author: secretr $
+ *
+*/
+
+// Temporary solution, will be moved to e107Widgets
+var Featurebox = Class.create({
+
+ initialize: function(container, options) {
+ this._container = $(container);
+ if(!this._container) return;
+
+ this.options = Object.extend({
+ 'ajax_container': null,
+ 'ajax_navbar': null,
+ 'ajax_nav_selector': 'a.featurebox-nav-link',
+ 'ajax_loader': null,
+ 'ajax_hide_onload': false,
+ 'continuous': false,
+ 'ajax_url': '#{e_FILE}'.parsePath() + 'e_ajax.php'
+ }, options || {});
+
+ this._ajax_container = this.options.ajax_container && $(this.options.ajax_container) ? $(this.options.ajax_container) : this._container.down('.body');
+ this._ajax_navbar = this.options.ajax_navbar && $(this.options.ajax_navbar) ? $(this.options.ajax_navbar) : this._container.down('.featurebox-nav');
+ this._ajax_loader = this.options.ajax_loader && $(this.options.ajax_loader) ? $(this.options.ajax_loader) : this._container.down('.featurebox-loader');
+ this._current = $A();
+
+ if(!this._ajax_container || !this._ajax_navbar) return;
+ this._ajax_nav = this._ajax_navbar.select(this.options.ajax_nav_selector);
+
+ this.clickObserverHandler = this.clickObserver.bindAsEventListener(this);
+ this.nextObserverHandler = this.nextObserver.bindAsEventListener(this);
+ this.prevObserverHandler = this.prevObserver.bindAsEventListener(this);
+
+ this.startObserve();
+ },
+
+ clickObserver: function(event) {
+ var element = event.element('a');
+ event.stop();
+ this.run(element);
+ },
+
+ nextObserver: function(event) {
+ event.stop();
+ var current = this._current[1] ? parseInt(this._current[1]) : 1,
+ next = current >= this._ajax_nav.length ? 0 : current;
+ if(!this.options.continuous && next == 0) return;
+ this.run(this._ajax_nav[next]);
+ },
+
+ prevObserver: function(event) {
+ event.stop();
+ var current = this._current[1] ? parseInt(this._current[1]) : 1,
+ prev = (current - 2) < 0 ? this._ajax_nav.length - 1 : current - 2;
+ if(!this.options.continuous && prev == this._ajax_nav.length - 1) return;
+ this.run(this._ajax_nav[prev]);
+ },
+
+ run: function(element) {
+ var options = element.href.split('#',2)[1].split('.'), that;
+ this._current = options;
+
+ if(element.hasClassName('active')) return;
+
+ this._ajax_navbar.select('.active').invoke('removeClassName', 'active');
+ element.addClassName('active');
+ if(element.up('li')) {
+ element.up('li').addClassName('active'); // only li support at this time
+ }
+
+ this.showLoader();
+ that = this;
+ new e107Ajax.Request(this.options.ajax_url, {
+ parameters: {
+ 'ajax_sc': 'featurebox_items|' + varset(options[0], '') + '=from=' + varset(options[1], 0) + '&cols=' + varset(options[2], 0) + '&no_fill_empty=' + varset(options[3], 0)
+ },
+ method: 'post',
+ onComplete: function(transport) {
+ that.hideLoader(transport.responseText);
+ }
+ });
+ },
+
+ startObserve: function() {
+ this._ajax_navbar.select('a.featurebox-nav-link').invoke('observe', 'click', this.clickObserverHandler);
+ this._ajax_navbar.select('a.featurebox-nav-next').invoke('observe', 'click', this.nextObserverHandler);
+ this._ajax_navbar.select('a.featurebox-nav-prev').invoke('observe', 'click', this.prevObserverHandler);
+ },
+
+ stopObserve: function() {
+ this._ajax_navbar.select('a.featurebox-nav-link').invoke('stopObserving', 'click', this.clickObserverHandler);
+ this._ajax_navbar.select('a.featurebox-nav-next').invoke('stopObserving', 'click', this.nextObserverHandler);
+ this._ajax_navbar.select('a.featurebox-nav-prev').invoke('stopObserving', 'click', this.prevObserverHandler);
+ },
+
+ showLoader: function() {
+ if(this._ajax_loader) {
+ if(this.options.ajax_hide_onload) {
+ this._ajax_container.hide();
+ }
+ this._ajax_loader.show();
+ }
+ this.stopObserve();
+ },
+
+ hideLoader: function(text) {
+ if(this._ajax_loader) {
+ this._ajax_loader.hide();
+ if(this.options.ajax_hide_onload) {
+ this._ajax_container.show();
+ }
+ }
+ this._ajax_container.update(text);
+ this.startObserve();
+ }
+});
\ No newline at end of file
diff --git a/e107_plugins/featurebox/includes/category.php b/e107_plugins/featurebox/includes/category.php
index d58af35e1..002c65d97 100644
--- a/e107_plugins/featurebox/includes/category.php
+++ b/e107_plugins/featurebox/includes/category.php
@@ -9,8 +9,8 @@
* Featurebox Category model
*
* $Source: /cvs_backup/e107_0.8/e107_plugins/featurebox/includes/category.php,v $
-* $Revision: 1.3 $
-* $Date: 2009-12-09 18:36:32 $
+* $Revision: 1.4 $
+* $Date: 2009-12-10 22:46:45 $
* $Author: secretr $
*
*/
@@ -78,8 +78,44 @@ class plugin_featurebox_category extends e_model
public function sc_featurebox_category_template()
{
- return $this->get('');
+ return $this->get('fb_category_template');
}
+
+ public function sc_featurebox_category_limit()
+ {
+ return $this->get('fb_category_limit');
+ }
+
+ public function sc_featurebox_category_total()
+ {
+ return $this->getParam('total', 0);
+ }
+
+ public function sc_featurebox_category_all()
+ {
+ return $this->getItemTree()->getTotal();
+ }
+
+ public function sc_featurebox_category_cols()
+ {
+ return $this->getParam('cols', 1);
+ }
+
+ public function sc_featurebox_nav_counter()
+ {
+ return $this->getParam('counter', 1);
+ }
+
+ public function sc_featurebox_nav_active()
+ {
+ return $this->getParam('active') ? ' active' : '';
+ }
+
+ public function sc_featurebox_category_emptyfill()
+ {
+ return $this->getParam('no_fill_empty', 0);
+ }
+
/**
* Load category data by layout
* TODO - system cache
@@ -116,6 +152,7 @@ class plugin_featurebox_category extends e_model
$this->_tree = new plugin_featurebox_tree();
$options = array(
'limit' => $this->getParam('limit', $this->get('fb_category_limit')),
+ 'from' => $this->getParam('from', 0),
'random' => $this->getParam('random', $this->get('fb_category_random'))
);
$this->_tree->load($this->getId(), $options, $force);
diff --git a/e107_plugins/featurebox/includes/item.php b/e107_plugins/featurebox/includes/item.php
index f995dd1ef..ef37e102d 100644
--- a/e107_plugins/featurebox/includes/item.php
+++ b/e107_plugins/featurebox/includes/item.php
@@ -9,8 +9,8 @@
* Featurebox Item model
*
* $Source: /cvs_backup/e107_0.8/e107_plugins/featurebox/includes/item.php,v $
-* $Revision: 1.2 $
-* $Date: 2009-12-08 17:21:32 $
+* $Revision: 1.3 $
+* $Date: 2009-12-10 22:46:45 $
* $Author: secretr $
*
*/
@@ -103,6 +103,32 @@ class plugin_featurebox_item extends e_model
return $this->getParam('counter', 1);
}
+ public function sc_featurebox_limit()
+ {
+ return $this->getParam('limit', 0);
+ }
+
+ public function sc_featurebox_total()
+ {
+ return $this->getParam('total', 0);
+ }
+
+ public function sc_featurebox_all()
+ {
+ return $this->getCategory()->sc_featurebox_category_all();
+ }
+
+ public function sc_featurebox_cols()
+ {
+ return $this->getParam('cols', 1);
+ }
+
+
+ public function sc_featurebox_colcount()
+ {
+ return $this->getParam('col_counter', 1);
+ }
+
/**
* Set current category
* @param plugin_featurebox_category $category
diff --git a/e107_plugins/featurebox/includes/tree.php b/e107_plugins/featurebox/includes/tree.php
index eb349b319..6a9b9080e 100644
--- a/e107_plugins/featurebox/includes/tree.php
+++ b/e107_plugins/featurebox/includes/tree.php
@@ -9,8 +9,8 @@
* Featurebox Category Tree model
*
* $Source: /cvs_backup/e107_0.8/e107_plugins/featurebox/includes/tree.php,v $
-* $Revision: 1.2 $
-* $Date: 2009-12-08 17:21:32 $
+* $Revision: 1.3 $
+* $Date: 2009-12-10 22:46:45 $
* $Author: secretr $
*
*/
@@ -42,7 +42,7 @@ class plugin_featurebox_tree extends e_tree_model
$this->updateParams($options);
$order = $this->getParam('random') ? ' ORDER BY rand()' : ' ORDER BY fb_order ASC';
- $limit = $this->getParam('limit') ? ' LIMIT 0,'.intval($this->getParam('limit')) : '';
+ $limit = $this->getParam('limit') ? ' LIMIT '.intval($this->getParam('from'), 0).','.intval($this->getParam('limit')) : '';
$qry = 'SELECT SQL_CALC_FOUND_ROWS * FROM #featurebox WHERE fb_category='.intval($category_id).' AND fb_class IN('.USERCLASS_LIST.')'.$order.$limit;
$this->setParam('db_query', $qry);
diff --git a/e107_plugins/featurebox/templates/featurebox_category_template.php b/e107_plugins/featurebox/templates/featurebox_category_template.php
index a66cffe8b..9d9e19b91 100644
--- a/e107_plugins/featurebox/templates/featurebox_category_template.php
+++ b/e107_plugins/featurebox/templates/featurebox_category_template.php
@@ -23,43 +23,62 @@ $FEATUREBOX_CATEGORY_TEMPLATE['default']['col_start'] = '';
$FEATUREBOX_CATEGORY_TEMPLATE['default']['col_end'] = '';
$FEATUREBOX_CATEGORY_TEMPLATE['default']['item_start'] = '';
-
$FEATUREBOX_CATEGORY_TEMPLATE['default']['item_end'] = '';
+$FEATUREBOX_CATEGORY_TEMPLATE['default']['item_separator'] = '';
// empty item - used with col templates, no shortcodes just basic markup
$FEATUREBOX_CATEGORY_TEMPLATE['default']['item_empty'] = '';
-$FEATUREBOX_CATEGORY_TEMPLATE['default']['item_separator'] = '';
+// no dynamic load support
+$FEATUREBOX_CATEGORY_TEMPLATE['default']['nav_start'] = '';
+$FEATUREBOX_CATEGORY_TEMPLATE['default']['nav_item'] = '';
+$FEATUREBOX_CATEGORY_TEMPLATE['default']['nav_end'] = '';
+$FEATUREBOX_CATEGORY_TEMPLATE['default']['nav_separator'] = '';
+// external JS, comma separated list
+$FEATUREBOX_CATEGORY_TEMPLATE['dynamic']['js'] = '';
+// inline JS, without