| 1 |
<?php |
| 2 |
|
| 3 |
$action = ( isset($_GET['action']) ) ? sanitize_key( $_GET['action'] ) : ''; |
| 4 |
$id = ( isset($_GET['id']) ) ? absint( sanitize_key( $_GET['id'] ) ) : null; |
| 5 |
|
| 6 |
if( $action == 'duplicate' && !is_null($id) ){ |
| 7 |
// Verify nonce to protect against CSRF |
| 8 |
$nonce = isset($_GET['_wpnonce']) ? sanitize_text_field( $_GET['_wpnonce'] ) : ''; |
| 9 |
|
| 10 |
if ( ! wp_verify_nonce( $nonce, $this->plugin_name . '-duplicate-survey-category' ) ) { |
| 11 |
die( 'Go get a life script kiddies' ); |
| 12 |
} |
| 13 |
|
| 14 |
$this->surveys_categories_obj->duplicate_survey_categories($id); |
| 15 |
} |
| 16 |
|
| 17 |
$plus_icon_svg = "<span class=''><img src='". SURVEY_MAKER_ADMIN_URL ."/images/icons/plus-icon.svg'></span>"; |
| 18 |
|
| 19 |
?> |
| 20 |
<div class="wrap"> |
| 21 |
<div class="ays-survey-heading-box"> |
| 22 |
<div class="ays-survey-wordpress-user-manual-box"> |
| 23 |
<a href="https://ays-pro.com/wordpress-survey-maker-user-manual#frag_survey_cat" target="_blank" style="text-decoration: none;font-size: 13px;"> |
| 24 |
<i class="ays_fa ays_fa_file_text" ></i> |
| 25 |
<span style="margin-left: 3px;text-decoration: underline;"><?php echo esc_html__('How to use survey categories', 'survey-maker'); ?></span> |
| 26 |
</a> |
| 27 |
</div> |
| 28 |
</div> |
| 29 |
<h1 class="wp-heading-inline"> |
| 30 |
<?php |
| 31 |
echo esc_html__(get_admin_page_title(), "survey-maker" ); |
| 32 |
?> |
| 33 |
</h1> |
| 34 |
<?php do_action('ays_survey_sale_banner'); ?> |
| 35 |
<div class="ays-survey-maker-add-new-button-box"> |
| 36 |
<?php echo sprintf( '<a href="?page=%s&action=%s" class="page-title-action button-primary ays-survey-add-new-button-new-design"> %s ' . esc_html__( 'Add New', "survey-maker" ) . '</a>', esc_attr( $_REQUEST['page'] ), 'add', wp_kses($plus_icon_svg, Survey_Maker_Data::get_allowed_tags_for_loader())); ?> |
| 37 |
</div> |
| 38 |
|
| 39 |
<div id="poststuff" style="padding-top: 0;"> |
| 40 |
<div id="post-body" class="metabox-holder"> |
| 41 |
<div id="post-body-content" style="margin-bottom: 10px;"> |
| 42 |
<div class="meta-box-sortables ui-sortable"> |
| 43 |
<?php |
| 44 |
$this->surveys_categories_obj->views(); |
| 45 |
?> |
| 46 |
<form method="post"> |
| 47 |
<?php |
| 48 |
$this->surveys_categories_obj->prepare_items(); |
| 49 |
$search = __( "Search", "survey-maker" ); |
| 50 |
$this->surveys_categories_obj->search_box($search, $this->plugin_name); |
| 51 |
$this->surveys_categories_obj->display(); |
| 52 |
?> |
| 53 |
</form> |
| 54 |
</div> |
| 55 |
</div> |
| 56 |
</div> |
| 57 |
<br class="clear"> |
| 58 |
<div class="ays-survey-maker-add-new-button-box"> |
| 59 |
<?php echo sprintf( '<a href="?page=%s&action=%s" class="page-title-action button-primary ays-survey-add-new-button-new-design"> %s ' . esc_html__( 'Add New', "survey-maker" ) . '</a>', esc_attr( $_REQUEST['page'] ), 'add', wp_kses($plus_icon_svg, Survey_Maker_Data::get_allowed_tags_for_loader())); ?> |
| 60 |
</div> |
| 61 |
</div> |
| 62 |
</div> |
| 63 |
|