Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MINOR: removed field mapping for now to get field to show

  • Loading branch information...
commit 023ef453e4ff15ecdfd6d58766e0af2bdcc6a9a0 1 parent 6cbb094
Will Rossiter authored
Showing with 1 addition and 41 deletions.
  1. +1 −41 code/EditableSpamProtectionField.php
42 code/EditableSpamProtectionField.php
View
@@ -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 @@ function __construct( $record = null, $isSingleton = false ) {
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 @@ function createField() {
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
Please sign in to comment.
Something went wrong with that request. Please try again.