contactsformcaptcha - Version 1.2.0

Version Notes

Added translate feature to module.

Download this release

Release Info

Developer Magento Core Team
Extension contactsformcaptcha
Version 1.2.0
Comparing to
See all releases


Code changes from version 1.1.0 to 1.2.0

app/code/community/OlegKoval/ContactsFormCaptcha/Model/System/Config/Source/Dropdown/Lang.php CHANGED
@@ -1,6 +1,11 @@
1
  <?php
2
  /**
3
  * Custom options for "reCaptcha Language" dropdown of "Contacts Form Captcha" customization
 
 
 
 
 
4
  */
5
  class OlegKoval_ContactsFormCaptcha_Model_System_Config_Source_Dropdown_Lang {
6
  public function toOptionArray() {
1
  <?php
2
  /**
3
  * Custom options for "reCaptcha Language" dropdown of "Contacts Form Captcha" customization
4
+ *
5
+ * @category OlegKoval
6
+ * @package OlegKoval_ContactsFormCaptcha
7
+ * @copyright Copyright (c) 2012 Oleg Koval
8
+ * @author Oleg Koval <oleh.koval@gmail.com>
9
  */
10
  class OlegKoval_ContactsFormCaptcha_Model_System_Config_Source_Dropdown_Lang {
11
  public function toOptionArray() {
app/code/community/OlegKoval/ContactsFormCaptcha/Model/System/Config/Source/Dropdown/Theme.php CHANGED
@@ -1,6 +1,11 @@
1
  <?php
2
  /**
3
  * Custom options for "reCaptcha Theme" dropdown of "Contacts Form Captcha" customization
 
 
 
 
 
4
  */
5
  class OlegKoval_ContactsFormCaptcha_Model_System_Config_Source_Dropdown_Theme {
6
  public function toOptionArray() {
1
  <?php
2
  /**
3
  * Custom options for "reCaptcha Theme" dropdown of "Contacts Form Captcha" customization
4
+ *
5
+ * @category OlegKoval
6
+ * @package OlegKoval_ContactsFormCaptcha
7
+ * @copyright Copyright (c) 2012 Oleg Koval
8
+ * @author Oleg Koval <oleh.koval@gmail.com>
9
  */
10
  class OlegKoval_ContactsFormCaptcha_Model_System_Config_Source_Dropdown_Theme {
11
  public function toOptionArray() {
app/code/community/OlegKoval/ContactsFormCaptcha/controllers/IndexController.php CHANGED
@@ -49,7 +49,7 @@ class OlegKoval_ContactsFormCaptcha_IndexController extends Mage_Contacts_IndexC
49
  if (strlen($lang) == 0 || !in_array($lang, array('en', 'nl', 'fr', 'de', 'pt', 'ru', 'es', 'tr'))) {
50
  $lang = 'en';
51
  }
52
- //small hack for language feature
53
  $captcha_code = str_replace('?k=', '?hl='. $lang .'&amp;k=', $captcha_code);
54
 
55
  $this->getLayout()->getBlock('contactForm')->setTemplate('contactsformcaptcha/form.phtml')
@@ -85,7 +85,7 @@ class OlegKoval_ContactsFormCaptcha_IndexController extends Mage_Contacts_IndexC
85
  $captcha = recaptcha_check_answer($privatekey, $remote_addr, $post["recaptcha_challenge_field"], $post["recaptcha_response_field"]);
86
 
87
  if (!$captcha->is_valid) {
88
- throw new Exception("The reCAPTCHA wasn't entered correctly. Go back and try it again.", 1);
89
  }
90
  }
91
  else {
49
  if (strlen($lang) == 0 || !in_array($lang, array('en', 'nl', 'fr', 'de', 'pt', 'ru', 'es', 'tr'))) {
50
  $lang = 'en';
51
  }
52
+ //small hack for language feature - because it's not working as described in documentation
53
  $captcha_code = str_replace('?k=', '?hl='. $lang .'&amp;k=', $captcha_code);
54
 
55
  $this->getLayout()->getBlock('contactForm')->setTemplate('contactsformcaptcha/form.phtml')
85
  $captcha = recaptcha_check_answer($privatekey, $remote_addr, $post["recaptcha_challenge_field"], $post["recaptcha_response_field"]);
86
 
87
  if (!$captcha->is_valid) {
88
+ throw new Exception($this->__("The reCAPTCHA wasn't entered correctly. Go back and try it again."), 1);
89
  }
90
  }
91
  else {
app/code/community/OlegKoval/ContactsFormCaptcha/etc/config.xml CHANGED
@@ -12,7 +12,7 @@
12
  <config>
13
  <modules>
14
  <OlegKoval_ContactsFormCaptcha>
15
- <version>1.0.0</version>
16
  <depends>
17
  <Mage_Contacts/>
18
  </depends>
@@ -43,5 +43,14 @@
43
  </args>
44
  </contacts>
45
  </routers>
 
 
 
 
 
 
 
 
 
46
  </frontend>
47
  </config>
12
  <config>
13
  <modules>
14
  <OlegKoval_ContactsFormCaptcha>
15
+ <version>1.2.0</version>
16
  <depends>
17
  <Mage_Contacts/>
18
  </depends>
43
  </args>
44
  </contacts>
45
  </routers>
46
+ <translate>
47
+ <modules>
48
+ <OlegKoval_ContactsFormCaptcha>
49
+ <files>
50
+ <default>OlegKoval_ContactsFormCaptcha.csv</default>
51
+ </files>
52
+ </OlegKoval_ContactsFormCaptcha>
53
+ </modules>
54
+ </translate>
55
  </frontend>
56
  </config>
app/design/frontend/base/default/template/contactsformcaptcha/form.phtml CHANGED
@@ -32,7 +32,7 @@
32
  //<![CDATA[
33
  var RecaptchaOptions = {
34
  theme : '<?php echo $this->getCaptchaTheme(); ?>',
35
- lang : '<?php echo $this->getCaptchaLang(); ?>'
36
  };
37
  //]]>
38
  </script>
32
  //<![CDATA[
33
  var RecaptchaOptions = {
34
  theme : '<?php echo $this->getCaptchaTheme(); ?>',
35
+ lang : '<?php echo $this->getCaptchaLang(); ?>',
36
  };
37
  //]]>
38
  </script>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>contactsformcaptcha</name>
4
- <version>1.1.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/OSL-3.0">OSL v3.0</license>
7
  <channel>community</channel>
@@ -10,11 +10,11 @@
10
  <description>"Contacts Form Captcha" extension add in easy way the captcha to "Contact Us" form.&#xD;
11
  &#xD;
12
  This extension uses reCaptcha library (http://www.google.com/recaptcha).</description>
13
- <notes>"Contacts Form Captcha" extension add in easy way the captcha to "Contact Us" form.</notes>
14
  <authors><author><name>Oleg Koval</name><user>auto-converted</user><email>oleh.koval@gmail.com</email></author></authors>
15
- <date>2012-11-26</date>
16
- <time>11:36:33</time>
17
- <contents><target name="magecommunity"><dir name="OlegKoval"><dir name="ContactsFormCaptcha"><dir name="Model"><dir name="System"><dir name="Config"><dir name="Source"><dir name="Dropdown"><file name="Lang.php" hash="ae1c2d598a57c0891cceb2b48299db01"/><file name="Theme.php" hash="b1c88e827e2bbf4ddd9b532a0f76212f"/></dir></dir></dir></dir></dir><dir name="controllers"><file name="IndexController.php" hash="27fbbd9fd3d843fa16e09189a237cff5"/></dir><dir name="etc"><file name="config.xml" hash="675b557f1408e3a069e73b66122ba4e9"/><file name="system.xml" hash="53181e763cde62e4d58e21f600abff1a"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="OlegKoval_ContactsFormCaptcha.xml" hash="9b7cbc1587fc43d6a0cd1106bc19a4fc"/></dir></target><target name="magelib"><dir name="reCaptcha"><file name="recaptchalib.php" hash="f80a9f01727de68aba8e98f1e37345a9"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="contactsformcaptcha.xml" hash="797d1d456b4f7e6d4bdbb4308065b5fa"/></dir><dir name="template"><dir name="contactsformcaptcha"><file name="form.phtml" hash="5ba848935abf9b97a8a8ecac66dcc829"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="OlegKoval_ContactsFormCaptcha.csv" hash="a13e19dd1a4af77cf79394ca43f6bc0f"/></dir></target></contents>
18
  <compatible/>
19
  <dependencies/>
20
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>contactsformcaptcha</name>
4
+ <version>1.2.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/OSL-3.0">OSL v3.0</license>
7
  <channel>community</channel>
10
  <description>"Contacts Form Captcha" extension add in easy way the captcha to "Contact Us" form.&#xD;
11
  &#xD;
12
  This extension uses reCaptcha library (http://www.google.com/recaptcha).</description>
13
+ <notes>Added translate feature to module.</notes>
14
  <authors><author><name>Oleg Koval</name><user>auto-converted</user><email>oleh.koval@gmail.com</email></author></authors>
15
+ <date>2013-02-14</date>
16
+ <time>09:31:01</time>
17
+ <contents><target name="magecommunity"><dir name="OlegKoval"><dir name="ContactsFormCaptcha"><dir name="Model"><dir name="System"><dir name="Config"><dir name="Source"><dir name="Dropdown"><file name="Lang.php" hash="c3b3814ccfc3f97fb8807f0d4ad69d8c"/><file name="Theme.php" hash="c0a7eb1ad6e2157b5f822d0a5d30022c"/></dir></dir></dir></dir></dir><dir name="controllers"><file name="IndexController.php" hash="7357f05ccb582bdf53e36a6c0a0f15f7"/></dir><dir name="etc"><file name="config.xml" hash="79c504b477c40db06d8b9d6322612c74"/><file name="system.xml" hash="53181e763cde62e4d58e21f600abff1a"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="OlegKoval_ContactsFormCaptcha.xml" hash="9b7cbc1587fc43d6a0cd1106bc19a4fc"/></dir></target><target name="magelib"><dir name="reCaptcha"><file name="recaptchalib.php" hash="f80a9f01727de68aba8e98f1e37345a9"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="contactsformcaptcha.xml" hash="797d1d456b4f7e6d4bdbb4308065b5fa"/></dir><dir name="template"><dir name="contactsformcaptcha"><file name="form.phtml" hash="c07fd4475c062ab7e66a54997d72991f"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="OlegKoval_ContactsFormCaptcha.csv" hash="a13e19dd1a4af77cf79394ca43f6bc0f"/></dir></target></contents>
18
  <compatible/>
19
  <dependencies/>
20
  </package>