Commit 1af6f97c authored by Bartek Górny's avatar Bartek Górny

added missing field

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9572 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a8575223
# FIXME: provide icon for the field
from Products.Formulator.Field import ZMIField
from Products.Formulator.Widget import LabelWidget, render_element
from Products.Formulator.DummyField import fields
from Products.Formulator import Validator
class HyperLinkWidget(LabelWidget):
property_names = LabelWidget.property_names + ['href']
href = fields.LinkField('href',
title='Href',
description='Address of this link',
default="",
required=1)
def render(self, field, key, value, REQUEST):
return render_element("a",
href=field.get_value('href'),
css_class=field.get_value('css_class'),
contents=field.get_value('default'))
HyperLinkWidgetInstance = HyperLinkWidget()
class HyperLinkField(ZMIField):
""" Hyperlink field
"""
meta_type = "HyperLinkField"
widget = HyperLinkWidgetInstance
validator = Validator.SuppressValidatorInstance
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