Back to index

plone3  3.1.7
view.py
Go to the documentation of this file.
00001 from zope.interface import implements
00002 from zope.viewlet.interfaces import IViewlet
00003 
00004 from Products.Five.browser import BrowserView
00005 from Products.CMFCore.utils import getToolByName
00006 from Products.CMFPlone.utils import safe_unicode
00007 
00008 class AnalyticsViewlet(BrowserView):
00009     implements(IViewlet)
00010 
00011     def __init__(self, context, request, view, manager):
00012         super(AnalyticsViewlet, self).__init__(context, request)
00013         self.__parent__ = view
00014         self.context = context
00015         self.request = request
00016         self.view = view
00017         self.manager = manager
00018 
00019     def update(self):
00020         pass
00021 
00022     def render(self):
00023         """render the webstats snippet"""
00024         ptool = getToolByName(self.context, "portal_properties")
00025         snippet = safe_unicode(ptool.site_properties.webstats_js)
00026         return snippet
00027