| 1 |
<?php |
| 2 |
/** |
| 3 |
* Plugin main page |
| 4 |
* |
| 5 |
* @package Wow Plugin |
| 6 |
* @copyright Copyright (c) 2018, Dmytro Lobov |
| 7 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
| 8 |
* @since 1.0 |
| 9 |
*/ |
| 10 |
|
| 11 |
if ( ! defined( 'ABSPATH' ) ) { |
| 12 |
exit; |
| 13 |
} |
| 14 |
|
| 15 |
require_once plugin_dir_path( __FILE__ ) . 'tools-data-base.php'; |
| 16 |
|
| 17 |
$current_tab = ( isset( $_REQUEST["tab"] ) ) ? sanitize_text_field( $_REQUEST["tab"] ) : 'list'; |
| 18 |
|
| 19 |
$tabs = apply_filters( 'wp_coder_menu', array( |
| 20 |
'list' => __( 'List', 'wpcoder' ), |
| 21 |
'add_new' => __( 'Add new', 'wpcoder' ), |
| 22 |
'items' => __( 'CSS & JS Items', 'wpcoder' ), |
| 23 |
'extension' => __( 'Extension', 'wpcoder' ), |
| 24 |
'support' => __( 'Support', 'wpcoder' ), |
| 25 |
) ); |
| 26 |
|
| 27 |
$rating = 'https://wordpress.org/support/plugin/wp-coder/reviews/?filter=5#new-post'; |
| 28 |
?> |
| 29 |
|
| 30 |
<div class="wrap"> |
| 31 |
<h1 class="wp-heading-inline"><?php echo esc_attr($this->plugin_name); ?> v. <?php echo esc_attr($this->plugin_version); ?></h1> |
| 32 |
<a href="?page=<?php echo esc_attr($this->plugin_slug); ?>&tab=add_new" |
| 33 |
class="page-title-action"><?php esc_html_e( 'Add New', 'wpcoder' ); ?></a> <a href="https://www.facebook.com/wowaffect/" |
| 34 |
class="page-title-action wow-facebook" |
| 35 |
target="_blank">Stay in touch</a> |
| 36 |
<hr class="wp-header-end"> |
| 37 |
<?php if ( get_option( 'wp_coder_message' ) != 'read' ) : ?> |
| 38 |
<div class="notice notice-info is-dismissible wow-plugin-message"> |
| 39 |
<p class="ideas"> |
| 40 |
<i class="dashicons dashicons-megaphone"></i>We are constantly trying to improve the plugin and add more |
| 41 |
useful |
| 42 |
features to it. Your support and your ideas for improving the plugin are very important to us. <br/> |
| 43 |
<i class="dashicons dashicons-star-filled"></i>If you like the plugin, please <a |
| 44 |
href="<?php echo esc_url( $rating ); ?>" target="_blank">leave a review</a> about it |
| 45 |
at WordPress.org.<br/> |
| 46 |
<i class="dashicons dashicons-share"></i>Help other users find this plugin and take advantage of it. |
| 47 |
<b>Share:</b> <span data-share="facebook">Facebook</span>, <span data-share="twitter">Twitter</span>, |
| 48 |
<span data-share="vk">VK</span>, <span data-share="linkedin">LinkedIn</span>, <span |
| 49 |
data-share="pinterest">Pinterest</span>, <span data-share="xing">XING</span>, <span |
| 50 |
data-share="reddit">Reddit</span>, <span data-share="blogger">Blogger</span>, <span |
| 51 |
data-share="telegram">Telegram</span> |
| 52 |
</p> |
| 53 |
<input type="hidden" id="wp-title" value="WP Coder – add custom html, css and js code"> |
| 54 |
<input type="hidden" id="wp-url" value="https://wordpress.org/plugins/wp-coder/"> |
| 55 |
</div> |
| 56 |
<?php endif; ?> |
| 57 |
|
| 58 |
<?php |
| 59 |
echo '<h2 class="nav-tab-wrapper">'; |
| 60 |
foreach ( $tabs as $tab => $name ) { |
| 61 |
$class = ( $tab === $current_tab ) ? ' nav-tab-active' : ''; |
| 62 |
if ( $tab === 'add_new' ) { |
| 63 |
$action = ( isset( $_REQUEST["act"] ) ) ? sanitize_text_field( $_REQUEST["act"] ) : ''; |
| 64 |
if ( ! empty( $action ) && $action === 'update' ) { |
| 65 |
echo '<a class="nav-tab' . esc_attr( $class ) . '" href="?page=' . esc_attr($this->plugin_slug) . '&tab=' . esc_attr( $tab ) . '">' . esc_html__( 'Update', 'leadgeneration' ) . ' #' . absint( $_REQUEST["id"] ) . '</a>'; |
| 66 |
} else { |
| 67 |
echo '<a class="nav-tab' . esc_attr( $class ) . '" href="?page=' . esc_attr($this->plugin_slug) . '&tab=' . esc_attr( $tab ) . '">' . esc_attr( $name ) . '</a>'; |
| 68 |
} |
| 69 |
} else { |
| 70 |
echo '<a class="nav-tab' . esc_attr( $class ) . '" href="?page=' . esc_attr($this->plugin_slug) . '&tab=' . esc_attr( $tab ) . '">' . esc_attr( $name ) . '</a>'; |
| 71 |
} |
| 72 |
|
| 73 |
} |
| 74 |
echo '</h2>'; |
| 75 |
$current_tab = array_key_exists( $current_tab, $tabs ) ? $current_tab : 'list'; |
| 76 |
$file = apply_filters( 'wp_coder_file', $current_tab ); |
| 77 |
include_once( $file . '.php' ); |
| 78 |
|
| 79 |
?> |
| 80 |
</div> |
| 81 |
|
| 82 |
|
| 83 |
|