Logo Search packages:      
Sourcecode: zope-cmfdynamicviewfti version File versions  Download package

def CMFDynamicViewFTI::browserdefault::BrowserDefaultMixin::getAvailableLayouts (   self  ) 

Get the layouts registered for this object from its FTI.

Definition at line 224 of file browserdefault.py.

00224                                  :
        """Get the layouts registered for this object from its FTI.
        """
        fti = self.getTypeInfo()
        if fti is None:
            return ()
        result = []
        method_ids = fti.getAvailableViewMethods(self)
        for mid in method_ids:
            view = zope.component.queryMultiAdapter((self, self.REQUEST),
                                                    zope.interface.Interface,
                                                    name=mid)

            if view is not None:
                result.append((mid, mid))
            else:
                method = getattr(self, mid, None)
                if method is not None:
                    # a method might be a template, script or method
                    try:
                        title = method.aq_inner.aq_explicit.title_or_id()
                    except AttributeError:
                        title = mid
                    result.append((mid, title))
        return result

InitializeClass(BrowserDefaultMixin)
InitializeClass(BrowserDefaultMixin)


Generated by  Doxygen 1.6.0   Back to index