[FEATURE] add hook for custom powermail error messages 43/29843/3
authortritum_rz <ralf.zimmermann@tritum.de>
Sun, 4 May 2014 09:45:25 +0000 (11:45 +0200)
committerRalf Zimmermann <ralf.zimmermann@tritum.de>
Sun, 4 May 2014 09:47:06 +0000 (11:47 +0200)
Resolves: #58442
Change-Id: I72e21f15215983446a81f9361532a2267972d0ca
Reviewed-on: https://review.typo3.org/29843
Reviewed-by: Ralf Zimmermann
Tested-by: Ralf Zimmermann
ChangeLog
Classes/Extensions/class.tx_wtspamshield_powermail.php
ext_emconf.php

index c9196b4..a6b2eca 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+1.2.2
+       2014-05-04
+       Ralf Zimmermann <ralf.zimmermann@tritum.de>
+
+       * ADD feature #58442: add hook for custom powermail error messages 
+
 1.2.1
        2014-05-03
        Ralf Zimmermann <ralf.zimmermann@tritum.de>
index 7225e5f..fe98a72 100644 (file)
@@ -118,7 +118,16 @@ class tx_wtspamshield_powermail extends tslib_pibase {
 
                                // Return Error message if exists
                        if (strlen($error) > 0) {
-                               return '<div class="wtspamshield-errormsg">' . $error . '</div>';
+                               if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['wt_spamshield']['customMessageOnError'][$this->tsKey])) {
+                                       $customError = '';
+                                       foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['wt_spamshield']['customMessageOnError'][$this->tsKey] as $_classRef) {
+                                               $_procObj = &t3lib_div::getUserObj($_classRef);
+                                               $customError .= $_procObj->customMessageOnError($error, $this);
+                                       }
+                                       return $customError;
+                               } else {
+                                       return '<div class="wtspamshield-errormsg">' . $error . '</div>';
+                               }
                        }
                }
 
@@ -163,4 +172,4 @@ if (defined('TYPO3_MODE')
        require_once ($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/wt_spamshield/Classes/Extensions/class.tx_wtspamshield_powermail.php']);
 }
 
-?>
\ No newline at end of file
+?>
index baf4cda..48e0b43 100644 (file)
@@ -15,7 +15,7 @@ $EM_CONF[$_EXTKEY] = array(
        'description' => 'Spam shield without captcha to avoid spam in powermail, ve_guestbook, comments, t3_blog, direct_mail_subscription and standard TYPO3 mailforms. Session check, Link check, Time check, Akismet check, Name check, Honeypot check (see manual for details)',
        'category' => 'services',
        'shy' => 0,
-       'version' => '1.2.1',
+       'version' => '1.2.2',
        'dependencies' => '',
        'conflicts' => 'mf_akismet,wt_calculating_captcha',
        'priority' => '',