summaryrefslogtreecommitdiff
path: root/modules/recaptcha/libraries
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-01-27 08:21:54 +0000
committerBharat Mediratta <bharat@menalto.com>2009-01-27 08:21:54 +0000
commita30c28b5fc2ff8152de61c2c3440d9a7131deab8 (patch)
tree00ea514d5d4110fb5d03a6147cf1936f5cff6e38 /modules/recaptcha/libraries
parent2a9d48f8bb0acb75a2d8ed30eb85ae79f7933afa (diff)
Make the comment -> recaptcha binding happen via an event dispatch as
opposed to a direct call.
Diffstat (limited to 'modules/recaptcha/libraries')
-rw-r--r--modules/recaptcha/libraries/Form_Recaptcha.php18
1 files changed, 10 insertions, 8 deletions
diff --git a/modules/recaptcha/libraries/Form_Recaptcha.php b/modules/recaptcha/libraries/Form_Recaptcha.php
index f834f068..271045c2 100644
--- a/modules/recaptcha/libraries/Form_Recaptcha.php
+++ b/modules/recaptcha/libraries/Form_Recaptcha.php
@@ -27,26 +27,28 @@ class Form_Recaptcha_Core extends Form_Input {
public function __construct($name) {
parent::__construct($name);
- $this->error_messages("incorrect-captcha-sol", t("The values supplied to recaptcha are incorrect."));
+ $this->error_messages("incorrect-captcha-sol",
+ t("The values supplied to recaptcha are incorrect."));
$this->error_messages("invalid-site-private-key", t("The site private key is incorrect."));
}
public function render() {
$public_key = module::get_var("recaptcha", "public_key");
- if (empty($public_key)) {
+ if (empty($public_key)) {
throw new Exception("@todo NEED KEY <a href=\"http://recaptcha.net/api/getkey\">" .
- "http://recaptcha.net/api/getkey</a>");
- }
+ "http://recaptcha.net/api/getkey</a>");
+ }
- $server = "http://api.recaptcha.net";
+ $server = "http://api.recaptcha.net";
$options[] = "callback: Recaptcha.focus_response_field";
$options[] = "lang: \"" . Kohana::config("locale.root_locale") . "\"";
$options[] = "theme: \"white\"";
$options = implode(", ", $options);
-
+
$html = "<div id=\"gRecaptcha\" />";
- $html .= "<script type=\"text/javascript\" src=\"http://api.recaptcha.net/js/recaptcha_ajax.js\"></script>";
+ $html .= "<script type=\"text/javascript\" ";
+ $html .= "src=\"http://api.recaptcha.net/js/recaptcha_ajax.js\"></script>";
$html .= "<script type=\"text/javascript\">";
$html .= "Recaptcha.create(\"$public_key\", \"gRecaptcha\", {" . $options . "});";
$html .= "</script>";
@@ -72,4 +74,4 @@ class Form_Recaptcha_Core extends Form_Input {
return empty($this->_error);
}
-} \ No newline at end of file
+} \ No newline at end of file