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