Logo Search packages:      
Sourcecode: zope-coreblog version File versions

def zope-coreblog-1.0::Entry::Entry::checkCommentValues (   self,
  title,
  author,
  body,
  moderated,
  email = "",
  url = "",
  REQUEST = None 
)

Preview a comment 

Definition at line 424 of file Entry.py.

00424                                                                                          :
        """ Preview a comment """
        #chech input values
        cb = self.blog()

        v_h = cb.removeHTML
        v_c = cb.validateCommentBody

        REQUEST.form["show_worning"] = 0

        #name
        if cb.hasProperty("require_name") and cb.getProperty("require_name") == 1 and \
                not v_h(REQUEST.form["author"]):
            REQUEST.form["show_worning"] = REQUEST.form["show_worning"] + 1
            REQUEST.form["name_required"] = 1

        #email
        if cb.hasProperty("require_email") and cb.getProperty("require_email") == 1 and \
                not v_h(REQUEST.form["email"]):
            REQUEST.form["show_worning"] = REQUEST.form["show_worning"] + 1
            REQUEST.form["email_required"] = 1

        #comment body
        if REQUEST.form.has_key("body") and not v_c(REQUEST.form["body"]):
            REQUEST.form["show_worning"] = REQUEST.form["show_worning"] + 1
            REQUEST.form["body_required"] = 1

        if REQUEST.form["show_worning"] == 0:
            del REQUEST.form["show_worning"]

        return REQUEST

        #if REQUEST:
        #    return REQUEST.RESPONSE.redirect("./previewcomment_html")


    security.declareProtected(AddCOREBlogComments, 'addComment')


Generated by  Doxygen 1.6.0   Back to index