Changeset 8031 for extensions/captcha


Ignore:
Timestamp:
12/08/10 09:04:22 (9 years ago)
Author:
patdenice
Message:

Code simplification

Location:
extensions/captcha
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/captcha/main.inc.php

    r8030 r8031  
    3131{ 
    3232  global $template, $conf; 
     33 
    3334  $template->set_prefilter('register', 'captcha_prefilter'); 
    34   $template->assign('CAPTCHA', recaptcha_get_html($conf['captcha_publickey'], get_plugin_data('captcha'))); 
     35  $template->set_filename('captcha', realpath(CAPTCHA_PATH.'captcha.tpl')); 
     36  $template->assign('CAPTCHA_HTML', recaptcha_get_html($conf['captcha_publickey'], get_plugin_data('captcha'))); 
     37  $template->assign_var_from_handle('CAPTCHA', 'captcha'); 
    3538} 
    3639 
     
    3841{ 
    3942  $search = '<p class="bottomButtons">'; 
    40   $captcha = '<div>{$CAPTCHA}</div>'; 
    41   $js = '<script type= "text/javascript">var RecaptchaOptions = {ldelim} theme: "white", lang : "{$lang_info.code}" };</script>'; 
    42   $css = '{html_head}<style type="text/css">#recaptcha_area {ldelim} margin: 25px auto; }</style>{/html_head}'; 
     43  $captcha = '{$CAPTCHA}'; 
    4344 
    44   return str_replace($search, $js."\n".$css."\n".$captcha."\n".$search, $content); 
     45  return str_replace($search, $captcha."\n".$search, $content); 
    4546} 
    4647 
Note: See TracChangeset for help on using the changeset viewer.