$formSpec
$formSpec :
Class BuildFormPlain
process( $mode) : string|array
Builds complete form. Depending of Formspecification, the layout will be 'plain' / 'table' / 'bootstrap'.
$mode |
$mode=LOAD_FORM: The whole form as HTML, $mode=FORM_UPDATE: array of all formElement.dynamicUpdate-yes values/states
createFormEditUrl() : string
If SHOW_DEBUG_INFO=yes: create a link (incl. SIP) to edit the current form. Show also the hidden content of the SIP.
String: Edit [sip:..., r:..., urlparam:..., ...]
getEncType() : string
Determines the enctype.
See: https://www.w3.org/wiki/HTML/Elements/form#HTML_Attributes
elements( $recordId, string $filter = FORM_ELEMENTS_NATIVE, integer $feIdContainer, $json) : string
Process all FormElements: build corresponding HTML code. Collect and return all HTML code.
$recordId | ||
string | $filter | FORM_ELEMENTS_NATIVE | FORM_ELEMENTS_SUBRECORD | FORM_ELEMENTS_NATIVE_SUBRECORD |
integer | $feIdContainer | |
$json |
buildInput(array $formElement, $htmlFormElementId, $value, $json) : string
Builds HTML 'input' element.
Format: <input name="$htmlFormElementId" <type="email|input|password|url" [autocomplete="autocomplete"] [autofocus="autofocus"] [maxlength="$maxLength"] [placeholder="$placeholder"] [size="$size"] [min="$min"] [max="$max"] [pattern="$pattern"] [readonly="readonly"] [required="required"] [disabled="disabled"] value="$value">
array | $formElement | |
$htmlFormElementId | ||
$value | ||
$json |
buildCheckbox(array $formElement, $htmlFormElementId, $value, $json) : string
Builds HTML 'checkbox' element.
Checkboxes will only be submitted, if they are checked. Therefore, a hidden element with the unchecked value will be transferred first.
Format:
<input name="$htmlFormElementId" type="checkbox" [autofocus="autofocus"]
[readonly="readonly"] [required="required"] [disabled="disabled"]
value="
array | $formElement | |
$htmlFormElementId | ||
$value | ||
$json |
getKeyValueListFromSqlEnumSpec(array $formElement, $itemKey, $itemValue)
Look for key/value list (in this order, first match counts) in a) `sql1` b) `parameter:itemList` c) table.column definition
Copies the found keys to &$itemKey and the values to &$itemValue If there are no &$itemKey, copy &$itemValue to &$itemKey.
array | $formElement | |
$itemKey | ||
$itemValue |
buildCheckboxMulti(array $formElement, $htmlFormElementId, $attributeBase, $value, array $itemKey, array $itemValue) : string
Build as many Checkboxes as items.
Layout: The Bootstrap Layout needs very special setup, the checkboxes are wrapped differently with
array | $formElement | |
$htmlFormElementId | ||
$attributeBase | ||
$value | ||
array | $itemKey | |
array | $itemValue |
buildHidden(array $formElement, $htmlFormElementId, $value, $json) : string
Submit hidden values by SIP.
Sometimes, it's usefull to precalculate values during formload and to submit them as hidden fields. To avoid any manipulation on those fields, the values will be transferred by SIP.
array | $formElement | |
$htmlFormElementId | ||
$value | ||
$json |
buildRadio(array $formElement, $htmlFormElementId, $value, $json) : string
Build HTML 'radio' element.
Checkboxes will only be submitted, if they are checked. Therefore, a hidden element with the unchecked value will be transfered first.
Format:
<input name="$htmlFormElementId" type="radio" [autofocus="autofocus"]
[readonly="readonly"] [required="required"] [disabled="disabled"]
value="
array | $formElement | |
$htmlFormElementId | ||
$value | ||
$json |
buildSubrecord(array $formElement, $htmlFormElementId, $value, $json) : string
Constuct a HTML table of the subrecord data.
Column syntax definition: https://wikiit.math.uzh.ch/it/projekt/qfq/qfq-jqwidgets/Documentation#Type:_subrecord
array | $formElement | |
$htmlFormElementId | ||
$value | ||
$json |
getAttributeList(array $formElement, array $attributeList) : string
Builds a HTML attribute list, based on $attributeList.
E.g.: attributeList: [ 'type', 'autofocus' ] generates: 'type="$formElement['type']" autofocus="$formElement['autofocus']" '
array | $formElement | |
array | $attributeList |
getInputCheckPattern( $type, $data) : string
Construct HTML Input attribute for Client Validation:
type data result
min|max
For 'min/max' and 'pattern' the 'data' will be injected in the attribute string via '%s'.
$type | ||
$data |
prepareCheckboxCheckedUncheckedValue(array $itemKey, array $formElement)
For CheckBox's with only one checkbox: if no parameter:checked|unchecked is defined, take defaults:
checked: first Element in $itemKey unchecked: ''
array | $itemKey | |
array | $formElement |
createFormLink( $formElement, $targetRecordId, $record, $symbol, $toolTip) : string
Renders an Link with a symbol (edit/new) and register a new SIP to grant permission to the link.
.
Returns [icon]
Link:
$formElement | ||
$targetRecordId | ||
$record | ||
$symbol | ||
$toolTip |
getSubrecordColumnControl( $titleRaw) : array
Get various column format information based on the 'raw' column title. The attributes are separated by '|' and specified as 'key' or 'key=value'.
Returned assoc array: title Only key. Element is non numeric, which is not a keyword 'width/nostrip/icon/url/mailto' width Key/Value Pair. Not provided for 'icon/url/mailto'. nostrip Only key. Do not strip HTML Tags from the content. icon Only key. Value will rendered (later) as an image. url Only key. Value will rendered (later) as a 'href' mailto Only key. Value will rendered (later) as a 'href mailto'
$titleRaw |
renderCell(array $control, $columnName, $value) : string
Renders $value as specified in array $control
nostrip: by default, HTML tags are removed. With this attribute, the value will be delivered as it is. width: if there is a size limit - apply it. icon: The cell will be rendered as an image. $value should contain the name of an image in 'fileadmin/icons/' mailto: The cell will be rendered as an tag with the 'mailto' attribute. url: The cell will be rendered as an tag. The value will be exploded by '|'. $value[0] = href, value[1] = text. E.g. $value = 'www.math.uzh.ch/?id=45&v=234|Show details for Modul 123' >> Show details for Modul 123
array | $control | |
$columnName | ||
$value |