mirror of
https://github.com/silverstripe/silverstripe-spamprotection.git
synced 2024-10-22 14:05:59 +02:00
Changed SpamProtectorManager::update_form to not require fieldname and fieldtitle
This commit is contained in:
parent
c0954b5ba8
commit
a731563cbc
@ -29,19 +29,10 @@ class SpamProtecterManager {
|
||||
* *** Most of the web service doesn't require this.
|
||||
* @return SpamProtecterField
|
||||
*/
|
||||
static function update_form($protecterFieldName, $protecterFieldTitle, $form, $before=null, $callbackObject=null, $fieldsToSpamServiceMapping=null) {
|
||||
|
||||
$protecterField = new self::$spam_protecter($protecterFieldName, $protecterFieldTitle);
|
||||
$protecterField->setCallbackObject($callbackObject);
|
||||
|
||||
if ($before && $fields->fieldByName($before)) {
|
||||
$form->Fields()->insertBefore($protecterField, $before);
|
||||
}
|
||||
else {
|
||||
$form->Fields()->push($protecterField);
|
||||
}
|
||||
|
||||
return $protecterField;
|
||||
static function update_form($form, $before=null, $callbackObject=null, $fieldsToSpamServiceMapping=null) {
|
||||
$protecter = new self::$spam_protecter();
|
||||
$protecter->updateForm($form, $before, $callbackObject, $fieldsToSpamServiceMapping);
|
||||
return $protecter;
|
||||
}
|
||||
}
|
||||
?>
|
Loading…
Reference in New Issue
Block a user