| @@ -2,9 +2,9 @@ | ||
| 2 | 2 | |
| 3 | 3 | use WPCoder\Dashboard\DBManager; |
| 4 | 4 | use WPCoder\Dashboard\Field; |
| 5 | 5 | use WPCoder\Dashboard\Link; |
| 6 | -use WPCoder\WOW_Plugin; | |
| 6 | +use WPCoder\WPCoder; | |
| 7 | 7 | |
| 8 | 8 | defined( 'ABSPATH' ) || exit; |
| 9 | 9 | |
| 10 | 10 | $default = Field::getDefault(); |
| @@ -12,89 +12,88 @@ | ||
| 12 | 12 | $link = ! empty( $default['param']['link'] ) ? $default['param']['link'] : ''; |
| 13 | 13 | |
| 14 | 14 | $shortcode = ''; |
| 15 | 15 | if ( ! empty( $default['id'] ) ) { |
| 16 | - $shortcode = '[' . WOW_Plugin::SHORTCODE . ' id="' . absint( $default['id'] ) . '"]'; | |
| 16 | + $shortcode = '[' . WPCoder::SHORTCODE . ' id="' . absint( $default['id'] ) . '"]'; | |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | ?> |
| 20 | 20 | |
| 21 | -<div class="postbox "> | |
| 22 | - <div class="postbox-header"> | |
| 23 | - <h2 class="hndle"> | |
| 24 | - <?php esc_html_e( 'Publish', 'wpcoder' ); ?> | |
| 25 | - </h2> | |
| 21 | +<div class="wowp-settings__header"> | |
| 22 | + | |
| 23 | + <div class="wowp-settings__title"> | |
| 24 | + <label class="screen-reader-text" id="title-prompt-text" | |
| 25 | + for="title"><?php esc_html_e( 'Enter title here', 'wp-coder' ); ?> | |
| 26 | + </label> | |
| 27 | + <?php Field::text( 'title' ); ?> | |
| 28 | + <input type="submit" name="submit_settings" id="submit_settings" class="button wowp-button button-dark" | |
| 29 | + value="<?php esc_attr_e( 'Save', 'wp-coder' ); ?>"> | |
| 26 | 30 | </div> |
| 27 | 31 | |
| 28 | - <div class="inside"> | |
| 32 | + <div class="wowp-settings__publish"> | |
| 29 | 33 | |
| 30 | - <div class="submitbox wowp-sidebar" id="submitpost"> | |
| 34 | + <div class="wowp-settings__publish-status"> | |
| 35 | + <div class="wowp-field has-checkbox"> | |
| 36 | + <span class="label"> | |
| 37 | + <?php esc_html_e( 'Deactivate', 'wp-coder' ); ?> | |
| 38 | + <sup class="wowp-tooltip" data-tooltip="Temporarily disables this code snippet without deleting it.">ℹ</sup> | |
| 39 | + </span> | |
| 40 | + <label class="switch"> | |
| 41 | + <?php Field::checkbox( 'status' ); ?> | |
| 42 | + <span class="slider"></span> | |
| 43 | + </label> | |
| 44 | + </div> | |
| 31 | 45 | |
| 32 | - <div id="minor-publishing"> | |
| 33 | - <div class="misc-pub-section wowp-sidebar-pub-section"> | |
| 46 | + <div class="wowp-field has-checkbox"> | |
| 47 | + <span class="label"> | |
| 48 | + <?php esc_html_e( 'Test mode', 'wp-coder' ); ?> | |
| 49 | + <sup class="wowp-tooltip" | |
| 50 | + data-tooltip="Code runs only for logged-in administrators. Useful for testing before publishing.">ℹ</sup> | |
| 51 | + </span> | |
| 52 | + <label class="switch"> | |
| 53 | + <?php Field::checkbox( 'mode' ); ?> | |
| 54 | + <span class="slider"></span> | |
| 55 | + </label> | |
| 56 | + </div> | |
| 34 | 57 | |
| 35 | - <div class="wowp-field has-chackbox"> | |
| 36 | - <span class="label"><?php esc_html_e( 'Status', 'wpcoder' ); ?></span> | |
| 37 | - <?php Field::checkbox( 'status' ); ?> | |
| 38 | - <label for="status"><?php esc_html_e( 'Deactivate', 'wpcoder' ); ?></label> | |
| 39 | - </div> | |
| 58 | + </div> | |
| 40 | 59 | |
| 41 | - <div class="wowp-field has-chackbox"> | |
| 42 | - <span class="label"><?php esc_html_e( 'Test mode', 'wpcoder' ); ?></span> | |
| 43 | - <?php Field::checkbox( 'mode' ); ?> | |
| 44 | - <label for="mode"><?php esc_html_e( 'Activate', 'wpcoder' ); ?></label> | |
| 45 | - </div> | |
| 60 | + <div class="wowp-settings__publish-info"> | |
| 61 | + <?php if ( ! empty( $shortcode ) ) : ?> | |
| 62 | + <div class="wowp-field has-addon"> | |
| 63 | + <label for="shortcode" class="label is-addon"> | |
| 64 | + <span class="wowp-tooltip on-right is-pointer can-copy" data-tooltip="Copy"> | |
| 65 | + <span class="dashicons dashicons-shortcode"></span> | |
| 66 | + </span> | |
| 67 | + </label> | |
| 68 | + <input type="text" id="shortcode" readonly value="<?php echo esc_attr( $shortcode ); ?>"> | |
| 69 | + </div> | |
| 70 | + <?php endif; ?> | |
| 46 | 71 | |
| 47 | - <div class="wowp-field has-addon border-default"> | |
| 48 | - <label for="tag" class="is-addon"><span class="dashicons dashicons-tag"></span></label> | |
| 49 | - <input list="wowp-tags" type="text" name="tag" id="tag" | |
| 50 | - value="<?php echo esc_attr( $default['tag'] ); ?>"> | |
| 51 | - <datalist id="wowp-tags"> | |
| 52 | - <?php DBManager::display_tags(); ?> | |
| 53 | - </datalist> | |
| 54 | - </div> | |
| 72 | + <div class="wowp-field has-addon"> | |
| 73 | + <label for="tag" class="label is-addon"><span class="dashicons dashicons-tag"></span></label> | |
| 74 | + <input list="wowp-tags" type="text" name="tag" id="tag" | |
| 75 | + value="<?php echo esc_attr( $default['tag'] ); ?>"> | |
| 76 | + <datalist id="wowp-tags"> | |
| 77 | + <?php DBManager::display_tags(); ?> | |
| 78 | + </datalist> | |
| 79 | + </div> | |
| 55 | 80 | |
| 56 | - <div class="wowp-field has-addon border-default"> | |
| 57 | - <label for="link" class="is-addon"> | |
| 58 | - <?php if ( ! empty( $link ) ): ?> | |
| 59 | - <a href="<?php echo esc_url( $link ); ?>" target="_blank"> | |
| 60 | - <span class="dashicons dashicons-admin-links"></span> | |
| 61 | - </a> | |
| 62 | - <?php else: ?> | |
| 81 | + <div class="wowp-field has-addon"> | |
| 82 | + <label for="link" class="label is-addon"> | |
| 83 | + <?php if ( ! empty( $link ) ): ?> | |
| 84 | + <a href="<?php echo esc_url( $link ); ?>" target="_blank"> | |
| 85 | + <span class="wowp-tooltip on-right is-pointer" data-tooltip="Open Link"> | |
| 63 | 86 | <span class="dashicons dashicons-admin-links"></span> |
| 64 | - <?php endif; ?> | |
| 65 | - </label> | |
| 66 | - <input type="url" name="param[link]" id="link" | |
| 67 | - value="<?php echo esc_url( $link ); ?>"> | |
| 68 | - </div> | |
| 69 | - | |
| 70 | - <?php if ( ! empty( $shortcode ) ) : ?> | |
| 71 | - <div class="wowp-field has-addon border-default"> | |
| 72 | - <label for="shortcode" class="is-addon"> | |
| 73 | - <span class="dashicons dashicons-shortcode"></span> | |
| 74 | - </label> | |
| 75 | - <input type="text" id="shortcode" readonly value="<?php echo esc_attr( $shortcode ); ?>"> | |
| 76 | - </div> | |
| 87 | + </span> | |
| 88 | + </a> | |
| 89 | + <?php else: ?> | |
| 90 | + <span class="dashicons dashicons-admin-links"></span> | |
| 77 | 91 | <?php endif; ?> |
| 78 | - | |
| 79 | - </div> | |
| 92 | + </label> | |
| 93 | + <input type="url" name="param[link]" id="link" value="<?php echo esc_url( $link ); ?>"> | |
| 80 | 94 | </div> |
| 81 | - <div class="major-publishing-actions" id="major-publishing-actions"> | |
| 82 | - <?php if ( ! empty( $default['id'] ) ): ?> | |
| 83 | - <div id="delete-action"> | |
| 84 | - <a class="submitdelete deletion" | |
| 85 | - href="<?php echo esc_url( Link::remove( $default['id'] ) ); ?>"> | |
| 86 | - <?php esc_html_e( 'Delete', 'wpcoder' ); ?> | |
| 87 | - </a> | |
| 88 | - </div> | |
| 89 | - <?php endif; ?> | |
| 95 | + </div> | |
| 90 | 96 | |
| 91 | - <div id="publishing-action"> | |
| 92 | - <?php submit_button( null, 'primary', 'submit_settings', false ); ?> | |
| 93 | - </div> | |
| 94 | - <div class="clear"></div> | |
| 97 | + </div> | |
| 95 | 98 | |
| 96 | - </div> | |
| 97 | - | |
| 98 | - </div> | |
| 99 | - </div> | |
| 100 | 99 | </div> |