PluginProbe
Float menu – awesome floating side menu / 4.1
Float menu – awesome floating side menu v4.1
7.2.5 trunk 2.1 2.2 3.0.1 3.1 3.2.2 3.3.1 3.5 3.5.1 3.5.2 3.5.3. 3.5.4 4.0 4.1 4.1.1 4.2 4.3 4.3.1 4.3.2 5.0 5.0.1 5.0.2 5.0.3 5.1 All 57 releases
float-menu / admin / page-main.php

page-main.php in Float menu – awesome floating side menu 4.1, at admin/page-main.php

102 lines 4.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Plugin main page
4 *
5 * @package Wow_Plugin
6 * @subpackage Admin/Main_page
7 * @author Wow-Company <helper@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 global $wpdb;
18 $data = $wpdb->prefix . 'wow_' . $this->plugin['prefix'];
19 $info = ( isset( $_REQUEST['info'] ) ) ? sanitize_text_field( $_REQUEST['info'] ) : '';
20 if ( $info == 'saved' ) {
21 echo '<div class="updated" id="message"><p><strong>' . esc_attr__( 'Item Added', $this->plugin['text'] ) . '</strong>.</p></div>';
22 } elseif ( $info == 'update' ) {
23 echo '<div class="updated" id="message"><p><strong>' . esc_attr__( 'Item Updated', $this->plugin['text'] ) . '</strong>.</p></div>';
24 } elseif ( $info == 'delete' ) {
25 $delid = absint( $_GET['did'] );
26 $wpdb->delete( $data, [ 'id' => $delid ], [ '%d' ] );
27 echo '<div class="updated" id="message"><p><strong>' . esc_attr__( 'Item Deleted', $this->plugin['text'] ) . '</strong>.</p></div>';
28 }
29
30 $current_tab = ( isset( $_REQUEST["tab"] ) ) ? sanitize_text_field( $_REQUEST["tab"] ) : 'list';
31
32 $tabs = apply_filters( $this->plugin['slug'] . '_tab_menu', array(
33 'list' => esc_attr__( 'List', $this->plugin['text'] ),
34 'settings' => esc_attr__( 'Add new', $this->plugin['text'] ),
35 'extension' => esc_attr__( 'Pro Features', $this->plugin['text'] ),
36 'support' => esc_attr__( 'Support', $this->plugin['text'] ),
37 'rate' => esc_attr__( 'Rate', $this->plugin['text'] ),
38 ) );
39
40 $rate_url = 'https://wordpress.org/support/plugin/float-menu/reviews/#new-post';
41
42 $rating = $this->rating['wp_url'];
43 ?>
44
45 <div class="wrap">
46 <h1 class="wp-heading-inline"><?php echo esc_attr( $this->plugin['name'] ); ?>
47 v. <?php echo esc_attr( $this->plugin['version'] ); ?></h1>
48 <a href="?page=<?php echo esc_attr( $this->plugin['slug'] ); ?>&tab=settings" class="page-title-action">
49 <?php esc_attr_e( 'Add New', $this->plugin['text'] ); ?></a>
50 <hr class="wp-header-end">
51 <?php if ( get_option( 'wow_' . $this->plugin['prefix'] . '_message' ) != 'read' ) : ?>
52 <div class="notice notice-info is-dismissible wow-plugin-message">
53 <p class="ideas">
54 <i class="fas fa-bullhorn"></i>We are constantly trying to improve the plugin and add more useful
55 features to it. Your support and your ideas for improving the plugin are very important to us. <br/>
56 <i class="fas fa-star"></i>If you like the plugin, please <a
57 href="<?php echo esc_url( $rating ); ?>" target="_blank">leave a review</a> about it at
58 WordPress.org.
59
60 </p>
61 </div>
62 <?php endif; ?>
63
64 <div id="wow-message"></div>
65
66 <?php
67 echo '<h2 class="nav-tab-wrapper">';
68 foreach ( $tabs as $tab => $name ) {
69 $class = ( $tab === $current_tab ) ? ' nav-tab-active' : '';
70 if ( $tab === 'options' ) {
71 $action = ( isset( $_REQUEST["act"] ) ) ? sanitize_text_field( $_REQUEST["act"] ) : '';
72 if ( ! empty( $action ) && $action == 'update' ) {
73 echo '<a class="nav-tab' . esc_attr( $class ) . '" href="?page=' . esc_attr( $this->plugin['slug'] ) . '&tab=' .
74 esc_attr( $tab ) . '">' . esc_attr__( 'Update', $this->plugin['prefix'] ) . ' #' .
75 absint( $_REQUEST["id"] ) . '</a>';
76 } else {
77 echo '<a class="nav-tab' . esc_attr( $class ) . '" href="?page=' . esc_attr( $this->plugin['slug'] ) . '&tab=' .
78 esc_attr( $tab ) . '">' . esc_attr( $name ) . '</a>';
79 }
80 } elseif ( $tab === 'extension' ) {
81 echo '<a class="nav-tab' . esc_attr( $class ) . '" href="?page=' . esc_attr( $this->plugin['slug'] ) . '&tab='
82 . esc_attr( $tab ) . '"><span class="dashicons dashicons-yes" style="color:#00d1b2;"></span> ' . esc_attr( $name ) . '</a>';
83 }
84 elseif ( $tab === 'rate' ) {
85 echo '<a class="nav-tab' . esc_attr( $class ) . '" href="' . esc_url( $rate_url ) . '" target="_blank"><span class="dashicons dashicons-star-filled" style="color:#ffcc01;"></span> ' . esc_attr( $name ) . '</a>';
86
87 } elseif ( $tab === 'docs' ) {
88 echo '<a class="nav-tab' . esc_attr( $class ) . '" href="' . esc_url( $docs_url ) . '" target="_blank"><span class="dashicons dashicons-media-document" style="color:#006bb3;"></span>' . esc_attr( $name ) . '</a>';
89
90 } else {
91 echo '<a class="nav-tab' . esc_attr( $class ) . '" href="?page=' . esc_attr( $this->plugin['slug'] ) . '&tab=' .
92 esc_attr( $tab ) . '">' . esc_attr( $name ) . '</a>';
93 }
94
95 }
96 echo '</h2>';
97 $file = array_key_exists( $current_tab, $tabs ) ? 'page-' . $current_tab : 'page-list';
98 include_once( $file . '.php' );
99 ?>
100 </div>
101 <?php
102