def FormatFormStart(self, name, extra='', mlist=None, contexts=None, user=None): base_url = self.GetScriptURL(name) if extra: full_url = "%s/%s" % (base_url, extra) else: full_url = base_url if mlist: return ("""<form method="POST" action="%s"> <input type="hidden" name="csrf_token" value="%s">""" % (full_url, csrf_token(mlist, contexts, user))) return ('<FORM Method=POST ACTION="%s">' % full_url)
def Format(self, indent=0): spaces = ' ' * indent encoding = '' if self.encoding: encoding = 'enctype="%s"' % self.encoding output = '\n%s<FORM action="%s" method="%s" %s>\n' % ( spaces, self.action, self.method, encoding) if self.mlist: output = output + \ '<input type="hidden" name="csrf_token" value="%s">\n' \ % csrf_token(self.mlist, self.contexts) output = output + Container.Format(self, indent+2) output = '%s\n%s</FORM>\n' % (output, spaces) return output
def Format(self, indent=0): spaces = ' ' * indent encoding = '' if self.encoding: encoding = 'enctype="%s"' % self.encoding output = '\n%s<FORM action="%s" method="%s" %s>\n' % ( spaces, self.action, self.method, encoding) if self.mlist: output = output + \ '<input type="hidden" name="csrf_token" value="%s">\n' \ % csrf_token(self.mlist, self.contexts, self.user) output = output + Container.Format(self, indent + 2) output = '%s\n%s</FORM>\n' % (output, spaces) return output