diff --git a/code/EditableSpamProtectionField.php b/code/EditableSpamProtectionField.php index 6c77d98..32b6880 100644 --- a/code/EditableSpamProtectionField.php +++ b/code/EditableSpamProtectionField.php @@ -9,10 +9,6 @@ class EditableSpamProtectionField extends EditableFormField { - static $db = array( - - ); - static $singular_name = 'Spam Protection Field'; static $plural_name = 'Spam Protection Fields'; @@ -21,26 +17,6 @@ class EditableSpamProtectionField extends EditableFormField { parent::__construct( $record, $isSingleton ); } - function ExtraOptions() { - - // eventually replace hard-coded "Fields"? - $baseName = "Fields[$this->ID]"; - - $extraFields = new FieldSet(); - - foreach( parent::ExtraOptions() as $extraField ) - $extraFields->push( $extraField ); - - if( $this->readonly ) - $extraFields = $extraFields->makeReadonly(); - - return $extraFields; - } - - function populateFromPostData($data) { - parent::populateFromPostData($data); - } - function getFormField() { return $this->createField(); } @@ -54,28 +30,12 @@ class EditableSpamProtectionField extends EditableFormField { if($protector) { $protector = new $protector(); if($class = $protector->getFieldName()) { - $spamProtection = new $class($class, $this->Title); - if($spamProtection) { - // set field mapping for all the fields in this form. - // fields should have the same ParentID as this - $fields = DataObject::get("EditableTextField", "ParentID = '$this->ParentID'"); - $fields = ($fields) ? $fields->toArray('Name') : null; - - // @TODO get FieldMapping Working. - $spamProtection->setFieldMapping(null, $fields); - return $spamProtection; - } + return new $class($class, $this->Title); } } } return false; } - /** - * Populates the default fields. - */ - function DefaultField() { - return ""; - } /** * @return string