Refactor pager_query so pager can be used outside pager_query
douggreen - September 4, 2007 - 19:20
| Project: | Drupal |
| Version: | 7.x-dev |
| Component: | base system |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | patch (code needs review) |
Description
I was working on the z3950 module, which implements hook_search to display content from z39.50 (library) servers. The results being displayed aren't from a Drupal database, so pager_query() can't be used. But, there are lots of results, that can be chunked into pages, and thus should use the Drupal paging system.
The attached patch slightly refactors pager_query, keeping the original functionality intact, but exposes a new function called pager_init() which can be used by contrib modules.
| Attachment | Size |
|---|---|
| pager_5.patch | 2.03 KB |

#1
... removing one extraneous line in patch file
#2
i once did this without a patch: http://cvs.drupal.org/viewvc.py/drupal/contributions/tricks/pager_withou.... that might have bit rotted since then. maybe this patch is useful still - i dunno.
#3
Yes, it can be done without a patch. I'm just proposing some refactoring so that we get a new API function that makes it easier to do. Compared to your "trick" solution, what you get by using the pager call is an additional calculations on page position.
#4
Reroll from root.
D7 fodder?
Reroll brought to you by patch bingo.
#5
If it can be done without API changes, I guess it will be something for D7...