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

def CPSSkins::PortalThemesTool::PortalThemesTool::manage_addExternalTheme (   self,
  themeid = None,
  themeurl = None,
  REQUEST = None 
)

Adds an external theme

Definition at line 1274 of file PortalThemesTool.py.

                                             :
        """
        Adds an external theme
        """

        msg = ''
        error = 0
        externalthemes = self.externalthemes

        themeids = [t['themeid'] for t in externalthemes]
        if not themeid.isalnum():
            msg += '\n- The theme ID is invalid'
            error = 1

        if themeid in themeids:
            msg += '\n- The theme ID is already in use'
            error = 1

        if not (themeurl.startswith('http://') or \
                themeurl.startswith('https://') or \
                themeurl.startswith('ftp://')):
            msg += '\n- The theme URL must start with \
                    http://, https:// or ftp:// ...'
            error = 1

        if not error:
            externalthemes = self.getExternalThemes()
            externalthemes.append({'themeid': themeid,
                                   'themeurl': themeurl,
                                   'updated': '',
                                   'status': STATUS_NO_THEME_INFO})
            self.externalthemes = externalthemes
            msg = 'Settings updated'

        if error:
            msg = 'ERROR:' + msg

        if REQUEST is not None:
            REQUEST.RESPONSE.redirect(self.absolute_url() + \
                '/manage_externalThemes?manage_tabs_message=' + msg)

    security.declareProtected(ManageThemes, 'installExternalTheme')
    def installExternalTheme(self, theme=None, REQUEST=None):


Generated by  Doxygen 1.6.0   Back to index