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

def CPSSkins::PortalThemesTool::PortalThemesTool::manage_setMethodThemes (   self,
  form = {},
  REQUEST = None 
)

Set the method themes

Definition at line 1458 of file PortalThemesTool.py.

01458                                           {}, REQUEST=None):
        """Set the method themes"""

        form = form.copy()
        if REQUEST is not None:
            form.update(REQUEST.form)

        err = ''
        changed = 0
        for k, v in form.items():
            if k.startswith('update_'):
                index = int(k[len('update_'):])
                meth = form['method_%s' % index].strip()
                theme = form['theme_%s' % index].strip()
                theme_container = self.getThemeContainer(theme=theme)
                if theme_container.getId() != theme:
                    err = "WARNING: Theme '%s' not found" % theme
                    continue
                page = form['page_%s' % index].strip()
                page_container = theme_container.getPageContainer(page=page)
                if page_container is None and page != '':
                    err = "WARNING: Page '%s' not found in the '%s' theme" \
                          % (page, theme)
                    page = ''
                theme_page = theme
                if page:
                    theme_page += '+' + page
                self.method_themes[meth] = theme_page
                changed = 1

            if k.startswith('remove_'):
                index = int(k[len('remove_'):])
                meth = form['method_%s' % index]
                del self.method_themes[meth]
                changed = 1

        if changed:
            self._p_changed = 1

        if REQUEST is not None:
            return self.manage_methodThemes(
                manage_tabs_message='Settings updated. %s' % err)

    security.declareProtected(ManageThemes, 'hasExternalEditor')


Generated by  Doxygen 1.6.0   Back to index