Пример #1
0
 def __init__(self, id, title, abstract, body, publish_date=None,
              blogitemurl='', abstract_display_format='html',
              body_display_format='html', category = None):
     """ init """
     BaseContent.__init__(self, id, title, abstract = abstract, 
                          body = body, publish_date = publish_date)
     self.setCategory(category) 
Пример #2
0
 def editBlogItem(self, title=None, abstract=None,
                  body=None, publish_date=None,
                  abstract_display_format=None,
                  body_display_format=None,
                  blogitemurl=None, category = None,
                  REQUEST=None):
     """ save changes to the blog item """
     if blogitemurl is not None:
         if blogitemurl.startswith('http://http'):
             blogitemurl = blogitemurl[len('http://'):]
         if blogitemurl.startswith('http'):
             parsed = urlparse(blogitemurl)
             assert parsed[1], "URL has no domain"                
         self.blogitemurl = blogitemurl        
     if category is not None:
         self.setCategory(category)
     #Update base attributes, render and reindex
     BaseContent.editBaseContent(self, title = title, abstract = abstract, 
                                 body = body, publish_date = publish_date, 
                                 abstract_display_format = abstract_display_format,
                                 body_display_format = body_display_format)        
     if REQUEST is not None:
         msg = "New details saved"
         url = self.absolute_url()+'/editBlogItemForm'
         self.http_redirect(url, msg=msg)        
Пример #3
0
 def editPage(self, title=None, abstract=None, body=None, publish_date=None, 
              REQUEST=None):
     """
     Update the body of the page
     """
     #Update base attributes and reindex
     BaseContent.editBaseContent(self, title = title, abstract = abstract,
                                 body = body, publish_date = publish_date)
     if REQUEST is not None:
         msg = "New details saved"
         url = self.getRootURL()+'/PagesManagementHome'
         self.http_redirect(url, msg=msg)
Пример #4
0
 def editFAQ(self, title = None, abstract = None,
             body = None, publish_date = None,
             category = None, REQUEST = None):
     """
     Edit FAQ item
     """      
     if category is not None:
         self.setCategory(category)
     #Update base attributes, render and reindex
     BaseContent.editBaseContent(self, title = title, abstract = abstract, 
                                 body = body, publish_date = publish_date)        
     if REQUEST is not None:
         msg = "New details saved"
         url = self.getContiner().absolute_url()+'/FAQManagement'
         self.http_redirect(url, msg=msg)