getFormField("Captcha", $title, null); $field->setForm($form); if ($rightTitle) $field->setRightTitle($rightTitle); if($field) { // update the mapping $field->setFieldMapping($fieldsToSpamServiceMapping); // add the form field if($before && $form->Fields()->fieldByName($before)) { $form->Fields()->insertBefore($field, $before); } else { $form->Fields()->push($field); } } } catch (Exception $e) { return user_error("SpamProtectorManager::update_form(): '$protectorClass' is not correctly set up. " . $e, E_USER_WARNING); } } /** * Send Feedback to the Spam Protection. The level of feedback * will depend on the Protector class. * * @param DataObject The Object which you want to send feedback about. Must have a * SessionID field. * @param String Feedback on the $object usually 'spam' or 'ham' for non spam entries */ static function send_feedback($object, $feedback) { $protectorClass = self::get_spam_protector(); if(!$protectorClass) return false; $protector = new $protectorClass(); return $protector->sendFeedback($object, $feedback); } }