Commit f677f3f3 authored by Carsten  Rose's avatar Carsten Rose
Browse files

AbstractBuildForm.php: some small code cleanup.

parent 84e2a5b6
......@@ -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]);
}
......
Markdown is supported
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