From f53c68f94d54cb15344b7cbf811ea8f44a61fbc3 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 22 Jan 2007 07:06:15 +0000 Subject: [PATCH] php5.2 fix and ability to return something from the get_rows function --- etemplate/inc/class.nextmatch_widget.inc.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/etemplate/inc/class.nextmatch_widget.inc.php b/etemplate/inc/class.nextmatch_widget.inc.php index 12e029b7e7..6cadec5ce1 100644 --- a/etemplate/inc/class.nextmatch_widget.inc.php +++ b/etemplate/inc/class.nextmatch_widget.inc.php @@ -48,6 +48,7 @@ * 'rows' => // O content set by callback * 'total' => // O the total number of entries * 'sel_options' => // O additional or changed sel_options set by the callback and merged into $tmpl->sel_options + * 'return' => // IO allows to return something from the get_rows function if $query is a var-param! * ); * @package etemplate * @subpackage extensions @@ -223,8 +224,14 @@ } else { - $total = $value['total'] = $obj->$method($value,$value['rows'],$readonlys['rows']); - + if (is_array($readonlys)) + { + $total = $value['total'] = $obj->$method($value,$value['rows'],$readonlys['rows']); + } + else + { + $total = $value['total'] = $obj->$method($value,$value['rows'],$readonlys); + } // allow the get_rows function to override / set sel_options if (isset($value['rows']['sel_options']) && is_array($value['rows']['sel_options'])) { @@ -393,6 +400,7 @@ $old_value = $extension_data; $value['start'] = $old_value['start']; // need to be set, to be reported back + $value['return'] = $old_value['return']; if (is_array($value['bottom'])) // we have a second bottom-bar {