webmcp

diff framework/env/ui/paginate.lua @ 2:72860d232f32

Version 1.0.2

Fixed bug with explicit garbage collection (requests > 256kB caused an error)

Views prefixed with an underscore can't be called externally

ui.paginate now displays the last page, if the selected page number is too high.
author jbe/bsw
date Thu Dec 10 12:00:00 2009 +0100 (2009-12-10)
parents 985024b16520
children f02e14d1e69e
line diff
     1.1 --- a/framework/env/ui/paginate.lua	Tue Nov 17 12:00:00 2009 +0100
     1.2 +++ b/framework/env/ui/paginate.lua	Thu Dec 10 12:00:00 2009 +0100
     1.3 @@ -25,6 +25,9 @@
     1.4    local count = count_selector:exec().count
     1.5    local page_count = math.floor((count - 1) / per_page) + 1
     1.6    local current_page = atom.integer:load(cgi.params[name]) or 1
     1.7 +  if current_page > page_count then
     1.8 +    current_page = page_count
     1.9 +  end
    1.10    selector:limit(per_page)
    1.11    selector:offset((current_page - 1) * per_page)
    1.12    local id     = param.get_id_cgi()

Impressum / About Us