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

def CPSSkins::PortalThemesTool::PortalThemesTool::findStylesFor (   self,
  category = None,
  object = None,
  title = None 
)

Gets the list of available styles:
    - by meta type ('category')
    - for a given object ('object')
    - that has a given title ('title') [optional]

Definition at line 282 of file PortalThemesTool.py.

00282                                                                    :
        """ Gets the list of available styles:
            - by meta type ('category')
            - for a given object ('object')
            - that has a given title ('title') [optional]
        """
        style = {}
        title_list = []
        object_list = []
        if object is None:
            return []
        themeroot = self.getPortalThemeRoot(object)
        if themeroot is None:
            return []
        styles_dir = getattr(themeroot, 'styles', None)
        if styles_dir is None:
            return []
        for obj in styles_dir.objectValues():
            if getattr(obj, 'meta_type', None) == category:
                if title:
                    obj_title = obj.getTitle()
                    if obj_title != title:
                        continue
                title_list.append(obj.title)
                object_list.append(obj)
        style['title'] = title_list
        style['object'] = object_list
        return style

    security.declarePublic('listPalettes')
    def listPalettes(self, category=None, object=None):


Generated by  Doxygen 1.6.0   Back to index