Beispiel #1
0
    def _process(self):
        if self._target.isClosed():
            return conferences.WPConferenceModificationClosed(
                self, self._target).display()
        else:
            if self.__templateId and self.__templateData and not self.__deleteTemplateId:
                if self.__new:
                    # template is new
                    self._target.getPosterTemplateManager().storeTemplate(
                        self.__templateId, self.__templateData)
                    key = "tempBackground-%s-%s" % (self._conf.id,
                                                    self.__templateId)
                    filePaths = session.get(key)
                    if filePaths:
                        for filePath in filePaths:
                            self._target.getPosterTemplateManager(
                            ).getTemplateById(
                                self.__templateId).addTempBackgroundFilePath(
                                    filePath[0], filePath[1])
                        self._target.getPosterTemplateManager(
                        ).getTemplateById(
                            self.__templateId).archiveTempBackgrounds(
                                self._conf)
                else:
                    # template already exists
                    self._target.getPosterTemplateManager().storeTemplate(
                        self.__templateId, self.__templateData)
            elif self.__deleteTemplateId:
                self._target.getPosterTemplateManager().deleteTemplate(
                    self.__deleteTemplateId)
            elif self.__copyTemplateId:
                self._target.getPosterTemplateManager().copyTemplate(
                    self.__copyTemplateId)
            elif self.__cancel:
                if self._target.getPosterTemplateManager().hasTemplate(
                        self.__templateId):
                    self._target.getPosterTemplateManager().getTemplateById(
                        self.__templateId).deleteTempBackgrounds()
                else:
                    fkey = "tempBackground-%s-%s" % (self._conf.id,
                                                     self.__templateId)
                    session.pop(fkey, None)

            if self._target.getId() == "default":
                p = admins.WPPosterTemplates(self)
                url = urlHandlers.UHPosterTemplates.getURL()
            else:
                p = conferences.WPConfModifPosterPrinting(self, self._target)
                url = urlHandlers.UHConfModifPosterPrinting.getURL(
                    self._target)
            if request.method == 'POST':
                self._redirect(url)
            else:
                return p.display()
Beispiel #2
0
 def _process( self ):
     p = adminPages.WPPosterTemplates(self)
     return p.display()