Re: set_display_context_callback() and incorrect pagination

Mike Miller <[email protected]> Wed, 6 Feb 2013 06:07:47 +0200
Newsgroups gmane.comp.web.gallery.devel
Message-ID <CAGYq59f2oKjXyj=AkHrYf6=uScDcLJa-V5sHxnGZtf-VR959-g@mail.gmail.com>
On Feb 5, 2013 10:56 PM, "Bharat Mediratta" <[email protected]> wrote:
>
>
> Ok, so we need a sliding window of siblings around a fixed point, but the
siblings_callback is returning an iterator over all siblings.  So perhaps
the way to solve this is to extend siblings_callback to handle a limit and
an offset.  Then you can do:
>
>   $theme->siblings($something + 1, $position - $something)
>
> and that'll just iterate over the small set of siblings that you care
about.  How does that sonud?  I can probably get that checked in pretty
quickly if you think that'll work.

Seems reasonable, but I don't have $position in the block (at least, I
don't seem to). can we do something like $theme->siblings($item, -2, 4) to
return everything from two items before to four items after?

Given that I don't know $position, we also need to consider what happens if
more left-siblings or right-siblings are requested than actually exist.

Thanks,
--Mike

------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb

__[ g a l l e r y - d e v e l ]_________________________

[ list info/archive --> http://gallery.sf.net/lists.php ]
[ gallery info/FAQ/download --> http://gallery.sf.net ]