mirror of
https://github.com/silverstripe/silverstripe-spamprotection.git
synced 2024-10-22 14:05:59 +02:00
704e8555cc
Updated graphic to look better in 3.0
44 lines
962 B
PHP
44 lines
962 B
PHP
<?php
|
|
|
|
/**
|
|
* Editable Spam Protecter Field. Used with the User Defined Forms module (if
|
|
* installed) to allow the user to have captcha fields with their custom forms
|
|
*
|
|
* @package spamprotection
|
|
*/
|
|
if(class_exists('EditableFormField')){
|
|
class EditableSpamProtectionField extends EditableFormField {
|
|
|
|
static $singular_name = 'Spam Protection Field';
|
|
|
|
static $plural_name = 'Spam Protection Fields';
|
|
|
|
function getFormField() {
|
|
if($protector = SpamProtectorManager::get_spam_protector()) {
|
|
if($protector) {
|
|
$protector = new $protector();
|
|
|
|
return $protector->getFormField($this->Name, $this->Title, null);
|
|
}
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
function getFieldValidationOptions() {
|
|
return new FieldList();
|
|
}
|
|
|
|
function getRequired() {
|
|
return false;
|
|
}
|
|
|
|
public function Icon() {
|
|
return 'spamprotection/images/' . strtolower($this->class) . '.png';
|
|
}
|
|
|
|
function showInReports() {
|
|
return false;
|
|
}
|
|
}
|
|
} |