From 023ef453e4ff15ecdfd6d58766e0af2bdcc6a9a0 Mon Sep 17 00:00:00 2001 From: Will Rossiter Date: Mon, 27 Apr 2009 01:51:00 +0000 Subject: [PATCH] MINOR: removed field mapping for now to get field to show --- code/EditableSpamProtectionField.php | 42 +--------------------------- 1 file changed, 1 insertion(+), 41 deletions(-) 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