*/
public function addInputTextFieldWithDefault ($fieldName) {
// Get the value from instance
- $fieldValue = call_user_func_array(array($this->valueInstance, "getField"), array($fieldName));
+ $fieldValue = $this->getField($fieldName);
//* DEBUG: */ echo __METHOD__.":".$fieldName."=".$fieldValue."<br />\n";
// Add the text field
*/
public function addInputHiddenFieldWithDefault ($fieldName) {
// Get the value from instance
- $fieldValue = call_user_func_array(array($this->valueInstance, "getField"), array($fieldName));
+ $fieldValue = $this->getField($fieldName);
//* DEBUG: */ echo __METHOD__.":".$fieldName."=".$fieldValue."<br />\n";
// Add the text field
*/
public function getField ($fieldName) {
// Get the field value
- $fieldValue = call_user_func_array(array($this->valueInstance, "getField"), array($fieldName));
+ $fieldValue = call_user_func_array(array($this->valueInstance, 'getField'), array($fieldName));
// Return it
return $fieldValue;
}
+
+ /**
+ * Adds a pre-configured CAPTCHA
+ *
+ * @return void
+ */
+ public function addCaptcha () {
+ // Get last executed pre filter
+ $extraInstance = Registry::getRegistry()->getInstance('extra');
+
+ // Get a configured instance
+ $captchaInstance = ObjectFactory::createObjectByConfiguredName("{$this->formName}_captcha", array($this->getTemplateInstance(), $extraInstance));
+
+ // Initiate the CAPTCHA
+ $captchaInstance->initiateCaptcha();
+
+ // Render the CAPTCHA code
+ $captchaInstance->renderCode();
+
+ // Get the content and add it to the helper
+ $this->addContent($captchaInstance->getContent());
+ }
}
// [EOF]