Back to index

plone3  3.1.7
topic_view.py
Go to the documentation of this file.
00001 ##parameters=b_start=0
00002 ##
00003 from ZTUtils import Batch
00004 from Products.CMFDefault.utils import decode
00005 
00006 
00007 options = {}
00008 
00009 subtopics = [ {'title': item.Title() or item.getId(),
00010                'url': item.absolute_url()}
00011               for item in context.contentValues() ]
00012 options['listSubtopicInfos'] = subtopics
00013 
00014 queries = context.buildQuery()
00015 options['listQueries'] = tuple([ '%s: %s' % q for q in queries.items() ])
00016 
00017 target = context.REQUEST['ACTUAL_URL']
00018 items = context.queryCatalog()
00019 batch_obj = Batch(items, 20, b_start, orphan=1)
00020 
00021 items = [ {'creators': item.listCreators,
00022            'date': item.Date,
00023            'description': item.Description,
00024            'id': item.getId,
00025            'title': item.Title and ('(%s)' % item.Title) or '',
00026            'url': '%s/view' % item.getURL()}
00027           for item in batch_obj ]
00028 
00029 navigation = context.getBatchNavigation(batch_obj, target)
00030 options['batch'] = {'listItemInfos': items,
00031                     'navigation': navigation}
00032 
00033 return context.topic_view_template(**decode(options, script))