Sha256: 3b9e7e499efb2a8cded4e6edbc841d974626dab169ffb6f508eeb8e69a3d8f5d
Contents?: true
Size: 1.2 KB
Versions: 1
Compression:
Stored size: 1.2 KB
Contents
require 'ruby-recaptcha' # You have to name your module Bricks::[NameOfBrick]::Zafu in order # for the module to be inserted into the ZafuParser. module Bricks module Captcha module Zafu def r_captcha return parser_error("recaptcha keys not set") unless current_site.dyn['recaptcha_pub'] && current_site.dyn['recaptcha_priv'] res = "<%= get_captcha(:rcc_pub => #{visitor.site.dyn['recaptcha_pub'].inspect}, :rcc_priv => #{visitor.site.dyn['recaptcha_priv'].inspect}#{get_recaptcha_params}) %>" res += expand_with "<% if visitor.is_anon? -%>#{render_html_tag(res)}<% end -%>" end def r_mail_hide text = get_text_for_erb "<%= visitor.is_anon? ? mail_hide(#{text},:mh_pub => #{visitor.site.d_mail_hide_pub.inspect}, :mh_priv => #{visitor.site.d_mail_hide_priv.inspect}#{get_recaptcha_params}) : #{text} %>" end def get_recaptcha_params res = ", :options => {" res << ":theme => #{(@params[:theme] || 'red').inspect}" res << ", :lang => #{(@params[:lang] || helper.send(:lang)).inspect}" res << ", :tabindex => #{(@params[:tabindex] || 0).to_i}}" res end end # Zafu end # Captcha end # Bricks
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
zena-0.15.0 | bricks/captcha/zafu/captcha.rb |