Beispiel #1
0
    def __call__(self):
        context = aq_inner(self.context)
        tracked = contentIsTracked(context) is not None
        directlytracked = self.isdirectlytracked()

        if self.request.get('enable', None) is not None and not directlytracked:
            alsoProvides(context, IContentIsTracked)
        elif self.request.get('disable', None) is not None and directlytracked:
            noLongerProvides(context, IContentIsTracked)

        # Avoid tracking the tracking view
        alsoProvides(self.request, IContentIsIgnored)
        return self.index()
Beispiel #2
0
 def tracked(self):
     """ Returns the context in our aq_chain that is tracked, or None. """
     context = aq_inner(self.context)
     return contentIsTracked(context)
Beispiel #3
0
 def enabled(self):
     context = aq_inner(self.context)
     if IContentIsIgnored.providedBy(self.request):
         return False
     return contentIsTracked(context) is not None