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

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

Gets the name of the requested theme and page by checking a series
   of URL parameters, variables, folder attributes, cookies, ...

Definition at line 708 of file PortalThemesTool.py.

00708                                                 :
        """Gets the name of the requested theme and page by checking a series
           of URL parameters, variables, folder attributes, cookies, ...
        """

        REQUEST = self.REQUEST
        FORM = REQUEST.form
        # selected by writing ?pp=1 in the URL
        if FORM.get('pp') == '1':
            return 'printable', None

        # selected by writing ?theme=... in the URL
        # (+page)
        theme = FORM.get('theme')
        page = FORM.get('page')
        if (theme is not None) or (page is not None):
            return self._extractThemeAndPageName(theme, page)

        if int(kw.get('editing', 0)) == 1:
            # session variable (used in edition mode)
            view_mode = self.getViewMode()
            theme = view_mode.get('theme')
            page = view_mode.get('page')
            if (theme is not None) or (page is not None):
                return self._extractThemeAndPageName(theme, page)

        # cookie (theme + page)
        theme_cookie_id = self.getThemeCookieID()
        theme = REQUEST.cookies.get(theme_cookie_id)
        if theme is not None:
            return self._extractThemeAndPageName(theme, None)

        # method themes (theme + page)
        published = REQUEST.get('PUBLISHED')
        if published is not None:
            try:
                published = published.getId()
            except AttributeError:
                pass
            else:
                theme = self.getThemeByMethod(published)
                if theme is not None:
                    return self._extractThemeAndPageName(theme, None)

        # local theme + page
        theme = self.getLocalThemeName(**kw)
        if theme is not None:
            return self._extractThemeAndPageName(theme, None)

        # default theme, page not specified
        return self.getDefaultThemeName(), None

    security.declarePublic('getEffectiveThemeAndPageName')
    def getEffectiveThemeAndPageName(self, **kw):


Generated by  Doxygen 1.6.0   Back to index