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

def CPSSkins::PortalThemesTool::PortalThemesTool::getEffectiveThemeAndPageName (   self,
  kw 
)

Get the name of the effective theme and page, i.e. a requested
theme that effectively exists and a page existing in this theme.
Otherwise return the name of the default theme and of the default page.

Definition at line 761 of file PortalThemesTool.py.

00761                                                 :
        """Get the name of the effective theme and page, i.e. a requested
        theme that effectively exists and a page existing in this theme.
        Otherwise return the name of the default theme and of the default page.
        """
        REQUEST = self.REQUEST

        # get the cached value
        if 'cpsskins_effective_theme_page' in REQUEST:
            return REQUEST['cpsskins_effective_theme_page']

        theme, page = self.getRequestedThemeAndPageName(**kw)
        # theme
        if theme not in self.getThemeNames():
            theme = self.getDefaultThemeName()
        # page
        theme_container = self.getThemeContainer(theme)
        if page not in theme_container.getPageNames():
            page = theme_container.getDefaultPageName()

        # the theme has no page - use the default theme
        if page is None:
            theme = self.getDefaultThemeName()
            theme_container = self.getThemeContainer(theme)
            page = theme_container.getDefaultPageName()

        # cache the information in the request
        REQUEST['cpsskins_effective_theme_page'] = theme, page

        return theme, page

    security.declarePublic('getThemes')
    def getThemes(self):


Generated by  Doxygen 1.6.0   Back to index