Commit 06b27ab4 authored by Carsten  Rose's avatar Carsten Rose
Browse files

#4299 / HTML Element 'Select': Placeholder

AbstractBuildForm.php: placeholder
parent 0e67cd5e
......@@ -82,48 +82,48 @@ abstract class AbstractBuildForm {
$this->buildElementFunctionName = [
FE_TYPE_CHECKBOX => 'Checkbox',
FE_TYPE_DATE => 'DateTime',
FE_TYPE_DATE => 'DateTime',
FE_TYPE_DATETIME => 'DateTime',
'dateJQW' => 'DateJQW',
'datetimeJQW' => 'DateJQW',
'email' => 'Input',
'gridJQW' => 'GridJQW',
FE_TYPE_EXTRA => 'Extra',
FE_TYPE_TEXT => 'Input',
FE_TYPE_EDITOR => 'Editor',
FE_TYPE_TIME => 'DateTime',
FE_TYPE_NOTE => 'Note',
'dateJQW' => 'DateJQW',
'datetimeJQW' => 'DateJQW',
'email' => 'Input',
'gridJQW' => 'GridJQW',
FE_TYPE_EXTRA => 'Extra',
FE_TYPE_TEXT => 'Input',
FE_TYPE_EDITOR => 'Editor',
FE_TYPE_TIME => 'DateTime',
FE_TYPE_NOTE => 'Note',
FE_TYPE_PASSWORD => 'Input',
FE_TYPE_RADIO => 'Radio',
FE_TYPE_SELECT => 'Select',
FE_TYPE_RADIO => 'Radio',
FE_TYPE_SELECT => 'Select',
FE_TYPE_SUBRECORD => 'Subrecord',
FE_TYPE_UPLOAD => 'File',
'fieldset' => 'Fieldset',
'pill' => 'Pill',
'templateGroup' => 'TemplateGroup'
FE_TYPE_UPLOAD => 'File',
'fieldset' => 'Fieldset',
'pill' => 'Pill',
'templateGroup' => 'TemplateGroup',
];
$this->buildRowName = [
FE_TYPE_CHECKBOX => 'Native',
FE_TYPE_DATE => 'Native',
FE_TYPE_DATE => 'Native',
FE_TYPE_DATETIME => 'Native',
'dateJQW' => 'Native',
'datetimeJQW' => 'Native',
'email' => 'Native',
'gridJQW' => 'Native',
FE_TYPE_EXTRA => 'Native',
FE_TYPE_TEXT => 'Native',
FE_TYPE_EDITOR => 'Native',
FE_TYPE_TIME => 'Native',
FE_TYPE_NOTE => 'Native',
'dateJQW' => 'Native',
'datetimeJQW' => 'Native',
'email' => 'Native',
'gridJQW' => 'Native',
FE_TYPE_EXTRA => 'Native',
FE_TYPE_TEXT => 'Native',
FE_TYPE_EDITOR => 'Native',
FE_TYPE_TIME => 'Native',
FE_TYPE_NOTE => 'Native',
FE_TYPE_PASSWORD => 'Native',
FE_TYPE_RADIO => 'Native',
FE_TYPE_SELECT => 'Native',
FE_TYPE_RADIO => 'Native',
FE_TYPE_SELECT => 'Native',
FE_TYPE_SUBRECORD => 'Subrecord',
FE_TYPE_UPLOAD => 'Native',
'fieldset' => 'Fieldset',
'pill' => 'Pill',
'templateGroup' => 'TemplateGroup'
FE_TYPE_UPLOAD => 'Native',
'fieldset' => 'Fieldset',
'pill' => 'Pill',
'templateGroup' => 'TemplateGroup',
];
$this->symbol[SYMBOL_EDIT] = "<span class='glyphicon " . GLYPH_ICON_EDIT . "'></span>";
......@@ -139,7 +139,9 @@ abstract class AbstractBuildForm {
* Builds complete 'form'. Depending of form specification, the layout will be 'plain' / 'table' / 'bootstrap'.
*
* @param string $mode FORM_LOAD | FORM_UPDATE | FORM_SAVE
* @return string|array $mode=LOAD_FORM: The whole form as HTML, $mode=FORM_UPDATE: array of all formElement.dynamicUpdate-yes values/states
*
* @return string|array $mode=LOAD_FORM: The whole form as HTML, $mode=FORM_UPDATE: array of all
* formElement.dynamicUpdate-yes values/states
* @throws CodeException
* @throws DbException
* @throws \qfq\UserFormException
......@@ -222,7 +224,7 @@ abstract class AbstractBuildForm {
public function head() {
$html = '';
$html .= '<div ' . Support::doAttribute('class', $this->formSpec[F_CLASS], TRUE) . '>'; // main <div class=...> around everything
$html .= '<div ' . Support::doAttribute('class', $this->formSpec[F_CLASS], true) . '>'; // main <div class=...> around everything
// Logged in BE User will see a FormEdit Link
$sipParamString = OnArray::toString($this->store->getStore(STORE_SIP), ':', ', ', "'");
......@@ -238,12 +240,15 @@ abstract class AbstractBuildForm {
}
/**
* If SHOW_DEBUG_INFO=yes: create a link (incl. SIP) to edit the current form. Show also the hidden content of the SIP.
* If SHOW_DEBUG_INFO=yes: create a link (incl. SIP) to edit the current form. Show also the hidden content of
* the SIP.
*
* @param string $form FORM_NAME_FORM | FORM_NAME_FORM_ELEMENT
* @param int $recordId id of form or formElement
* @param array $param
* @return string String: <a href="?pageId&sip=....">Edit</a> <small>[sip:..., r:..., urlparam:..., ...]</small>
*
* @return string String: <a href="?pageId&sip=....">Edit</a> <small>[sip:..., r:..., urlparam:...,
* ...]</small>
* @throws CodeException
*/
public function createFormEditorUrl($form, $recordId, array $param = array()) {
......@@ -255,7 +260,7 @@ abstract class AbstractBuildForm {
$queryStringArray = [
'id' => $this->store->getVar(SYSTEM_EDIT_FORM_PAGE, STORE_SYSTEM),
'form' => $form,
'r' => $recordId
'r' => $recordId,
];
$queryStringArray = array_merge($queryStringArray, $param);
......@@ -273,6 +278,7 @@ abstract class AbstractBuildForm {
* @param string $item
* @param string $value
* @param bool|false $flagOmitEmpty
*
* @return string
*/
public function wrapItem($item, $value, $flagOmitEmpty = false) {
......@@ -303,7 +309,9 @@ abstract class AbstractBuildForm {
/**
* Build MD5 from the current record. Return HTML Input element.
*
* @param bool $flagWithSpan
*
* @return string
* @throws \qfq\CodeException
* @throws \qfq\DbException
......@@ -314,6 +322,7 @@ abstract class AbstractBuildForm {
$md5 = $this->buildRecordHashMd5($this->formSpec[F_TABLE_NAME], $recordId);
$data = "<input id='" . DIRTY_RECORD_HASH_MD5 . "' name='" . DIRTY_RECORD_HASH_MD5 . "' type='hidden' value='$md5'>";
// $data = "<input id='" . DIRTY_RECORD_HASH_MD5 . "' name='" . DIRTY_RECORD_HASH_MD5 . "' type='text' value='$md5'>";
return $data;
......@@ -323,11 +332,12 @@ abstract class AbstractBuildForm {
/**
* @param $tableName
* @param $recordId
*
* @return string
* @throws \qfq\CodeException
* @throws \qfq\DbException
*/
public function buildRecordHashMd5($tableName, $recordId){
public function buildRecordHashMd5($tableName, $recordId) {
$record = array();
if ($recordId != 0) {
......@@ -388,6 +398,7 @@ abstract class AbstractBuildForm {
if ($this->formId === null) {
$this->formId = uniqid('qfq-form-');
}
return $this->formId;
}
......@@ -415,6 +426,7 @@ abstract class AbstractBuildForm {
public function getEncType() {
$result = $this->db->sql("SELECT id FROM FormElement AS fe WHERE fe.formId=? AND fe.type='upload' LIMIT 1", ROW_REGULAR, [$this->formSpec['id']], 'Look for Formelement.type="upload"');
return (count($result) === 1) ? 'multipart/form-data' : 'application/x-www-form-urlencoded';
}
......@@ -432,6 +444,7 @@ abstract class AbstractBuildForm {
* @param bool $htmlElementNameIdZero
* @param string $storeUseDefault
* @param string $mode FORM_LOAD | FORM_UPDATE | FORM_SAVE
*
* @return string
* @throws CodeException
* @throws DbException
......@@ -449,7 +462,7 @@ abstract class AbstractBuildForm {
// get current data record
if ($recordId > 0 && $this->store->getVar('id', STORE_RECORD) === false) {
$row = $this->db->sql("SELECT * FROM " . $this->formSpec[F_TABLE_NAME] . " WHERE id = ?", ROW_EXPECT_1,
$row = $this->db->sql('SELECT * FROM ' . $this->formSpec[F_TABLE_NAME] . " WHERE id = ?", ROW_EXPECT_1,
array($recordId), "Form '" . $this->formSpec[F_NAME] . "' failed to load record '$recordId' from table '" .
$this->formSpec[F_TABLE_NAME] . "'.");
$this->store->setStore($row, STORE_RECORD);
......@@ -592,6 +605,7 @@ abstract class AbstractBuildForm {
* No: do nothing.
*
* @param array $formElement
*
* @return array
* @throws CodeException
* @throws UserFormException
......@@ -635,8 +649,8 @@ abstract class AbstractBuildForm {
*
* Accepted misbehaviour on forms with pills: if there is at least one editable element on the first pill,
* the other pills are not checked - independent if there was a definition on the first pill or not.
* Reason: checks happens per pill - if there is no explizit definition on the first pill, take the first editable
* element of that pill.
* Reason: checks happens per pill - if there is no explizit definition on the first pill, take the first
* editable element of that pill.
*/
private function checkAutoFocus() {
static $found = false;
......@@ -660,6 +674,7 @@ abstract class AbstractBuildForm {
unset($this->feSpecNative[$i][FE_AUTOFOCUS]);
}
$found = true;
return;
}
......@@ -683,7 +698,8 @@ abstract class AbstractBuildForm {
abstract public function fillWrapLabelInputNote($label, $input, $note);
/**
* Copy a subset of current STORE_TYPO3 variables to SIP. Set a hidden form field to submit the assigned SIP to save/update.
* Copy a subset of current STORE_TYPO3 variables to SIP. Set a hidden form field to submit the assigned SIP to
* save/update.
*
* @throws CodeException
* @throws UserFormException
......@@ -701,6 +717,7 @@ abstract class AbstractBuildForm {
*
* @param $htmlFormElementName
* @param string $value
*
* @return string
*/
public function buildNativeHidden($htmlFormElementName, $value) {
......@@ -735,6 +752,7 @@ abstract class AbstractBuildForm {
* Create a hidden sip, based on latest STORE_SIP Values. Return complete HTML 'hidden' element.
*
* @param array $json
*
* @return string <input type='hidden' name='s' value='<sip>'>
* @throws CodeException
* @throws \qfq\UserFormException
......@@ -758,13 +776,15 @@ abstract class AbstractBuildForm {
}
/**
* Create an array with standard elements for 'mode' (hidden, disabled, required) and add 'form-element', 'value'.
* Create an array with standard elements for 'mode' (hidden, disabled, required) and add 'form-element',
* 'value'.
* 'Generic Element Update': add via API_ELEMENT_UPDATE 'label' and 'note'.
* All collected data as array - will be later converted to JSON.
*
* @param string $htmlFormElementName
* @param string|array $value
* @param array $formElement
*
* @return array
*/
private function getFormElementForJson($htmlFormElementName, $value, array $formElement) {
......@@ -834,6 +854,7 @@ abstract class AbstractBuildForm {
* Set corresponding JSON attributes readonly/required/disabled, based on $formElement[FE_MODE].
*
* @param array $feMode
*
* @return array
* @throws UserFormException
*/
......@@ -851,6 +872,7 @@ abstract class AbstractBuildForm {
* @param string $hidden
* @param string $disabled
* @param string $required
*
* @throws \qfq\UserFormException
*/
private function getFeMode($feMode, &$hidden, &$disabled, &$required) {
......@@ -882,6 +904,7 @@ abstract class AbstractBuildForm {
* @param string $htmlFormElementName
* @param string $label
* @param string $addClass
*
* @return string
*/
public function buildLabel($htmlFormElementName, $label, $addClass = '') {
......@@ -929,7 +952,8 @@ abstract class AbstractBuildForm {
/**
* Builds HTML 'input' element.
* Format: <input name="$htmlFormElementName" <type="email|input|password|url" [autocomplete="autocomplete"] [autofocus="autofocus"]
* Format: <input name="$htmlFormElementName" <type="email|input|password|url" [autocomplete="autocomplete"]
* [autofocus="autofocus"]
* [maxlength="$maxLength"] [placeholder="$placeholder"] [size="$size"] [min="$min"] [max="$max"]
* [pattern="$pattern"] [required="required"] [disabled="disabled"] value="$value">
*
......@@ -938,6 +962,7 @@ abstract class AbstractBuildForm {
* @param string $value
* @param array $json Return updates in this array - will be later converted to JSON.
* @param string $mode FORM_LOAD | FORM_UPDATE | FORM_SAVE
*
* @return string complete rendered HTML input element.
* @throws \qfq\UserFormException
*/
......@@ -1055,6 +1080,7 @@ abstract class AbstractBuildForm {
* Additionally set some parameter for later outside use, especially FE_TYPEAHEAD_LIMIT, FE_TYPEAHEAD_MINLENGTH
*
* @param array $formElement
*
* @return string
* @throws UserFormException
*/
......@@ -1088,13 +1114,13 @@ abstract class AbstractBuildForm {
}
$arr = [
FE_LDAP_SERVER => $formElement[FE_LDAP_SERVER],
FE_LDAP_BASE_DN => $formElement[FE_LDAP_BASE_DN],
FE_TYPEAHEAD_LDAP_SEARCH => $formElement[FE_TYPEAHEAD_LDAP_SEARCH],
FE_LDAP_SERVER => $formElement[FE_LDAP_SERVER],
FE_LDAP_BASE_DN => $formElement[FE_LDAP_BASE_DN],
FE_TYPEAHEAD_LDAP_SEARCH => $formElement[FE_TYPEAHEAD_LDAP_SEARCH],
FE_TYPEAHEAD_LDAP_SEARCH_PREFETCH => $formElement[FE_TYPEAHEAD_LDAP_SEARCH_PREFETCH],
FE_TYPEAHEAD_LDAP_VALUE_PRINTF => $formElement[FE_TYPEAHEAD_LDAP_VALUE_PRINTF],
FE_TYPEAHEAD_LDAP_ID_PRINTF => $formElement[FE_TYPEAHEAD_LDAP_ID_PRINTF],
FE_TYPEAHEAD_LIMIT => $formElement[FE_TYPEAHEAD_LIMIT],
FE_TYPEAHEAD_LIMIT => $formElement[FE_TYPEAHEAD_LIMIT],
];
if (isset($formElement[FE_TYPEAHEAD_LDAP_SEARCH_PER_TOKEN])) {
......@@ -1119,6 +1145,7 @@ abstract class AbstractBuildForm {
*
* @param string $sql
* @param int $limit
*
* @return string Checked and maybe extended $sql statement.
* @throws \qfq\UserFormException
*/
......@@ -1137,7 +1164,8 @@ abstract class AbstractBuildForm {
}
/**
* Calculates the maxlength of an input field, based on formElement type, formElement user definition and table.field definition.
* Calculates the maxlength of an input field, based on formElement type, formElement user definition and
* table.field definition.
*
* @param array $formElement
*/
......@@ -1182,7 +1210,9 @@ abstract class AbstractBuildForm {
* Get column spec from tabledefinition and parse size of it. If nothing defined, return false.
*
* @param string $column
* @return bool|int a) 'false' if there is no length definition, b) length definition, c) date|time|datetime|timestamp use hardcoded length
*
* @return bool|int a) 'false' if there is no length definition, b) length definition, c)
* date|time|datetime|timestamp use hardcoded length
*/
private function getColumnSize($column) {
$matches = array();
......@@ -1216,6 +1246,7 @@ abstract class AbstractBuildForm {
* Get the strlen of the longest element in enum('val1','val2',...,'valn') or set('val1','val2',...,'valn')
*
* @param string $typeSpec
*
* @return int
*/
private function maxLengthSetEnum($typeSpec) {
......@@ -1244,6 +1275,7 @@ abstract class AbstractBuildForm {
* @param array $formElement
* @param array $attributeList
* @param bool $flagOmitEmpty
*
* @return string
*/
private function getAttributeList(array $formElement, array $attributeList, $flagOmitEmpty = true) {
......@@ -1252,6 +1284,7 @@ abstract class AbstractBuildForm {
if (isset($formElement[$item]))
$attribute .= Support::doAttribute(strtolower($item), $formElement[$item], $flagOmitEmpty);
}
return $attribute;
}
......@@ -1259,17 +1292,17 @@ abstract class AbstractBuildForm {
* Construct HTML Input attribute for Client Validation:
*
* type data result
* ------- ----------------------- -------------------------------------------------------------------------------
* min|max <min value>|<max value> min="$attrData[0]"|max="$attrData[1]"
* pattern <regexp> pattern="$data"
* digit - pattern="^[0-9]*$"
* email - pattern="^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$"
* alnumx -
* ------- -----------------------
* ------------------------------------------------------------------------------- min|max <min value>|<max
* value> min="$attrData[0]"|max="$attrData[1]" pattern <regexp> pattern="$data" digit
* - pattern="^[0-9]*$" email -
* pattern="^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$" alnumx -
*
* For 'min/max' and 'pattern' the 'data' will be injected in the attribute string via '%s'.
*
* @param string $type
* @param string $data
*
* @return string
* @throws \qfq\UserFormException
*/
......@@ -1310,6 +1343,7 @@ abstract class AbstractBuildForm {
* Set corresponding html attributes readonly/required/disabled, based on $formElement[FE_MODE].
*
* @param string $feMode
*
* @return string
* @throws UserFormException
*/
......@@ -1353,17 +1387,19 @@ abstract class AbstractBuildForm {
/**
* 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.
* Checkboxes will only be submitted, if they are checked. Therefore, a hidden element with the unchecked value
* will be transferred first.
*
* Format: <input type="hidden" name="$htmlFormElementName" value="$valueUnChecked">
* <input name="$htmlFormElementName" type="checkbox" [autofocus="autofocus"]
* [required="required"] [disabled="disabled"] value="<value>" [checked="checked"] >
*
* @param array $formElement
* @param string $htmlFormElementName
* @param sgtring $value
* @param array $json
* @param string $mode FORM_LOAD | FORM_UPDATE | FORM_SAVE*
* @param array $formElement
* @param string $htmlFormElementName
* @param string $value
* @param array $json
* @param string $mode FORM_LOAD | FORM_UPDATE | FORM_SAVE*
*
* @return string
* @throws CodeException
* @throws \qfq\UserFormException
......@@ -1420,6 +1456,8 @@ abstract class AbstractBuildForm {
* @param array $formElement
* @param array $itemKey
* @param array $itemValue
*
* @return array
* @throws CodeException
* @throws \qfq\UserFormException
*/
......@@ -1472,22 +1510,33 @@ abstract class AbstractBuildForm {
$itemValue = OnArray::removeEmptyElementsFromArray($itemValue);
}
if (isset($formElement['emptyItemAtStart'])) {
$placeholder = isset($formElement[FE_PLACEHOLDER]) ? $formElement[FE_PLACEHOLDER] : '';
// If a placeholder is configured but no emptyItemAtStart nor emptyItemAtEnd: force emptyItemAtStart
if ($placeholder != '' && !isset($formElement[FE_EMPTY_ITEM_AT_START]) && !isset($formElement[FE_EMPTY_ITEM_AT_END])) {
$formElement[FE_EMPTY_ITEM_AT_START] = '';
}
if (isset($formElement[FE_EMPTY_ITEM_AT_START])) {
array_unshift($itemKey, '');
array_unshift($itemValue, '');
array_unshift($itemValue, $placeholder);
}
if (isset($formElement['emptyItemAtEnd'])) {
$itemValue[] = '';
if (isset($formElement[FE_EMPTY_ITEM_AT_END])) {
$itemKey[] = '';
$itemValue[] = $placeholder;
}
return $formElement;
}
/**
* Get the attribute definition list of an enum or set column. For strings, get the default value. Return elements as an array.
* Get the attribute definition list of an enum or set column. For strings, get the default value. Return
* elements as an array.
*
* @param string $column
* @param string $fieldType
*
* @return array
* @throws UserFormException
*/
......@@ -1512,6 +1561,7 @@ abstract class AbstractBuildForm {
break;
default:
$fieldType = 'string';
return array();
}
......@@ -1532,6 +1582,7 @@ abstract class AbstractBuildForm {
*
* @param array $itemKey
* @param array $formElement
*
* @throws UserFormException
*/
private function prepareCheckboxCheckedUncheckedValue(array $itemKey, array &$formElement) {
......@@ -1569,6 +1620,7 @@ abstract class AbstractBuildForm {
* @param string $value
* @param array $json
* @param string $mode FORM_LOAD | FORM_UPDATE | FORM_SAVE
*
* @return string
* @throws CodeException
* @throws \qfq\UserFormException
......@@ -1593,7 +1645,8 @@ abstract class AbstractBuildForm {
* <div class="btn-group" data-toggle="buttons">
* <input type="hidden" name="$htmlFormElementName" value="$valueUnChecked">
* <label class="btn btn-primary active">
* <input type="checkbox" autocomplete="off" name="$htmlFormElementName" value="$valueChecked"checked> Checkbox 1 (pre-checked)
* <input type="checkbox" autocomplete="off" name="$htmlFormElementName" value="$valueChecked"checked>
* Checkbox 1 (pre-checked)
* </label>
* </div>
*
......@@ -1602,6 +1655,7 @@ abstract class AbstractBuildForm {
* @param string $attribute
* @param string $value
* @param array $json
*
* @return string
*/
public function constructCheckboxSingleButton(array $formElement, $htmlFormElementName, $attribute, $value, array &$json) {
......@@ -1659,6 +1713,7 @@ abstract class AbstractBuildForm {
* @param string $attribute
* @param string $value
* @param array $json
*
* @return string
*/
public function constructCheckboxSinglePlain(array $formElement, $htmlFormElementName, $attribute, $value, array &$json) {
......@@ -1704,6 +1759,7 @@ abstract class AbstractBuildForm {
* @param string $value
* @param array $json
* @param string $mode FORM_LOAD | FORM_UPDATE | FORM_SAVE
*
* @return string
* @throws CodeException
* @throws \qfq\UserFormException
......@@ -1726,6 +1782,7 @@ abstract class AbstractBuildForm {
* @param array $formElement
* @param string $htmlFormElementName
* @param string $htmlHidden
*
* @throws CodeException
* @throws UserFormException
*/
......@@ -1745,8 +1802,8 @@ abstract class AbstractBuildForm {
/**
* Build as many Checkboxes as items.
*
* Layout: The Bootstrap Layout needs very special setup, the checkboxes are wrapped differently with <div class=checkbox>
* depending of if they aligned horizontal or vertical.
* Layout: The Bootstrap Layout needs very special setup, the checkboxes are wrapped differently with <div
* class=checkbox> depending of if they aligned horizontal or vertical.
*
* @param array $formElement
* @param string $htmlFormElementName
......@@ -1755,6 +1812,7 @@ abstract class AbstractBuildForm {
* @param array $itemKey
* @param array $itemValue
* @param array $json
*
* @return string
*/
public function constructCheckboxMultiButton(array $formElement, $htmlFormElementName, $attributeBase, $value, array $itemKey, array $itemValue, array &$json) {
......@@ -1815,8 +1873,8 @@ abstract class AbstractBuildForm {
/**
* Build as many Checkboxes as items.
*
* Layout: The Bootstrap Layout needs very special setup, the checkboxes are wrapped differently with <div class=checkbox>
* depending of if they aligned horizontal or vertical.
* Layout: The Bootstrap Layout needs very special setup, the checkboxes are wrapped differently with <div
* class=checkbox> depending of if they aligned horizontal or vertical.
*
* @param array $formElement
* @param string $htmlFormElementName
......@@ -1825,6 +1883,7 @@ abstract class AbstractBuildForm {
* @param array $itemKey
* @param array $itemValue
* @param array $json
*
* @return string
*/
public function constructCheckboxMultiPlain(array $formElement, $htmlFormElementName, $attributeBase, $value, array $itemKey, array $itemValue, array &$json) {
......@@ -1912,6 +1971,7 @@ abstract class AbstractBuildForm {
* @param string $value
* @param array $json
* @param string $mode FORM_LOAD | FORM_UPDATE | FORM_SAVE
*
* @return string
* @throws CodeException
* @throws \qfq\UserFormException
......@@ -1935,6 +1995,7 @@ abstract class AbstractBuildForm {
* @param string $value
* @param array $json
* @param string $mode FORM_LOAD | FORM_UPDATE | FORM_SAVE
*
* @return string
* @throws CodeException
* @throws \qfq\UserFormException
......@@ -1982,6 +2043,7 @@ abstract class AbstractBuildForm {
* @param string $value
* @param array $json
* @param string $mode FORM_LOAD | FORM_UPDATE | FORM_SAVE
*
* @return string
* @throws CodeException
* @throws \qfq\UserFormException
......@@ -2054,6 +2116,7 @@ abstract class AbstractBuildForm {
* @param string $value
* @param array $json
* @param string $mode FORM_LOAD | FORM_UPDATE | FORM_SAVE
*
* @return string
* @throws CodeException
* @throws \qfq\UserFormException
......@@ -2143,6 +2206,7 @@ abstract class AbstractBuildForm {
* @param string $value
* @param array $json
* @param string $mode FORM_LOAD | FORM_UPDATE | FORM_SAVE
*
* @return mixed
* @throws CodeException
* @throws \qfq\UserFormException
......@@ -2153,7 +2217,7 @@ abstract class AbstractBuildForm {
$attribute = '';
// Fill $itemKey & $itemValue
$this->getKeyValueListFromSqlEnumSpec($formElement, $itemKey, $itemValue);
$formElement = $this->getKeyValueListFromSqlEnumSpec($formElement, $itemKey, $itemValue);
$attribute .= $this->getAttributeFeMode($formElement[FE_MODE]);
$attribute .= Support::doAttribute('id', $formElement[FE_HTML_ID]);
......@@ -2172,15 +2236,24 @@ abstract class AbstractBuildForm {
$option = '';
$firstSelect = true;
$jsonValues = array();
for ($ii = 0; $ii < count($itemValue); $ii++) {
$total = count($itemValue);
for ($ii = 0; $ii < $total; $ii++) {
$option .= '<option ';
$option .= Support::doAttribute('value', $itemKey[$ii]);
if ($formElement[FE_PLACEHOLDER] != '') {
if (($ii == 0 && isset($formElement[FE_EMPTY_ITEM_AT_START])) ||