diff --git a/e107_handlers/form_handler.php b/e107_handlers/form_handler.php index bc2644202..d54f41bdf 100644 --- a/e107_handlers/form_handler.php +++ b/e107_handlers/form_handler.php @@ -9,8 +9,8 @@ * Form Handler * * $Source: /cvs_backup/e107_0.8/e107_handlers/form_handler.php,v $ - * $Revision: 1.53 $ - * $Date: 2009-10-22 23:46:49 $ + * $Revision: 1.54 $ + * $Date: 2009-10-23 04:25:13 $ * $Author: e107coders $ * */ @@ -713,12 +713,21 @@ class e_form { $text = ""; - // FIXME - Temporary solution, we really need to add parse_str() support - $tmp = explode(".", ($requeststr ? $requeststr : e_QUERY)); - $etmp = explode(".", $querypattern); + // Recommended pattern: ?mode=list&fld=[FIELD]&asc=[ASC]&frm=[FROM] + + if(strpos($querypattern,'&')!==FALSE) + { + $tmp = $_GET; // we can assume it's always $_GET since that's what it will generate + $etmp = array(); + parse_str($querypattern,$etmp); + } + else // Legacy Queries. eg. main.[FIELD].[ASC].[FROM] + { + $tmp = explode(".", ($requeststr ? $requeststr : e_QUERY)); + $etmp = explode(".", $querypattern); + } + - // Note: this function should probably be adapted to ALSO deal with $_GET. eg. ?mode=main&field=user_name&asc=desc&from=100 - // or as a pattern: ?mode=main&field=[FIELD]&asc=[ASC]&from=[FROM] foreach($etmp as $key => $val) // I'm sure there's a more efficient way to do this, but too tired to see it right now!. { @@ -737,6 +746,9 @@ class e_form $fromval = $tmp[$key]; } } + + + if(!varset($fromval)){ $fromval = 0; } @@ -757,7 +769,7 @@ class e_form $val['url'] = e_SELF."?".str_replace($srch,$repl,$querypattern); } - $text .= (varset($val['url'])) ? "" : ""; // Really this column-sorting link should be auto-generated, or be autocreated via unobtrusive js. + $text .= (varset($val['url'])) ? "" : ""; // Really this column-sorting link should be auto-generated, or be autocreated via unobtrusive js. $text .= $val['title']; $text .= ($val['url']) ? "" : ""; $text .= ($key == "options") ? $this->columnSelector($fieldarray,$columnPref) : ""; diff --git a/e107_handlers/model_class.php b/e107_handlers/model_class.php index 97ac2bd69..419934da8 100644 --- a/e107_handlers/model_class.php +++ b/e107_handlers/model_class.php @@ -9,9 +9,9 @@ * e107 Base Model * * $Source: /cvs_backup/e107_0.8/e107_handlers/model_class.php,v $ - * $Revision: 1.20 $ - * $Date: 2009-10-22 14:18:18 $ - * $Author: secretr $ + * $Revision: 1.21 $ + * $Date: 2009-10-23 04:25:13 $ + * $Author: e107coders $ */ if (!defined('e107_INIT')) { exit; } @@ -1716,24 +1716,32 @@ class e_model_interface $frm = e107::getForm(); $mes = e107::getMessage(); $pref = e107::getConfig()->getPref(); - + $tp = e107::getParser(); + + $amount = 20; // do we hardcode or let the plugin developer decide.. OR - a pref in admin? + $from = vartrue($_GET['frm']) ? $_GET['frm'] : 0; //TODO sanitize?. $text = "