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

def CPSSkins::PortalTheme::PortalTheme::addPortalStyle (   self,
  kw 
)

Add a Portal Style. Returns the Portal Style's id

Definition at line 695 of file PortalTheme.py.

00695                                   :
        """Add a Portal Style. Returns the Portal Style's id
        """
        type_name = kw.get('type_name', None)
        if type_name is None:
            return None
        type = string.replace(type_name, ' ', '')
        title = kw.get('title', type)

        del kw['type_name']
        if kw.has_key('title'):
            del kw['title']

        styles_dir = self.getStylesFolder()
        if styles_dir is None:
            return None

        titles = [obj.title for obj in styles_dir.objectValues(type_name)]
        i = 0
        while 1:
            if title not in titles:
                break
            i = i + 1
            title = type + str(i)
            if titles is None:
                break

        id = getFreeId(self)
        styles_dir.invokeFactory(type_name, id, title=title, **kw)
        style = getattr(styles_dir.aq_inner.aq_explicit, id, None)
        if style is not None:
            verifyThemePerms(style)
            self.expireCSSCache()
            return style
        return None

    security.declareProtected(ManageThemes, 'addPortalImage')
    def addPortalImage(self, **kw):


Generated by  Doxygen 1.6.0   Back to index