1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 20:58:30 +01:00

featurebox bugfixes

This commit is contained in:
secretr 2009-12-13 10:28:15 +00:00
parent 321e57d58d
commit ddba35bc51
3 changed files with 14 additions and 10 deletions

View File

@ -9,8 +9,8 @@
* Form Handler
*
* $Source: /cvs_backup/e107_0.8/e107_handlers/form_handler.php,v $
* $Revision: 1.97 $
* $Date: 2009-12-12 16:40:40 $
* $Revision: 1.98 $
* $Date: 2009-12-13 10:28:15 $
* $Author: secretr $
*
*/
@ -1359,10 +1359,10 @@ class e_form
$info = array();
if($layouts[1])
{
foreach ($layouts[1] as $key => $info_array)
foreach ($layouts[1] as $k => $info_array)
{
if(isset($info_array['description']))
$info[$key] = defset($info_array['description'], $info_array['description']);
$info[$k] = defset($info_array['description'], $info_array['description']);
}
}

View File

@ -9,8 +9,8 @@
* Featurebox administration
*
* $Source: /cvs_backup/e107_0.8/e107_plugins/featurebox/admin_config.php,v $
* $Revision: 1.14 $
* $Date: 2009-12-12 16:40:41 $
* $Revision: 1.15 $
* $Date: 2009-12-13 10:28:15 $
* $Author: secretr $
*
*/
@ -143,7 +143,7 @@ class fb_category_ui extends e_admin_ui
{
if($this->getModel()->getSqlErrorNumber() == 1062)
{
$templates = $this->getFieldAttr('fb_category_template', 'writeParms', array());
$templates = e107::getLayouts('featurebox', 'featurebox_category', 'front', '', true, false);
$msg = e107::getMessage();
$msg->error('Layout <strong>'.vartrue($templates[$new_data['fb_category_template']], 'n/a').'</strong> is in use by another category. Layout should be unique per category. ');
$msg->error($mod == 'create' ? LAN_CREATED_FAILED : LAN_UPDATED_FAILED);

View File

@ -1,7 +1,7 @@
<?php
/*
* Copyright (c) e107 Inc 2009 - e107.org, Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
* $Id: e_shortcode.php,v 1.11 2009-12-12 16:35:45 secretr Exp $
* $Id: e_shortcode.php,v 1.12 2009-12-13 10:28:15 secretr Exp $
*
* Featurebox shortcode batch class - shortcodes available site-wide. ie. equivalent to multiple .sc files.
*/
@ -104,14 +104,14 @@ class featurebox_shortcodes // must match the plugin's folder name. ie. [PLUGIN_
$tmpl = $this->getFboxTemplate($ctemplate);
if($category->get('fb_category_random'))
{
$parm['loop'] = 0;
unset($parm['loop']);
}
$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');
$cols = $category->getParam('cols', 1);
if(isset($parm['loop']) && $tree->getTotal() > 0 && vartrue($tmpl[$base.'item']))
{
@ -124,6 +124,10 @@ class featurebox_shortcodes // must match the plugin's folder name. ie. [PLUGIN_
elseif(isset($parm['uselimit']))
{
$total = $category->sc_featurebox_category_limit() ? intval($category->sc_featurebox_category_limit()) : $tree->getTotal();
if($total > $tree->getTotal())
{
$total = $tree->getTotal();
}
}
// default - number based on all / limit (usefull for ajax navigation)
else