Hi All,
In writing a few plugins, I use the call ADMIN_list() quite often to generate a quick table with all the good-stuff, clickable headers, paging, search criteria: neat stuff. In writing these, I have made two changes that I would like to raise for consideration of inclusion to the core-code. If you agree, let me know the best way of submitting the changes.
Highlighting Search Terms for greater user feedback
I was lacking the ability to highlight the search term on the result set to help the user locate the information. I found COM_highlightQuery() and my prayers were answered. I changed:
Text Formatted Code
line 390 : $fieldvalue = $A[$fieldname]; # yes, get its data
to
Text Formatted Code
line 390 : $fieldvalue = COM_highlightQuery($A[$fieldname],$_REQUEST['q']); # yes, get its data
Better SearchingWhen I enter a search term into ADMIN_list() the code behind it wants me to be exact, or use * to go for wild cards, so at the moment 'Aus' will not match 'Australia' unless I type 'Aus*'.
Not sure if I have really fixed this in the right place; it might be better to do so in the SQL, however I have done it in PHP. Comments appreciated if this is a bad thing.
Text Formatted Code
line 275 : $query = str_replace ('*', '%', $query);
to
Text Formatted Code
line 275 : $query = '%' . $query . '%';
so now we wildcard match.
Both of these updates to system/lib-admin.php(ADMIN_list) have made the usability of my plugins much better and I would like these changes to be considered for all GL users. It's now open to you for feedback and if you like it, tell me the process for submission.
Cheers.