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.

AttachmentSize
pager_5.patch2.03 KB

#1

douggreen - September 4, 2007 - 19:22

... removing one extraneous line in patch file

AttachmentSize
173037.patch2.02 KB

#2

moshe weitzman - September 9, 2007 - 01:27

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

douggreen - September 11, 2007 - 07:48

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

bdragon - October 26, 2007 - 00:22

Reroll from root.
D7 fodder?
Reroll brought to you by patch bingo.

AttachmentSize
173037_4.patch2.08 KB

#5

Pancho - January 11, 2008 - 12:20
Version:6.x-dev» 7.x-dev

If it can be done without API changes, I guess it will be something for D7...

 
 

Drupal is a registered trademark of Dries Buytaert.