| 1 |
<?php |
| 2 |
/** |
| 3 |
* Plugin main page |
| 4 |
* |
| 5 |
* @package Wow_Plugin |
| 6 |
* @subpackage Admin/Main_page |
| 7 |
* @author Wow-Company <yoda@wow-company.com> |
| 8 |
* @copyright 2019 Wow-Company |
| 9 |
* @license GNU Public License |
| 10 |
* @version 1.0 |
| 11 |
*/ |
| 12 |
|
| 13 |
if ( ! defined( 'ABSPATH' ) ) { |
| 14 |
exit; |
| 15 |
} |
| 16 |
|
| 17 |
require_once 'tools-data-base.php'; |
| 18 |
|
| 19 |
$current_tab = ( isset( $_REQUEST["tab"] ) ) ? sanitize_text_field( $_REQUEST["tab"] ) : 'list'; |
| 20 |
|
| 21 |
$tabs = apply_filters( $this->plugin['slug'] . '_tab_menu', array( |
| 22 |
'list' => esc_attr__( 'List', $this->plugin['text'] ), |
| 23 |
'add-new' => esc_attr__( 'Add new', $this->plugin['text'] ), |
| 24 |
'extension' => esc_attr__( 'Pro Features', $this->plugin['text'] ), |
| 25 |
'support' => esc_attr__( 'Support', $this->plugin['text'] ), |
| 26 |
'items' => esc_attr__( 'Plugins', $this->plugin['text'] ), |
| 27 |
) ); |
| 28 |
|
| 29 |
$rating = $this->rating['wp_url']; |
| 30 |
|
| 31 |
?> |
| 32 |
|
| 33 |
<div class="wrap"> |
| 34 |
<h1 class="wp-heading-inline"><?php echo $this->plugin['name']; ?> v. <?php echo $this->plugin['version']; ?></h1> |
| 35 |
<a href="?page=<?php echo $this->plugin['slug']; ?>&tab=add-new" class="page-title-action"><?php esc_attr_e( 'Add New', |
| 36 |
$this->plugin['text'] ); ?></a> <a href="<?php echo $this->url['facebook']; ?>" class="page-title-action" |
| 37 |
target="_blank">Stay in touch</a> |
| 38 |
<hr class="wp-header-end"> |
| 39 |
<?php if ( get_option( 'wow_' . $this->plugin['prefix'] . '_message' ) != 'read' ) : ?> |
| 40 |
<div class="notice notice-info is-dismissible wow-plugin-message"> |
| 41 |
<p class="ideas"> |
| 42 |
<i class="fas fa-bullhorn"></i>We are constantly trying to improve the plugin and add more useful features to it. Your support and your ideas for improving the plugin are very important to us. <br/> |
| 43 |
<i class="fas fa-star"></i>If you like the plugin, please <a href="<?php echo esc_url($rating); ?>" target="_blank">leave a review</a> about it at WordPress.org.<br/> |
| 44 |
<i class="fas fa-share-alt"></i>Help other users find this plugin and take advantage of it. <b>Share:</b> <span data-share="facebook">Facebook</span>, <span data-share="twitter">Twitter</span>, <span data-share="vk">VK</span>, <span data-share="linkedin">LinkedIn</span>, <span data-share="pinterest">Pinterest</span>, <span data-share="xing">XING</span>, <span data-share="reddit">Reddit</span>, <span data-share="blogger">Blogger</span>, <span data-share="telegram">Telegram</span> |
| 45 |
</p> |
| 46 |
<input type="hidden" id="wp-title" value="<?php echo esc_attr($this->rating['wp_title']);?>"> |
| 47 |
<input type="hidden" id="wp-url" value="<?php echo esc_url($this->rating['wp_home']);?>"> |
| 48 |
</div> |
| 49 |
<?php endif;?> |
| 50 |
|
| 51 |
<div id="wow-message"></div> |
| 52 |
|
| 53 |
<?php |
| 54 |
echo '<h2 class="nav-tab-wrapper">'; |
| 55 |
foreach ( $tabs as $tab => $name ) { |
| 56 |
$class = ( $tab === $current_tab ) ? ' nav-tab-active' : ''; |
| 57 |
if ( $tab == 'add_new' ) { |
| 58 |
$action = ( isset( $_REQUEST["act"] ) ) ? sanitize_text_field( $_REQUEST["act"] ) : ''; |
| 59 |
if ( ! empty( $action ) && $action == 'update' ) { |
| 60 |
echo '<a class="nav-tab' . esc_attr( $class ) . '" href="?page=' . $this->plugin['slug'] . '&tab=' . |
| 61 |
esc_attr( $tab ) . '">' . esc_attr__( 'Update', $this->plugin['prefix'] ) . ' #' . |
| 62 |
absint( $_REQUEST["id"] ) . '</a>'; |
| 63 |
} else { |
| 64 |
echo '<a class="nav-tab' . esc_attr( $class ) . '" href="?page=' . $this->plugin['slug'] . '&tab=' . |
| 65 |
esc_attr( $tab ) . '">' . esc_attr( $name ) . '</a>'; |
| 66 |
} |
| 67 |
} else { |
| 68 |
echo '<a class="nav-tab' . esc_attr( $class ) . '" href="?page=' . $this->plugin['slug'] . '&tab=' . |
| 69 |
esc_attr( $tab ) . '">' . esc_attr( $name ) . '</a>'; |
| 70 |
} |
| 71 |
|
| 72 |
} |
| 73 |
echo '</h2>'; |
| 74 |
$current_tab = array_key_exists( $current_tab, $tabs ) ? $current_tab : 'list'; |
| 75 |
$file = apply_filters( $this->plugin['slug'] . '_menu_file', $current_tab ); |
| 76 |
include_once( $file . '.php' ); |
| 77 |
?> |
| 78 |
</div> |
| 79 |
<?php |
| 80 |
|