From feddb2cc499c63abf6066d107f63a29b1a7026f3 Mon Sep 17 00:00:00 2001 From: Carlos Barberis Date: Wed, 21 Jul 2010 01:56:12 +0000 Subject: [PATCH] BUGFIX: Added condition to verify userforms module class exists --- code/EditableSpamProtectionField.php | 35 ++++++++++++++-------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/code/EditableSpamProtectionField.php b/code/EditableSpamProtectionField.php index 649bd9a..ad82907 100644 --- a/code/EditableSpamProtectionField.php +++ b/code/EditableSpamProtectionField.php @@ -6,28 +6,29 @@ * * @package spamprotection */ - -class EditableSpamProtectionField extends EditableFormField { +if(class_exists('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() { - if($protector = SpamProtectorManager::get_spam_protector()) { - if($protector) { - $protector = new $protector(); - return $protector->getFormField($this->Name, $this->Title, null); + function getFormField() { + if($protector = SpamProtectorManager::get_spam_protector()) { + if($protector) { + $protector = new $protector(); + return $protector->getFormField($this->Name, $this->Title, null); + } } + return false; } - return false; - } - public function Icon() { - return 'spamprotection/images/' . strtolower($this->class) . '.png'; - } + public function Icon() { + return 'spamprotection/images/' . strtolower($this->class) . '.png'; + } - function showInReports() { - return false; + function showInReports() { + return false; + } } -} +} \ No newline at end of file