| @@ -2,56 +2,20 @@ | ||
| 2 | 2 | /* |
| 3 | 3 | * Page Name: Add New |
| 4 | 4 | */ |
| 5 | 5 | |
| 6 | -use WPCoder\Dashboard\DashboardInitializer; | |
| 7 | 6 | use WPCoder\Dashboard\Field; |
| 8 | 7 | use WPCoder\Dashboard\Settings; |
| 9 | -use WPCoder\WPCoder; | |
| 8 | +use WPCoder\WOW_Plugin; | |
| 10 | 9 | |
| 11 | 10 | defined( 'ABSPATH' ) || exit; |
| 12 | 11 | |
| 13 | 12 | $default = Field::getDefault(); |
| 14 | 13 | |
| 15 | -$action = isset( $_GET['action'] ) ? sanitize_text_field( $_GET['action'] ) : ''; | |
| 16 | -$item_id = isset( $_GET['id'] ) ? absint( $_GET['id'] ) : ''; | |
| 17 | -$item_title = __( 'Add new code', 'wpcoder' ); | |
| 18 | -if ( $action === 'update' && ! empty( $item_id ) ) { | |
| 19 | - $item_title = __( 'Update code', 'wpcoder' ) . ' ID: ' . $item_id; | |
| 20 | -} elseif ( $action === 'duplicate' && ! empty( $item_id ) ) { | |
| 21 | - $item_title = __( 'Duplicate the code from', 'wpcoder' ) . ' ID: ' . $item_id; | |
| 22 | -} | |
| 23 | -$license_page = add_query_arg( ['page' => WPCoder::SLUG . '-license' ], admin_url( 'admin.php' ) ); | |
| 24 | -$add_url = add_query_arg( [ | |
| 25 | - 'page' => WPCoder::SLUG . '-settings', | |
| 26 | - 'action' => 'new' | |
| 27 | -], admin_url( 'admin.php' ) ); | |
| 28 | - | |
| 29 | -$all_codes_url = add_query_arg( [ | |
| 30 | - 'page' => WPCoder::SLUG , | |
| 31 | -], admin_url( 'admin.php' ) ); | |
| 32 | - | |
| 33 | 14 | ?> |
| 34 | 15 | |
| 35 | - <div class="wowp-header-wrapper"> | |
| 36 | - <?php DashboardInitializer::header(); ?> | |
| 16 | + <form action="" id="wowp-settings" class="wowp-settings" method="post"> | |
| 37 | 17 | |
| 38 | - <div class="wowp-header-title"> | |
| 39 | - <h2><?php echo esc_html( $item_title ); ?></h2> | |
| 40 | - <a href="<?php echo esc_url( $add_url ); ?>" class="button button-primary button-large"> | |
| 41 | - + <?php esc_html_e( 'Add New', 'wpcoder' ); ?> | |
| 42 | - </a> | |
| 43 | - | |
| 44 | - <a href="<?php echo esc_url( $all_codes_url ); ?>" class="button button-secondary button-large"> | |
| 45 | - ⇐ <?php esc_html_e( 'All Codes', 'wpcoder' ); ?> | |
| 46 | - </a> | |
| 47 | - | |
| 48 | - </div> | |
| 49 | - </div> | |
| 50 | - | |
| 51 | - | |
| 52 | - <form action="" id="wowp-settings" class="wowp-settings wowp-wrap" method="post"> | |
| 53 | - | |
| 54 | 18 | <div id="poststuff"> |
| 55 | 19 | <div id="post-body" class="metabox-holder columns-2"> |
| 56 | 20 | <div id="post-body-content"> |
| 57 | 21 | |
| @@ -58,10 +22,9 @@ | ||
| 58 | 22 | <div id="titlediv"> |
| 59 | 23 | |
| 60 | 24 | <div id="titlewrap"> |
| 61 | 25 | <label class="screen-reader-text" id="title-prompt-text" |
| 62 | - for="title"><?php esc_html_e( 'Enter title here', 'wpcoder' ); ?> | |
| 63 | - </label> | |
| 26 | + for="title"><?php esc_html_e( 'Enter title here', 'wpcoder' ); ?></label> | |
| 64 | 27 | <?php Field::text( 'title' ); ?> |
| 65 | 28 | </div> |
| 66 | 29 | |
| 67 | 30 | </div> |
| @@ -68,9 +31,9 @@ | ||
| 68 | 31 | </div> |
| 69 | 32 | |
| 70 | 33 | <!-- Sidebar with the setting--> |
| 71 | 34 | <div id="postbox-container-1" class="postbox-container"> |
| 72 | - <?php require_once plugin_dir_path( __FILE__ ) . 'sidebar.php'; ?> | |
| 35 | + <?php require_once plugin_dir_path(__FILE__) . 'sidebar.php';?> | |
| 73 | 36 | </div> |
| 74 | 37 | |
| 75 | 38 | <div id="postoptions"> |
| 76 | 39 | <div id="postbox-container-2" class="postbox-container wowp-settings-wrapper"> |
| @@ -82,9 +45,9 @@ | ||
| 82 | 45 | </div> |
| 83 | 46 | |
| 84 | 47 | <input type="hidden" name="tool_id" value="<?php echo absint( $default['id'] ); ?>" id="tool_id"/> |
| 85 | 48 | <input type="hidden" name="param[time]" value="<?php echo esc_attr( time() ); ?>"/> |
| 86 | - <?php wp_nonce_field( WPCoder::PREFIX . '_nonce', WPCoder::PREFIX . '_settings' ); ?> | |
| 49 | + <?php wp_nonce_field( WOW_Plugin::PREFIX . '_nonce', WOW_Plugin::PREFIX . '_settings' ); ?> | |
| 87 | 50 | |
| 88 | 51 | </form> |
| 89 | 52 | |
| 90 | 53 | |