diff --git a/extension/qfq/qfq/AbstractBuildForm.php b/extension/qfq/qfq/AbstractBuildForm.php index 22874b2949b57ef1f6f7e2f8a65fc6d1ebcac78b..e2c71ba9814e4a74f774aefee5bf4c2e95cafcde 100644 --- a/extension/qfq/qfq/AbstractBuildForm.php +++ b/extension/qfq/qfq/AbstractBuildForm.php @@ -31,8 +31,6 @@ abstract class AbstractBuildForm { protected $formSpec = array(); // copy of the loaded form protected $feSpecAction = array(); // copy of all formElement.class='action' of the loaded form protected $feSpecNative = array(); // copy of all formElement.class='native' of the loaded form - protected $store = null; - protected $evaluate = null; protected $buildElementFunctionName = array(); protected $pattern = array(); protected $wrap = array(); @@ -42,11 +40,18 @@ abstract class AbstractBuildForm { // protected $feDivClass = array(); // Wrap FormElements in <div class="$feDivClass[type]"> + /** + * @var Store + */ + protected $store = null; + /** + * @var Evaluate + */ + protected $evaluate = null; /** * @var string */ private $formId = null; - /** * @var Sip */ @@ -167,9 +172,9 @@ abstract class AbstractBuildForm { $json[] = $jsonTmp; } } else { - $htmlElements = $this->elements($this->store->getVar(SIP_RECORD_ID, STORE_SIP), $filter, 0, $json, $modeCollectFe, $htmlElementNameIdZero, $storeUse); + $recordId = $this->store->getVar(SIP_RECORD_ID, STORE_SIP); + $htmlElements = $this->elements($recordId, $filter, 0, $json, $modeCollectFe, $htmlElementNameIdZero, $storeUse); } - $htmlSip = $this->buildHiddenSip($json); // </form> @@ -353,8 +358,7 @@ abstract class AbstractBuildForm { $this->store->setVar(SYSTEM_FORM_ELEMENT, Logger::formatFormElementName($fe), STORE_SYSTEM); // evaluate current FormElement - $evaluate = new Evaluate($this->store, $this->db); - $formElement = $evaluate->parseArray($fe, $debugStack); + $formElement = $this->evaluate->parseArray($fe, $debugStack); // Some Defaults $formElement = Support::setFeDefaults($formElement); @@ -1093,7 +1097,8 @@ abstract class AbstractBuildForm { for ($ii = 0, $jj = 1; $ii < count($itemKey); $ii++, $jj++) { $jsonValue = false; $attribute = $attributeBase; - $attribute .= Support::doAttribute('name', HelperFormElement::prependFormElementIdCheckBoxMulti($htmlFormElementId, $ii)); + $htmlFormElementIdUniq = HelperFormElement::prependFormElementIdCheckBoxMulti($htmlFormElementId, $ii); + $attribute .= Support::doAttribute('name', $htmlFormElementIdUniq); // Do this only the first round. if ($flagFirst) { @@ -1134,7 +1139,7 @@ abstract class AbstractBuildForm { } $html .= $htmlElement . $br; - $json[] = $this->getJsonElementUpdate($htmlFormElementId, $jsonValue, $formElement[FE_MODE]); + $json[] = $this->getJsonElementUpdate($htmlFormElementIdUniq, $jsonValue, $formElement[FE_MODE]); }