| 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 |
<form id="wpsc_get_tinymce_settings" method="post" action="javascript:wpsc_set_tinymce_settings();"> |
| 12 |
<div class="form-group"> |
| 13 |
<label for="wpsc_allow_rich_text_editor"><?php _e('Allow rich text editor','supportcandy'); ?></label> |
| 14 |
<p class="help-block"><?php _e("Only selected roles can use rich text editor.","supportcandy"); ?></p> |
| 15 |
<div class="row"> |
| 16 |
<?php $wpsc_allow_rich_text_editor = get_option('wpsc_allow_rich_text_editor'); ?> |
| 17 |
|
| 18 |
<div class="col-sm-4" style="margin-bottom:10px; display:flex;"> |
| 19 |
<?php $checked = in_array('register_user', $wpsc_allow_rich_text_editor) ? 'checked="checked"' : '';?> |
| 20 |
<div style="width:25px;"><input <?php echo esc_attr($checked) ?> type="checkbox" name="wpsc_allow_rte[]" value="register_user" /></div> |
| 21 |
<div style="padding-top:3px;"><?php _e('Registered Users','supportcandy') ?></div> |
| 22 |
</div> |
| 23 |
|
| 24 |
<div class="col-sm-4" style="margin-bottom:10px; display:flex;"> |
| 25 |
<?php $checked = in_array('guest_user', $wpsc_allow_rich_text_editor) ? 'checked="checked"' : '';?> |
| 26 |
<div style="width:25px;"><input <?php echo esc_attr($checked) ?> type="checkbox" name="wpsc_allow_rte[]" value="guest_user" /></div> |
| 27 |
<div style="padding-top:3px;"><?php _e('Guest','supportcandy') ?></div> |
| 28 |
</div> |
| 29 |
|
| 30 |
</div> |
| 31 |
</div> |
| 32 |
|
| 33 |
<div class="form-group"> |
| 34 |
<?php |
| 35 |
$wpsc_tinymce_toolbar = get_option('wpsc_tinymce_toolbar'); |
| 36 |
$wpsc_tinymce_toolbar_active = get_option('wpsc_tinymce_toolbar_active'); |
| 37 |
?> |
| 38 |
<label for="wpsc_tinymce_toolbar"><?php _e('Tinymce toolbar','supportcandy');?></label> |
| 39 |
<div class="row"> |
| 40 |
<?php foreach ($wpsc_tinymce_toolbar as $key=> $val) {?> |
| 41 |
<div class="col-sm-4" style="margin-bottom:10px; display:flex;"> |
| 42 |
<?php $checked = in_array($key, $wpsc_tinymce_toolbar_active) ? 'checked="checked"' : '';?> |
| 43 |
<div style="width:25px;"><input <?php echo esc_attr($checked) ?> type="checkbox" name="wpsc_tinymce_toolbar[]" value= <?php echo esc_attr($key)?> /></div> |
| 44 |
<div style="padding-top:3px;"><?php echo esc_attr($val['name']) ?></div> |
| 45 |
</div> |
| 46 |
<?php } ?> |
| 47 |
</div> |
| 48 |
</div> |
| 49 |
|
| 50 |
<div class="form-group"> |
| 51 |
<label for="wpsc_html_pasting"><?php _e('Allow direct HTML pasting','supportcandy');?></label> |
| 52 |
<p class="help-block"><?php _e("Enable/Disable HTML pasting","supportcandy");?></p> |
| 53 |
<select class="form-control" name="wpsc_html_pasting" id="wpsc_html_pasting"> |
| 54 |
<?php |
| 55 |
$wpsc_allow_html_pasting = get_option('wpsc_allow_html_pasting'); |
| 56 |
$selected = $wpsc_allow_html_pasting == '1' ? 'selected="selected"' : ''; |
| 57 |
echo '<option '.esc_attr($selected).' value="1">'.__('Enable','supportcandy').'</option>'; |
| 58 |
$selected = $wpsc_allow_html_pasting == '0' ? 'selected="selected"' : ''; |
| 59 |
echo '<option '.esc_attr($selected).' value="0">'.__('Disable','supportcandy').'</option>'; |
| 60 |
?> |
| 61 |
</select> |
| 62 |
</div> |
| 63 |
|
| 64 |
<button type="submit" class="btn btn-success"><?php _e('Save Changes','supportcandy');?></button> |
| 65 |
<img class="wpsc_submit_wait" style="display:none;" src="<?php echo esc_url(WPSC_PLUGIN_URL.'asset/images/[email protected]');?>"> |
| 66 |
<input type="hidden" name="action" value="wpsc_settings" /> |
| 67 |
<input type="hidden" name="setting_action" value="set_tinymce_settings" /> |
| 68 |
<input type="hidden" name="_ajax_nonce" value="<?php echo wp_create_nonce('set_tinymce_settings')?>"> |
| 69 |
</form> |