mirror of
https://github.com/silverstripe/silverstripe-spamprotection.git
synced 2024-10-22 14:05:59 +02:00
BUGFIX: Added condition to verify userforms module class exists
This commit is contained in:
parent
aa8ef8aca9
commit
feddb2cc49
@ -6,28 +6,29 @@
|
|||||||
*
|
*
|
||||||
* @package spamprotection
|
* @package spamprotection
|
||||||
*/
|
*/
|
||||||
|
if(class_exists('EditableFormField')){
|
||||||
class EditableSpamProtectionField extends EditableFormField {
|
class EditableSpamProtectionField extends EditableFormField {
|
||||||
|
|
||||||
static $singular_name = 'Spam Protection Field';
|
static $singular_name = 'Spam Protection Field';
|
||||||
|
|
||||||
static $plural_name = 'Spam Protection Fields';
|
static $plural_name = 'Spam Protection Fields';
|
||||||
|
|
||||||
function getFormField() {
|
function getFormField() {
|
||||||
if($protector = SpamProtectorManager::get_spam_protector()) {
|
if($protector = SpamProtectorManager::get_spam_protector()) {
|
||||||
if($protector) {
|
if($protector) {
|
||||||
$protector = new $protector();
|
$protector = new $protector();
|
||||||
return $protector->getFormField($this->Name, $this->Title, null);
|
return $protector->getFormField($this->Name, $this->Title, null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function Icon() {
|
public function Icon() {
|
||||||
return 'spamprotection/images/' . strtolower($this->class) . '.png';
|
return 'spamprotection/images/' . strtolower($this->class) . '.png';
|
||||||
}
|
}
|
||||||
|
|
||||||
function showInReports() {
|
function showInReports() {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user