Welcome to Geeklog, Anonymous Tuesday, October 04 2022 @ 07:02 am EDT

Geeklog Forums

Usability enhancements to system/lib-admin.php(ADMIN_list)

Status: offline


Forum User
Registered: 10/23/06
Posts: 1
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

Text Formatted Code
line 390 :    $fieldvalue = COM_highlightQuery($A[$fieldname],$_REQUEST['q']); # yes, get its data

Better Searching
When 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);

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.


Status: offline


Site Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Searching without the '*' is already in 1.4.1b1.

bye, Dirk

All times are EDT. The time is now 07:02 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content