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

Admin-ui Allowed for searching of multiple words across different fields.

This commit is contained in:
Cameron 2019-04-09 16:52:29 -07:00
parent c9aa5e188b
commit da0bc6dcb9
2 changed files with 28 additions and 3 deletions

View File

@ -4190,8 +4190,32 @@ class e_admin_controller_ui extends e_admin_controller
}
// Continue below for BC check also.
}
$filter[] = $var['__tableField']." LIKE '%".$searchQuery."%'";
if(strpos($searchQuery, " ") !==false) // search multiple words across fields.
{
$tmp = explode(" ", $searchQuery);
if(count($tmp) < 4) // avoid excessively long query.
{
foreach($tmp as $splitSearchQuery)
{
if(!empty($splitSearchQuery))
{
$filter[] = $var['__tableField']." LIKE '%".$splitSearchQuery."%'";
}
}
}
else
{
$filter[] = $var['__tableField']." LIKE '%".$searchQuery."%'";
}
}
else
{
$filter[] = $var['__tableField']." LIKE '%".$searchQuery."%'";
}
if($isfilter)
@ -6877,7 +6901,7 @@ class e_admin_form_ui extends e_form
parse_str($input_options, $input_options);
}
$input_options['id'] = false;
$input_options['class'] = 'tbox input-text filter ';
$input_options['class'] = 'tbox input-text filter input-xlarge ';
$controller = $this->getController();
$filter_pre = vartrue($controller->preFiliterMarkup);
$filter_post = vartrue($controller->postFiliterMarkup);

View File

@ -183,6 +183,7 @@ table label.checkbox { margin-left: 20px }
#admin-ui-list-batch { padding: 10px 15px }
#admin-ui-list-batch img { padding-top:5px }
#admin-ui-list-filter { margin-bottom: 15px }
#admin-ui-list-search #searchquery { padding-right:5px }
#admin-ui-list-search:before { content: "\f002"; margin-left:12px; position:absolute; top: 50%; transform: translateY(-50%); font-family: "FontAwesome" }
.form-control-feedback-left { left:0; top:0 }