BUGFIX: Added condition to verify userforms module class exists

This commit is contained in:
Carlos Barberis 2010-07-21 01:56:12 +00:00
parent aa8ef8aca9
commit feddb2cc49
1 changed files with 18 additions and 17 deletions

View File

@ -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;
}
} }
} }