<?php 
$selected_reCaptcha_yes   = ($wo['config']['reCaptcha'] != 0)   ? ' checked' : '';

$selected_reCaptcha_no    = ($wo['config']['reCaptcha'] == 0)   ? ' checked' : '';

$active_reCaptcha_yes     = ($wo['config']['reCaptcha'] != 0)   ? ' active'  : '';

$active_reCaptcha_no      = ($wo['config']['reCaptcha'] == 0)   ? ' active'  : '';
?>

<form method="post" class="setting-reCaptcha-container tab-container">
   <?php if($wo['config']['reCaptcha'] == 1 && empty($wo['config']['reCaptchaKey'])) { ?>
   <div class="alert alert-danger page-margin">
      <i class="fa fa-exclamation-circle"></i> <?php echo $wo['lang']['reCaptcha_key_is_required']?>.
   </div>
   <?php } ?>
   <div class="row">
      <div class="col-lg-6">
         <div class="form-group inner-addon  <?php echo Wo_RightToLeft('left-addon');?> ">
            <div class="btn-group" data-toggle="buttons">
               <label class="btn btn-default btn-onoff <?php echo  $active_reCaptcha_yes;?>">
               <input type="radio" name="reCaptcha" value="1" <?php echo $selected_reCaptcha_yes;?> />
               <i class=" fa fa-power-off on"></i> <?php echo $wo['lang']['on']?>
               </label> 
               <label class="btn btn-default btn-onoff <?php echo $active_reCaptcha_no;?>">
               <input type="radio" name="reCaptcha" value="0" <?php echo $selected_reCaptcha_no;?> />
               <i class=" fa fa-power-off off"></i> <?php echo $wo['lang']['off']?>
               </label> 
            </div>
         </div>
         <h5><?php echo $wo['lang']['reCaptcha_key'];?></h5>
         <div class="form-group">
            <input type="text" name="reCaptchaKey" class="form-control input-md" placeholder="Google ReCaptcha Key" value="<?php echo $wo['config']['reCaptchaKey'];?>">
         </div>
         <div class="form-group">
            <div class="row">
               <div class="col-sm-4 pull-left">
                  <button type="submit" name="save_setting" class="form-control btn-main-color btn-main">
                  <i class="fa fa-floppy-o progress-icon" data-icon="floppy-o"></i> <?php echo $wo['lang']['save'];?>
                  </button>
               </div>
               <div class="setting-saved-update-alert"></div>
            </div>
         </div>
      </div>
   </div>
</form>
<script type="text/javascript">
$(function() {
    $('form.setting-reCaptcha-container').ajaxForm({
      url: Wo_Ajax_Requests_File() + '?f=admin_setting&s=update_reCaptcha_setting',
      beforeSend: function() {
        Wo_progressIconLoader($('form.setting-reCaptcha-container').find('button'));
      },
      success: function(data) {
        if (data.status == 200) {
          $('.setting-saved-update-alert').hide().fadeIn(200).html('<i class="fa fa-check"></i> <?php echo $wo["lang"]["saved"];?>').delay(2000).fadeOut(200);
        } 
        Wo_progressIconLoader($('form.setting-reCaptcha-container').find('button'));
      }
    });
});
</script>