mirror of
https://github.com/silverstripe/silverstripe-spamprotection.git
synced 2024-10-22 14:05:59 +02:00
MINOR: removed field mapping for now to get field to show
This commit is contained in:
parent
6cbb094363
commit
023ef453e4
@ -9,10 +9,6 @@
|
|||||||
|
|
||||||
class EditableSpamProtectionField extends EditableFormField {
|
class EditableSpamProtectionField extends EditableFormField {
|
||||||
|
|
||||||
static $db = array(
|
|
||||||
|
|
||||||
);
|
|
||||||
|
|
||||||
static $singular_name = 'Spam Protection Field';
|
static $singular_name = 'Spam Protection Field';
|
||||||
static $plural_name = 'Spam Protection Fields';
|
static $plural_name = 'Spam Protection Fields';
|
||||||
|
|
||||||
@ -21,26 +17,6 @@ class EditableSpamProtectionField extends EditableFormField {
|
|||||||
parent::__construct( $record, $isSingleton );
|
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() {
|
function getFormField() {
|
||||||
return $this->createField();
|
return $this->createField();
|
||||||
}
|
}
|
||||||
@ -54,28 +30,12 @@ class EditableSpamProtectionField extends EditableFormField {
|
|||||||
if($protector) {
|
if($protector) {
|
||||||
$protector = new $protector();
|
$protector = new $protector();
|
||||||
if($class = $protector->getFieldName()) {
|
if($class = $protector->getFieldName()) {
|
||||||
$spamProtection = new $class($class, $this->Title);
|
return 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 false;
|
return false;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* Populates the default fields.
|
|
||||||
*/
|
|
||||||
function DefaultField() {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string
|
* @return string
|
||||||
|
Loading…
Reference in New Issue
Block a user