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

def CPSSkins::PortalThemesTool::PortalThemesTool::setViewMode (   self,
  reload = 0,
  kw 
)

Sets the current view mode 

Definition at line 181 of file PortalThemesTool.py.

00181                                          :
        """ Sets the current view mode """

        REQUEST = self.REQUEST
        kw.update(REQUEST.form)

        view_params = self.getViewMode()

        fullscreen = kw.get('fullscreen')
        if fullscreen in ['0', '1']:
            view_params['fullscreen'] = int(fullscreen)

        for param in ['themes_panel',
                      'portlets_panel',
                      'selected_portlet',
                      'selected_content',
                      'portlets_override',
                      'edited_url',
                      'clipboard',
                      'theme',
                      'page',
                      'edit_mode',
                      'current_url',
                      'scrollx',
                      'scrolly',
                      'current_url']:
            if kw.has_key(param):
                view_params[param] = kw[param]

        value = serializeForCookie(view_params)
        cookie_path = self.cpsskins_getBaseUrl()

        if len(VIEW_MODE_COOKIE_ID) + len(value) > MAX_COOKIE_LENGTH:
            # XXX: this shouldn't occur buy the cookie value and name length
            # must be less than 4K.
            raise ValueError("CPSSkins.PortalThemesTool.setViewMode: "
                "Cannot store the view mode information in a single cookie.")

        REQUEST.RESPONSE.setCookie(VIEW_MODE_COOKIE_ID, value, path=cookie_path)

        # reload the page
        if reload:
            redirect_url = REQUEST['HTTP_REFERER']
            if '?' in redirect_url:
                redirect_url = redirect_url.split('?')[0]
            REQUEST.RESPONSE.redirect(redirect_url)

    security.declarePublic('clearViewMode')
    def clearViewMode(self, *args):


Generated by  Doxygen 1.6.0   Back to index