Back to index

plone3  3.1.7
index_html.py
Go to the documentation of this file.
00001 ##parameters=b_start=0
00002 ##
00003 from ZTUtils import Batch
00004 from ZTUtils import LazyFilter
00005 from Products.CMFDefault.utils import decode
00006 
00007 options = {}
00008 
00009 options['has_local'] = 'local_pt' in context.objectIds()
00010 
00011 key, reverse = context.getDefaultSorting()
00012 items = context.contentValues()
00013 items = sequence.sort( items, ((key, 'cmp', reverse and 'desc' or 'asc'),) )
00014 items = LazyFilter(items, skip='View')
00015 batch_obj = Batch(items, 25, b_start, orphan=0)
00016 listItemInfos = context.getBatchItemInfos(batch_obj)
00017 target = context.getActionInfo('object/view')['url']
00018 navigation = context.getBatchNavigation(batch_obj, target)
00019 options['batch'] = { 'listItemInfos': listItemInfos,
00020                      'navigation': navigation }
00021 
00022 return context.index_html_template(**decode(options, script))