| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
exit; // Exit if accessed directly |
| 4 |
} |
| 5 |
|
| 6 |
global $current_user; |
| 7 |
if (!($current_user->ID && $current_user->has_cap('manage_options'))) { |
| 8 |
exit; |
| 9 |
} |
| 10 |
?> |
| 11 |
|
| 12 |
<form id="wpsc_frm_general_settings" method="post" action="javascript:wpsc_set_en_general_settings();"> |
| 13 |
|
| 14 |
<div class="form-group"> |
| 15 |
<label for="wpsc_en_from_name"><?php _e('From Name','supportcandy');?></label> |
| 16 |
<p class="help-block"><?php _e('Emails to send by this name.','supportcandy');?></p> |
| 17 |
<input type="text" class="form-control" name="wpsc_en_from_name" id="wpsc_en_from_name" value="<?php echo esc_attr(get_option('wpsc_en_from_name',''));?>" /> |
| 18 |
</div> |
| 19 |
|
| 20 |
<div class="form-group"> |
| 21 |
<label for="wpsc_en_from_email"><?php _e('From Email','supportcandy');?></label> |
| 22 |
<p class="help-block"><?php _e('Emails to send from this email.','supportcandy');?></p> |
| 23 |
<input type="text" class="form-control" name="wpsc_en_from_email" id="wpsc_en_from_email" value="<?php echo esc_attr(get_option('wpsc_en_from_email',''));?>" /> |
| 24 |
</div> |
| 25 |
|
| 26 |
<div class="form-group"> |
| 27 |
<label for="wpsc_en_reply_to"><?php _e('Reply to','supportcandy');?></label> |
| 28 |
<p class="help-block"><?php _e('(Optional) When recipients reply to the notification from their inbox, reply will be sent to this email address.','supportcandy');?></p> |
| 29 |
<input type="text" class="form-control" name="wpsc_en_reply_to" id="wpsc_en_reply_to" value="<?php echo esc_attr(get_option('wpsc_en_reply_to',''));?>" /> |
| 30 |
</div> |
| 31 |
|
| 32 |
<div class="form-group"> |
| 33 |
<label for="wpsc_en_ignore_emails"><?php _e('Ignore Emails','supportcandy');?></label> |
| 34 |
<p class="help-block"><?php _e('Emails will not be sent to these email addresses. New email should begin on new line. You can insert email pattern like *@paypal.com, admin@*, etc.','supportcandy');?></p> |
| 35 |
<?php |
| 36 |
$ignore_emails = get_option('wpsc_en_ignore_emails',array()); |
| 37 |
?> |
| 38 |
<textarea class="form-control" style="height:100px !important;" name="wpsc_en_ignore_emails" id="wpsc_en_ignore_emails"><?php echo stripcslashes(implode('\n', $ignore_emails))?></textarea> |
| 39 |
</div> |
| 40 |
|
| 41 |
<div class="form-group"> |
| 42 |
<label for="wpsc_email_sending_method"><?php _e('Email sending preference','supportcandy');?></label> |
| 43 |
<p class="help-block"><?php _e("Select how an email notification will be sent.","supportcandy");?></p> |
| 44 |
<select class="form-control" name="wpsc_email_sending_method" id="wpsc_email_sending_method"> |
| 45 |
<?php |
| 46 |
$wpsc_email_sending_method = get_option('wpsc_email_sending_method'); |
| 47 |
$selected = $wpsc_email_sending_method == '1' ? 'selected="selected"' : ''; |
| 48 |
echo '<option '.$selected.' value="1">'.__('Background (Increase screen load time)','supportcandy').'</option>'; |
| 49 |
$selected = $wpsc_email_sending_method == '0' ? 'selected="selected"' : ''; |
| 50 |
echo '<option '.$selected.' value="0">'.__('Instant','supportcandy').'</option>'; |
| 51 |
?> |
| 52 |
</select> |
| 53 |
</div> |
| 54 |
|
| 55 |
<div class="form-group" id="wpsc_en_mail_count" style="<?php echo esc_attr($wpsc_email_sending_method) == '0' ? 'display:none' : '' ?>"> |
| 56 |
<label for="wpsc_en_send_mail_count"><?php _e('Email frequency','supportcandy');?></label> |
| 57 |
<p class="help-block"><?php _e('Number of emails sent for each cron job call.','supportcandy');?></p> |
| 58 |
<input type="number" min="1" class="form-control" name="wpsc_en_send_mail_count" id="wpsc_en_send_mail_count" value="<?php echo esc_attr(get_option('wpsc_en_send_mail_count'));?>" /> |
| 59 |
</div> |
| 60 |
|
| 61 |
<?php do_action('wpsc_get_gerneral_settings');?> |
| 62 |
|
| 63 |
<button type="submit" class="btn btn-success"><?php _e('Save Changes','supportcandy');?></button> |
| 64 |
<img class="wpsc_submit_wait" style="display:none;" src="<?php echo esc_url(WPSC_PLUGIN_URL.'asset/images/[email protected]');?>"> |
| 65 |
<input type="hidden" name="action" value="wpsc_email_notifications" /> |
| 66 |
<input type="hidden" name="setting_action" value="set_en_general_settings" /> |
| 67 |
<input type="hidden" name="_ajax_nonce" value="<?php echo wp_create_nonce('set_en_general_settings')?>"> |
| 68 |
|
| 69 |
</form> |
| 70 |
<script> |
| 71 |
jQuery('#wpsc_email_sending_method').on('change', function() { |
| 72 |
if(this.value == '1'){ |
| 73 |
jQuery('#wpsc_en_mail_count').show(); |
| 74 |
}else{ |
| 75 |
jQuery('#wpsc_en_mail_count').hide(); |
| 76 |
} |
| 77 |
}); |
| 78 |
</script> |