| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
exit; // Exit if accessed directly |
| 4 |
} |
| 5 |
|
| 6 |
global $current_user,$wpscfunction; |
| 7 |
if (!($current_user->ID && $current_user->has_cap('manage_options'))) { |
| 8 |
exit; |
| 9 |
} |
| 10 |
|
| 11 |
$wpsc_thankyou_html = stripslashes(get_option('wpsc_thankyou_html')); |
| 12 |
$wpsc_thankyou_url = get_option('wpsc_thankyou_url'); |
| 13 |
$rich_editing = $wpscfunction->rich_editing_status($current_user); |
| 14 |
|
| 15 |
$directionality = $wpscfunction->check_rtl(); |
| 16 |
|
| 17 |
?> |
| 18 |
<form id="wpsc_frm_thankyou_settings" method="post" action="javascript:wpsc_set_thankyou_settings();"> |
| 19 |
|
| 20 |
<div class="form-group"> |
| 21 |
<label for="wpsc_thankyou_html"><?php _e('Thank you text','supportcandy');?></label> |
| 22 |
<p class="help-block"><?php _e("Text to show on thank you screen.","supportcandy");?></p> |
| 23 |
<?php if($rich_editing){?> |
| 24 |
<div class="text-right"> |
| 25 |
<button id="visual" class="wpsc-switch-editor wpsc-switch-editor-active" type="button" onclick="wpsc_get_tinymce('wpsc_thankyou_html','thankyou_body');"><?php _e('Visual', 'supportcandy');?></button> |
| 26 |
<button id="text" class="wpsc-switch-editor" type="button" onclick="wpsc_get_textarea('wpsc_thankyou_html')"><?php _e('Text', 'supportcandy');?></button> |
| 27 |
</div> |
| 28 |
<?php } ?> |
| 29 |
<textarea class="form-control" name="wpsc_thankyou_html" id="wpsc_thankyou_html"><?php echo wp_kses_post($wpsc_thankyou_html)?></textarea> |
| 30 |
<div class="row attachment_link"> |
| 31 |
<span onclick="wpsc_get_templates(); "><?php _e('Insert Macros','supportcandy') ?></span> |
| 32 |
</div> |
| 33 |
</div> |
| 34 |
|
| 35 |
<div class="form-group"> |
| 36 |
<label for="wpsc_thankyou_url"><?php _e('Thank you page redirect url','supportcandy');?></label> |
| 37 |
<p class="help-block"><?php _e("Url to redirect in case you want to show your custom thank you page. Keep this empty to show above default thank you messege.","supportcandy");?></p> |
| 38 |
<input type="text" class="form-control" name="wpsc_thankyou_url" id="wpsc_thankyou_url" value="<?php echo esc_attr($wpsc_thankyou_url)?>" /> |
| 39 |
</div> |
| 40 |
|
| 41 |
<?php do_action('wpsc_get_thankyou_settings');?> |
| 42 |
|
| 43 |
<button type="submit" class="btn btn-success"><?php _e('Save Changes','supportcandy');?></button> |
| 44 |
<img class="wpsc_submit_wait" style="display:none;" src="<?php echo esc_url(WPSC_PLUGIN_URL.'asset/images/[email protected]');?>"> |
| 45 |
<input type="hidden" name="action" value="wpsc_settings" /> |
| 46 |
<input type="hidden" name="setting_action" value="set_thankyou_settings" /> |
| 47 |
<input type="hidden" name="_ajax_nonce" value="<?php echo wp_create_nonce('set_thankyou_settings')?>"> |
| 48 |
</form> |
| 49 |
|
| 50 |
<script> |
| 51 |
function wpsc_get_tinymce(selector,body_id){ |
| 52 |
|
| 53 |
jQuery('#visual_header').addClass('btn btn-primary visual_header'); |
| 54 |
jQuery('#text_header').removeClass('btn btn-primary text_header'); |
| 55 |
jQuery('#text_header').addClass('btn btn-default text_header'); |
| 56 |
jQuery('#text').removeClass('wpsc-switch-editor-active'); |
| 57 |
jQuery('#visual').addClass('wpsc-switch-editor-active'); |
| 58 |
tinymce.init({ |
| 59 |
selector:'#'+selector, |
| 60 |
body_id: body_id, |
| 61 |
menubar: false, |
| 62 |
statusbar: false, |
| 63 |
height : '200', |
| 64 |
plugins: [ |
| 65 |
'lists link image directionality' |
| 66 |
], |
| 67 |
image_advtab: true, |
| 68 |
toolbar: 'bold italic underline blockquote | alignleft aligncenter alignright | bullist numlist | rtl | link image', |
| 69 |
branding: false, |
| 70 |
autoresize_bottom_margin: 20, |
| 71 |
browser_spellcheck : true, |
| 72 |
relative_urls : false, |
| 73 |
remove_script_host : false, |
| 74 |
convert_urls : true, |
| 75 |
setup: function (editor) { |
| 76 |
} |
| 77 |
}); |
| 78 |
} |
| 79 |
|
| 80 |
function wpsc_get_textarea(selector){ |
| 81 |
|
| 82 |
jQuery('#visual_body').removeClass('btn btn-primary visual_body'); |
| 83 |
jQuery('#visual_body').addClass('btn btn-default visual_body'); |
| 84 |
jQuery('#text_body').addClass('btn btn-primary text_body'); |
| 85 |
tinymce.remove('#'+selector); |
| 86 |
jQuery('#text').addClass('wpsc-switch-editor-active'); |
| 87 |
jQuery('#visual').removeClass('wpsc-switch-editor-active'); |
| 88 |
} |
| 89 |
|
| 90 |
tinymce.remove(); |
| 91 |
tinymce.init({ |
| 92 |
selector:'#wpsc_thankyou_html', |
| 93 |
body_id: 'thankyou_body', |
| 94 |
directionality : '<?php echo esc_attr($directionality); ?>', |
| 95 |
menubar: false, |
| 96 |
statusbar: false, |
| 97 |
height : '200', |
| 98 |
plugins: [ |
| 99 |
'lists link image directionality' |
| 100 |
], |
| 101 |
image_advtab: true, |
| 102 |
toolbar: 'bold italic underline blockquote | alignleft aligncenter alignright | bullist numlist | rtl | link image', |
| 103 |
branding: false, |
| 104 |
autoresize_bottom_margin: 20, |
| 105 |
browser_spellcheck : true, |
| 106 |
relative_urls : false, |
| 107 |
remove_script_host : false, |
| 108 |
convert_urls : true, |
| 109 |
setup: function (editor) { |
| 110 |
} |
| 111 |
}); |
| 112 |
</script> |