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 { ...@@ -31,8 +31,6 @@ abstract class AbstractBuildForm {
protected $formSpec = array(); // copy of the loaded form protected $formSpec = array(); // copy of the loaded form
protected $feSpecAction = array(); // copy of all formElement.class='action' 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 $feSpecNative = array(); // copy of all formElement.class='native' of the loaded form
protected $store = null;
protected $evaluate = null;
protected $buildElementFunctionName = array(); protected $buildElementFunctionName = array();
protected $pattern = array(); protected $pattern = array();
protected $wrap = array(); protected $wrap = array();
...@@ -42,11 +40,18 @@ abstract class AbstractBuildForm { ...@@ -42,11 +40,18 @@ abstract class AbstractBuildForm {
// protected $feDivClass = array(); // Wrap FormElements in <div class="$feDivClass[type]"> // protected $feDivClass = array(); // Wrap FormElements in <div class="$feDivClass[type]">
/**
* @var Store
*/
protected $store = null;
/**
* @var Evaluate
*/
protected $evaluate = null;
/** /**
* @var string * @var string
*/ */
private $formId = null; private $formId = null;
/** /**
* @var Sip * @var Sip
*/ */
...@@ -167,9 +172,9 @@ abstract class AbstractBuildForm { ...@@ -167,9 +172,9 @@ abstract class AbstractBuildForm {
$json[] = $jsonTmp; $json[] = $jsonTmp;
} }
} else { } 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); $htmlSip = $this->buildHiddenSip($json);
// </form> // </form>
...@@ -353,8 +358,7 @@ abstract class AbstractBuildForm { ...@@ -353,8 +358,7 @@ abstract class AbstractBuildForm {
$this->store->setVar(SYSTEM_FORM_ELEMENT, Logger::formatFormElementName($fe), STORE_SYSTEM); $this->store->setVar(SYSTEM_FORM_ELEMENT, Logger::formatFormElementName($fe), STORE_SYSTEM);
// evaluate current FormElement // evaluate current FormElement
$evaluate = new Evaluate($this->store, $this->db); $formElement = $this->evaluate->parseArray($fe, $debugStack);
$formElement = $evaluate->parseArray($fe, $debugStack);
// Some Defaults // Some Defaults
$formElement = Support::setFeDefaults($formElement); $formElement = Support::setFeDefaults($formElement);
...@@ -1093,7 +1097,8 @@ abstract class AbstractBuildForm { ...@@ -1093,7 +1097,8 @@ abstract class AbstractBuildForm {
for ($ii = 0, $jj = 1; $ii < count($itemKey); $ii++, $jj++) { for ($ii = 0, $jj = 1; $ii < count($itemKey); $ii++, $jj++) {
$jsonValue = false; $jsonValue = false;
$attribute = $attributeBase; $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. // Do this only the first round.
if ($flagFirst) { if ($flagFirst) {
...@@ -1134,7 +1139,7 @@ abstract class AbstractBuildForm { ...@@ -1134,7 +1139,7 @@ abstract class AbstractBuildForm {
} }
$html .= $htmlElement . $br; $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