$this->addFormSubGroup();
} // END - if
+ // Get previous group id
+ $prevGroupId = $this->getPreviousGroupId();
+
// Switch the state
$this->closePreviousGroupByContent($content);
// All call it again if the group name is not empty
- if (!empty($groupId)) {
+ if ((!empty($groupId)) && ($groupId != $prevGroupId)) {
+ //* DEBUG: */ echo $groupId."/".$prevGroupId."<br />\n";
$this->addFormGroup($groupId, $groupText);
} // END - if
}
throw new EmptyVariableException(array($this, 'subGroupId'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
} elseif (empty($subGroupId)) {
// Close the last opened
- $subGroupId = $this->getSubGroupId();
+ $subGroupId = $this->getPreviousSubGroupId();
}
// Same sub group to open?
- if ((!$this->ifSubGroupOpenedPreviously()) && ($subGroupId == $this->getSubGroupId())) {
+ if ((!$this->ifSubGroupOpenedPreviously()) && ($subGroupId == $this->getPreviousSubGroupId())) {
// Abort here silently
return false;
} // END - if
// Switch the state and remeber the name
$this->openSubGroupByIdContent($subGroupId, $content);
} else {
+ // Get previous sub group id
+ $prevSubGroupId = $this->getPreviousSubGroupId();
+
// Switch the state
$this->closePreviousSubGroupByContent($content);
// All call it again if sub group name is not empty
- if (!empty($subGroupId)) {
+ if ((!empty($subGroupId)) && ($subGroupId != $prevSubGroupId)) {
$this->addFormSubGroup($subGroupId, $subGroupText);
} // END - if
}
$captchaInstance->renderCode();
// Get the content and add it to the helper
- $this->addContent($captchaInstance->getContent());
+ $this->addContent($captchaInstance->renderContent());
}
/**
}
// Send content to template engine
- //* DEBUG: */ echo __METHOD__.": form=".$this->getFormName().", size=".strlen($this->getContent())."<br />\n";
- $this->getTemplateInstance()->assignVariable($this->getFormName(), $this->getContent());
+ //* DEBUG: */ echo __METHOD__.": form=".$this->getFormName().", size=".strlen($this->renderContent())."<br />\n";
+ $this->getTemplateInstance()->assignVariable($this->getFormName(), $this->renderContent());
}
}