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.
|
* *** Most of the web service doesn't require this.
|
||||||
* @return SpamProtecterField
|
* @return SpamProtecterField
|
||||||
*/
|
*/
|
||||||
static function update_form($protecterFieldName, $protecterFieldTitle, $form, $before=null, $callbackObject=null, $fieldsToSpamServiceMapping=null) {
|
static function update_form($form, $before=null, $callbackObject=null, $fieldsToSpamServiceMapping=null) {
|
||||||
|
$protecter = new self::$spam_protecter();
|
||||||
$protecterField = new self::$spam_protecter($protecterFieldName, $protecterFieldTitle);
|
$protecter->updateForm($form, $before, $callbackObject, $fieldsToSpamServiceMapping);
|
||||||
$protecterField->setCallbackObject($callbackObject);
|
return $protecter;
|
||||||
|
|
||||||
if ($before && $fields->fieldByName($before)) {
|
|
||||||
$form->Fields()->insertBefore($protecterField, $before);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$form->Fields()->push($protecterField);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $protecterField;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
Loading…
Reference in New Issue
Block a user