From 928bb4bc6e1cf2c77f52da67acec47cef8aae458 Mon Sep 17 00:00:00 2001 From: Andrew O'Neil Date: Thu, 4 Jun 2009 22:57:33 +0000 Subject: [PATCH] API: Fix inconsistent and incorrect spelling --- INSTALL | 12 ++++----- code/EditableSpamProtectionField.php | 4 +-- ...tecterField.php => SpamProtectorField.php} | 4 +-- ...erManager.php => SpamProtectorManager.php} | 26 +++++++++---------- 4 files changed, 23 insertions(+), 23 deletions(-) rename code/{SpamProtecterField.php => SpamProtectorField.php} (95%) rename code/{SpamProtecterManager.php => SpamProtectorManager.php} (79%) diff --git a/INSTALL b/INSTALL index da8ab6e..746ff67 100644 --- a/INSTALL +++ b/INSTALL @@ -20,12 +20,12 @@ Read the instructions below to setup the initial configuration of the module. SETTING UP THE MODULE (in 'mysite/_config.php') ------------------------------------------------------ -Before putting the following code in '_config.php', make sure you have a subclass of 'SpamProtecterField' installed or written. One +Before putting the following code in '_config.php', make sure you have a subclass of 'SpamProtectorField' installed or written. One example of 'SpamProtecter' subclass is 'MollomField'. <<<< CODE STARTS >>>> -SpamProtecterManager::set_spam_protecter('MollomSpamProtector'); +SpamProtectorManager::set_spam_protector('MollomSpamProtector'); <<<< CODE ENDS >>>> @@ -34,20 +34,20 @@ What does this do? This tell 'SpamProtection' module that you want to use 'MollomField' as a spam protection module across your site. -UPDATING A FORM TO INCLUDE THE SPAM PROTECTER FIELD +UPDATING A FORM TO INCLUDE THE SPAM PROTECTOR FIELD --------------------------------------------------- This following code should appear after the form creation. <<<< CODE STARTS >>>> -$protector = SpamProtecterManager::update_form($form, 'Message'); +$protector = SpamProtectorManager::update_form($form, 'Message'); <<<< CODE ENDS >>>> What does this do? ------------------ -This code add an instance of a 'SpamProtecterField' class specified in SETTING UP THE MODULE section. The newly created field will have +This code add an instance of a 'SpamProtectorField' class specified in SETTING UP THE MODULE section. The newly created field will have MollomField field. The first parameter is a Form object in which the field will be added into and the second parameter tells -SpamProtecterManager to place the new field before a field named 'Message'. +SpamProtecterManagor to place the new field before a field named 'Message'. diff --git a/code/EditableSpamProtectionField.php b/code/EditableSpamProtectionField.php index 32b6880..91dc1b5 100644 --- a/code/EditableSpamProtectionField.php +++ b/code/EditableSpamProtectionField.php @@ -26,7 +26,7 @@ class EditableSpamProtectionField extends EditableFormField { } function createField() { - if($protector = SpamProtecterManager::get_spam_protecter()) { + if($protector = SpamProtectorManager::get_spam_protector()) { if($protector) { $protector = new $protector(); if($class = $protector->getFieldName()) { @@ -44,4 +44,4 @@ class EditableSpamProtectionField extends EditableFormField { return 'spamprotection/images/' . strtolower($this->class) . '.png'; } -} \ No newline at end of file +} diff --git a/code/SpamProtecterField.php b/code/SpamProtectorField.php similarity index 95% rename from code/SpamProtecterField.php rename to code/SpamProtectorField.php index dada587..0e06ad2 100644 --- a/code/SpamProtecterField.php +++ b/code/SpamProtectorField.php @@ -9,7 +9,7 @@ * been obtained. * */ -class SpamProtecterField extends FormField { +class SpamProtectorField extends FormField { protected $spanControlCallbackObj = null; @@ -37,4 +37,4 @@ class SpamProtecterField extends FormField { } -?> \ No newline at end of file +?> diff --git a/code/SpamProtecterManager.php b/code/SpamProtectorManager.php similarity index 79% rename from code/SpamProtecterManager.php rename to code/SpamProtectorManager.php index 3b2f0a7..510205d 100644 --- a/code/SpamProtecterManager.php +++ b/code/SpamProtectorManager.php @@ -3,27 +3,27 @@ * This class is responsible for setting an system-wide spam protecter field * and add the protecter field to a form */ -class SpamProtecterManager { +class SpamProtectorManager { - static $spam_protecter = null; + static $spam_protector = null; /** * Set the name of the spam protecter class * @param string the name of protecter field class */ - static function set_spam_protecter($protecter) { - self::$spam_protecter = $protecter; + static function set_spam_protector($protector) { + self::$spam_protector = $protector; } /** * Get the name of the spam protector class */ - static function get_spam_protecter() { - return self::$spam_protecter; + static function get_spam_protector() { + return self::$spam_protector; } /** - * Add the spam protecter field to a form + * Add the spam protector field to a form * @param Form the form that the protecter field added into * @param string the name of the field that the protecter field will be added in front of * @param array an associative array @@ -36,10 +36,10 @@ class SpamProtecterManager { */ static function update_form($form, $before=null, $fieldsToSpamServiceMapping=null) { $check = null; - $protectorClass = self::$spam_protecter; + $protectorClass = self::$spam_protector; if(!class_exists($protectorClass)) return null; - $protecter = new $protectorClass(); + $protector = new $protectorClass(); try { $check = $protecter->updateForm($form, $before, $fieldsToSpamServiceMapping); } catch (Exception $e) { @@ -48,7 +48,7 @@ class SpamProtecterManager { if(!$check) return null; - return $protecter; + return $protector; } /** @@ -60,8 +60,8 @@ class SpamProtecterManager { * @param String Feedback on the $object usually 'spam' or 'ham' for non spam entries */ static function send_feedback($object, $feedback) { - $protecter = new self::$spam_protecter(); - return $protecter->sendFeedback($object, $feedback); + $protector = new self::$spam_protector(); + return $protector->sendFeedback($object, $feedback); } } -?> \ No newline at end of file +?>