1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 12:48:24 +01:00

AdminUI: Fixes conflict between custom 'filter' dropdown and 'search' input. New method format added for custom search field processing independent of "Filter" processing. See handleListBanlistIpSearch() for an example.

This commit is contained in:
Cameron 2019-12-05 10:44:59 -08:00
parent 1ff3dd0f8d
commit 4bf21cbaa5
2 changed files with 8 additions and 7 deletions

View File

@ -144,10 +144,10 @@ class banlist_ui extends e_admin_ui
//
/**
* Custom filter for banlist_ip filter search.
* Custom search field handling for banlist_ip.
* @param string $srch
*/
function handleListBanlistIpFilter($srch)
function handleListBanlistIpSearch($srch)
{
$ret = array(
"banlist_ip = '".$srch."'"

View File

@ -4227,15 +4227,16 @@ class e_admin_controller_ui extends e_admin_controller
if(trim($searchQuery) !== '' && in_array($var['type'], $searchable_types) && $var['__tableField'])
{
// Search for customer filter handler.
$cutomerFilterMethod = 'handle'.$this->getRequest()->getActionName().$this->getRequest()->camelize($key).'Filter';
$cutomerSearchMethod = 'handle'.$this->getRequest()->getActionName().$this->getRequest()->camelize($key).'Search';
$args = array($tp->toDB($request->getQuery('searchquery', '')));
e107::getMessage()->addDebug("Searching for custom filter method: ".$className.'::'.$cutomerFilterMethod."(".implode(', ', $args).")");
if(method_exists($this, $cutomerFilterMethod)) // callback handling
e107::getMessage()->addDebug("Searching for custom search method: ".$className.'::'.$cutomerSearchMethod."(".implode(', ', $args).")");
if(method_exists($this, $cutomerSearchMethod)) // callback handling
{
e107::getMessage()->addDebug('Executing filter callback <strong>'.$className.'::'.$cutomerFilterMethod.'('.implode(', ', $args).')</strong>');
e107::getMessage()->addDebug('Executing custom search callback <strong>'.$className.'::'.$cutomerSearchMethod.'('.implode(', ', $args).')</strong>');
$filter[] = call_user_func_array(array($this, $cutomerFilterMethod), $args);
$filter[] = call_user_func_array(array($this, $cutomerSearchMethod), $args);
continue;
}