Commit 32a1caef authored by Carsten  Rose's avatar Carsten Rose
Browse files

FormElement 'extra': fixed problem that the label has been rendered on the client.

AbstractBuildForm.php: elements() generates no HTML for 'extra' anymore.
parent 5a29f6ed
......@@ -335,6 +335,7 @@ abstract class AbstractBuildForm {
public function elements($recordId, $filter = FORM_ELEMENTS_NATIVE, $feIdContainer = 0, array &$json,
$modeCollectFe = FLAG_DYNAMIC_UPDATE, $htmlElementNameIdZero = false, $storeUse = STORE_USE_DEFAULT, $mode = FORM_LOAD) {
$html = '';
$flagOutput = false;
// get current data record
if ($recordId > 0 && $this->store->getVar('id', STORE_RECORD) === false) {
......@@ -344,6 +345,7 @@ abstract class AbstractBuildForm {
// Iterate over all FormElements
foreach ($this->feSpecNative as $fe) {
if (($filter === FORM_ELEMENTS_NATIVE && $fe[FE_TYPE] === 'subrecord')
|| ($filter === FORM_ELEMENTS_SUBRECORD && $fe[FE_TYPE] !== 'subrecord')
// || ($filter === FORM_ELEMENTS_DYNAMIC_UPDATE && $fe['dynamicUpdate'] === 'no')
......@@ -351,6 +353,8 @@ abstract class AbstractBuildForm {
continue; // skip this FE
}
$flagOutput = ($fe[FE_TYPE] !== FE_TYPE_EXTRA);
$debugStack = array();
// Preparation for Log, Debug
......@@ -362,14 +366,15 @@ abstract class AbstractBuildForm {
// Some Defaults
$formElement = Support::setFeDefaults($formElement);
Support::setIfNotSet($formElement, F_BS_LABEL_COLUMNS);
Support::setIfNotSet($formElement, F_BS_INPUT_COLUMNS);
Support::setIfNotSet($formElement, F_BS_NOTE_COLUMNS);
$label = ($formElement[F_BS_LABEL_COLUMNS] == '') ? $this->formSpec[F_BS_LABEL_COLUMNS] : $formElement[F_BS_LABEL_COLUMNS];
$input = ($formElement[F_BS_INPUT_COLUMNS] == '') ? $this->formSpec[F_BS_INPUT_COLUMNS] : $formElement[F_BS_INPUT_COLUMNS];
$note = ($formElement[F_BS_NOTE_COLUMNS] == '') ? $this->formSpec[F_BS_NOTE_COLUMNS] : $formElement[F_BS_NOTE_COLUMNS];
$this->fillWrapLabelInputNote($label, $input, $note);
if ($flagOutput === true) {
Support::setIfNotSet($formElement, F_BS_LABEL_COLUMNS);
Support::setIfNotSet($formElement, F_BS_INPUT_COLUMNS);
Support::setIfNotSet($formElement, F_BS_NOTE_COLUMNS);
$label = ($formElement[F_BS_LABEL_COLUMNS] == '') ? $this->formSpec[F_BS_LABEL_COLUMNS] : $formElement[F_BS_LABEL_COLUMNS];
$input = ($formElement[F_BS_INPUT_COLUMNS] == '') ? $this->formSpec[F_BS_INPUT_COLUMNS] : $formElement[F_BS_INPUT_COLUMNS];
$note = ($formElement[F_BS_NOTE_COLUMNS] == '') ? $this->formSpec[F_BS_NOTE_COLUMNS] : $formElement[F_BS_NOTE_COLUMNS];
$this->fillWrapLabelInputNote($label, $input, $note);
}
// Get default value
$value = ($formElement['value'] === '') ? $this->store->getVar($formElement['name'], $storeUse,
$formElement['checkType']) : $formElement['value'];
......@@ -405,17 +410,17 @@ abstract class AbstractBuildForm {
}
}
// debugStack as Tooltip
if ($this->showDebugInfo && count($debugStack) > 0) {
// $elementHtml = Support::appendTooltip($elementHtml, implode("\n", OnArray::htmlentitiesOnArray($debugStack)));
$elementHtml = Support::appendTooltip($elementHtml, implode("\n", $debugStack));
}
if ($flagOutput) {
// debugStack as Tooltip
if ($this->showDebugInfo && count($debugStack) > 0) {
$elementHtml = Support::appendTooltip($elementHtml, implode("\n", $debugStack));
}
// Construct Marshaller Name: buildRow
$buildRowName = 'buildRow' . $this->buildRowName[$formElement[FE_TYPE]];
// Construct Marshaller Name: buildRow
$buildRowName = 'buildRow' . $this->buildRowName[$formElement[FE_TYPE]];
$html .= $this->$buildRowName($formElement, $elementHtml, $htmlFormElementId);
// break;
$html .= $this->$buildRowName($formElement, $elementHtml, $htmlFormElementId);
}
}
// Log / Debug: Last FormElement has been processed.
......@@ -1180,7 +1185,7 @@ abstract class AbstractBuildForm {
}
/**
* Submit hidden values by SIP.
* Submit extra (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.
......
Supports Markdown
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