css
2 months ago
img
2 months ago
js
2 months ago
partials
2 months ago
class-analytics.php
2 months ago
class-eqw-advance.php
2 months ago
class-eqw-cart.php
2 months ago
class-eqw-email.php
2 months ago
class-eqw-enquiry.php
2 months ago
class-eqw-form-control.php
2 months ago
class-eqw-menu.php
2 months ago
class-eqw-option.php
2 months ago
class-eqw-product-options.php
2 months ago
class-pisol-enquiry-quotation-woocommerce-admin.php
2 months ago
class-telegram-options.php
2 months ago
index.php
2 months ago
plugins.php
2 months ago
plugins.php
95 lines
| 1 | <?php |
| 2 | if ( ! defined( 'ABSPATH' ) ) exit; |
| 3 | |
| 4 | class pisol_enq_other_plugins{ |
| 5 | |
| 6 | public $plugin_name; |
| 7 | |
| 8 | private $settings = array(); |
| 9 | |
| 10 | private $active_tab; |
| 11 | |
| 12 | private $this_tab = 'pisol_enq_other_plugins'; |
| 13 | |
| 14 | private $tab_name = "Plugins"; |
| 15 | |
| 16 | private $setting_key = 'pisol_corw_other_plugins'; |
| 17 | |
| 18 | public $tab; |
| 19 | |
| 20 | function __construct($plugin_name){ |
| 21 | $this->plugin_name = $plugin_name; |
| 22 | |
| 23 | |
| 24 | $this->tab = sanitize_text_field(filter_input( INPUT_GET, 'tab')); |
| 25 | $this->active_tab = $this->tab != "" ? $this->tab : 'default'; |
| 26 | |
| 27 | $this->settings = array( |
| 28 | |
| 29 | |
| 30 | ); |
| 31 | |
| 32 | if($this->this_tab == $this->active_tab){ |
| 33 | add_action($this->plugin_name.'_tab_content', array($this,'tab_content')); |
| 34 | } |
| 35 | |
| 36 | add_action($this->plugin_name.'_tab', array($this,'tab'),20); |
| 37 | |
| 38 | add_filter('install_plugins_nonmenu_tabs', array($this,'adding_tab_to_list')); |
| 39 | |
| 40 | add_filter('install_plugins_table_api_args_'.$this->this_tab, [$this, 'modify_tab_args']); |
| 41 | |
| 42 | add_action('install_plugins_'.$this->this_tab, [$this, 'plugin_list']); |
| 43 | |
| 44 | } |
| 45 | |
| 46 | function tab(){ |
| 47 | $page = isset($_GET['page']) ? sanitize_text_field( wp_unslash($_GET['page']) ) : ''; |
| 48 | ?> |
| 49 | <a class=" px-3 text-light d-flex align-items-center border-left border-right <?php echo ($this->active_tab == $this->this_tab ? 'bg-primary' : 'bg-secondary'); ?>" href="<?php echo esc_url( admin_url( 'admin.php?page='.$page.'&tab='.$this->this_tab ) ); ?>"> |
| 50 | <span class="dashicons dashicons-networking"></span> <?php echo esc_html( $this->tab_name ); ?> |
| 51 | </a> |
| 52 | <?php |
| 53 | } |
| 54 | |
| 55 | function tab_content(){ |
| 56 | |
| 57 | do_action('install_plugins_'.$this->this_tab); |
| 58 | |
| 59 | } |
| 60 | |
| 61 | function adding_tab_to_list($tabs){ |
| 62 | $tabs[] = $this->this_tab; |
| 63 | return $tabs; |
| 64 | } |
| 65 | |
| 66 | function modify_tab_args($args){ |
| 67 | global $paged; |
| 68 | return [ |
| 69 | 'page' => $paged, |
| 70 | 'per_page' => 25, |
| 71 | 'locale' => get_user_locale(), |
| 72 | 'author' => 'rajeshsingh520', |
| 73 | ]; |
| 74 | } |
| 75 | |
| 76 | function plugin_list(){ |
| 77 | |
| 78 | require_once ABSPATH . 'wp-admin/includes/class-wp-plugin-install-list-table.php'; |
| 79 | $table = new WP_Plugin_Install_List_Table(); |
| 80 | $table->prepare_items(); |
| 81 | |
| 82 | wp_enqueue_script('plugin-install'); |
| 83 | add_thickbox(); |
| 84 | wp_enqueue_script('updates'); |
| 85 | |
| 86 | echo '<div id="plugin-filter">'; |
| 87 | $table->display(); |
| 88 | echo '</div>'; |
| 89 | } |
| 90 | |
| 91 | |
| 92 | } |
| 93 | |
| 94 | new pisol_enq_other_plugins($this->plugin_name); |
| 95 |