Constructs an editor widget, with a title and fields.
Constructs an editor widget, with a title and fields.
The second parameter maybe passed as a string, to be interpreted as the name of a table, from
which all fields will be included, or as an array of specific fields, in which case you should
make sure to call SetBaseTable('tablename') so the editor knows where to find those fields!
Replace parts into the form template. Parts that are replaceable are listed below:
##form## A
or use Layout($template) which will take care of it for you.
##submit## A tag for the form.
##f.options## A list of options explicitly specified
##f.select## A select list from the lookup SQL specified
##f.checkbox## A checkbox, perhaps with a "_label" attribute
##f.input## A normal input field.
##f.file## A file upload field.
##f.money## A money input field.
##f.date## A date input field.
##f.textarea## A textarea
##f.hidden## A hidden input field
##f.password## An input field for entering passwords without them being echoed to the screen
##f.enc## Just print the value with special chars escaped for use in URLs.
##f.submit## An <input type="submit" where you specify the field name.
Replace parts into the form template. Parts that are replaceable are listed below: ##form## A
or use Layout($template) which will take care of it for you. ##submit## A tag for the form. ##f.options## A list of options explicitly specified ##f.select## A select list from the lookup SQL specified ##f.checkbox## A checkbox, perhaps with a "_label" attribute ##f.input## A normal input field. ##f.file## A file upload field. ##f.money## A money input field. ##f.date## A date input field. ##f.textarea## A textarea ##f.hidden## A hidden input field ##f.password## An input field for entering passwords without them being echoed to the screen ##f.enc## Just print the value with special chars escaped for use in URLs. ##f.submit## An <input type="submit" where you specify the field name.
Most of these begin with "f", which should be replaced by the name of the field. Many also take an option
after the name as well, so (for example) you can force the current value in ##options## or ##select## by
setting ##field.select.current##. The input, file, money & date all accept the third parameter as a size
value, so ##fieldname.date.14## would be a 14-character-wide date field. Similarly a textarea allows for
a COLSxROWS value, so ##myfield.textarea.80x5## would be an 80-column textarea, five rows high.
For ##fieldname.password.fakevalue## you can set the 'fake' value used to populate the password field so
that you can check for this on submit to be able to tell whether the password field has been edited.
Other attributes are added to the tag based on any SetAttributes() that may have been applied.
Parameters
$matches
The matches found which preg_replace_callback is calling us for.