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