8889841cwp-content/plugins/yith-woocommerce-compare/plugin-fw/includes/class-yit-plugin-subpanel.php000064400000013077150513555260034350 0ustar00home/clixcotz/lions.clix.co.tz */ class YIT_Plugin_SubPanel extends YIT_Plugin_Panel { /** * Version of the class. * * @var string */ public $version = '1.0.0'; /** * List of settings parameters. * * @var array */ public $settings = array(); /** * YIT_Plugin_SubPanel constructor. * * @param array $args The panel arguments. */ public function __construct( $args = array() ) { if ( ! empty( $args ) ) { $this->settings = $args; $this->settings['parent'] = $this->settings['page']; $this->tabs_path_files = $this->get_tabs_path_files(); add_action( 'admin_init', array( $this, 'register_settings' ) ); add_action( 'admin_menu', array( &$this, 'add_setting_page' ) ); add_action( 'admin_bar_menu', array( &$this, 'add_admin_bar_menu' ), 100 ); add_action( 'admin_init', array( &$this, 'add_fields' ) ); add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) ); } } /** * Register Settings * Generate wp-admin settings pages by registering your settings and using a few callbacks to control the output */ public function register_settings() { register_setting( 'yit_' . $this->settings['page'] . '_options', 'yit_' . $this->settings['page'] . '_options', array( &$this, 'options_validate' ) ); } /** * Add Setting SubPage * add Setting SubPage to WordPress administrator */ public function add_setting_page() { global $admin_page_hooks; $logo = yith_plugin_fw_get_default_logo(); $admin_logo = function_exists( 'yit_get_option' ) ? yit_get_option( 'admin-logo-menu' ) : ''; if ( ! empty( $admin_logo ) ) { $logo = $admin_logo; } if ( ! isset( $admin_page_hooks['yith_plugin_panel'] ) ) { $position = apply_filters( 'yit_plugins_menu_item_position', '62.32' ); add_menu_page( 'yith_plugin_panel', 'YITH', 'nosuchcapability', 'yith_plugin_panel', null, $logo, $position ); // Prevent issues for backward compatibility. $admin_page_hooks['yith_plugin_panel'] = 'yith-plugins'; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited } add_submenu_page( 'yith_plugin_panel', $this->settings['label'], $this->settings['label'], 'manage_options', $this->settings['page'], array( $this, 'yit_panel' ) ); remove_submenu_page( 'yith_plugin_panel', 'yith_plugin_panel' ); } /** * Show a tabbed panel to setting page * a callback function called by add_setting_page => add_submenu_page */ public function yit_panel() { $tabs = ''; $current_tab = $this->get_current_tab(); $yit_options = $this->get_main_array_options(); foreach ( $this->settings['admin-tabs'] as $tab => $tab_value ) { $active_class = $current_tab === $tab ? ' nav-tab-active' : ''; $url = '?page=' . $this->settings['page'] . '&tab=' . $tab; $tabs .= '' . wp_kses_post( $tab_value ) . ''; } ?>

get_custom_tab_options( $yit_options, $current_tab ); if ( $custom_tab_options ) { $this->print_custom_tab( $custom_tab_options ); return; } $form_method = apply_filters( 'yit_admin_panel_form_method', 'POST', $current_tab ); $panel_content_class = apply_filters( 'yit_admin_panel_content_class', 'yit-admin-panel-content-wrap', $current_tab ); ?>
message(); ?>

get_tab_title() ); ?>

is_show_form() ) : ?>

 

settings['parent'] . '_options' ); ?>