Commit 4f9efc60 authored by Jérome Perrin's avatar Jérome Perrin

ERP5Type/patches: drop make_hidden_input patch

we had a patch to close <input/> elements, but with HTML5 this is no
longer recommended.
parent 55c2d644
......@@ -71,7 +71,6 @@ if WITH_LEGACY_WORKFLOW:
from Products.ERP5Type.patches import StateChangeInfoPatch
from Products.ERP5Type.patches import transforms
from Products.ERP5Type.patches import OFSPdata
from Products.ERP5Type.patches import make_hidden_input
from Products.ERP5Type.patches import DemoStorage
from Products.ERP5Type.patches import unicodeconflictresolver
from Products.ERP5Type.patches import ZODBConnection
......
##############################################################################
#
# Copyright (c) 2002 Zope Corporation and Contributors. All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
#
##############################################################################
"""
Close properly the <input /> tag
"""
import ZTUtils.Zope
from ZTUtils.Zope import complex_marshal
from Products.PythonScripts.standard import html_quote
from Products.ERP5Type.Utils import ensure_list
def make_hidden_input(*args, **kwargs):
'''Construct a set of hidden input elements, with marshalling markup.
If there are positional arguments, they must be dictionaries.
They are combined with the dictionary of keyword arguments to form
a dictionary of query names and values.
Query names (the keys) must be strings. Values may be strings,
integers, floats, or DateTimes, and they may also be lists or
namespaces containing these types. All arguments are marshalled with
complex_marshal().
'''
d = {}
for arg in args:
d.update(arg)
d.update(kwargs)
hq = lambda x: html_quote(x)
qlist = complex_marshal(ensure_list(d.items()))
for i in range(len(qlist)):
k, m, v = qlist[i]
qlist[i] = ('<input type="hidden" name="%s%s" value="%s" />'
% (hq(k), m, hq(str(v))))
return '\n'.join(qlist)
ZTUtils.Zope.make_hidden_input = make_hidden_input
ZTUtils.make_hidden_input = make_hidden_input
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment