| @@ -17,13 +17,8 @@ | ||
| 17 | 17 | * @return void |
| 18 | 18 | */ |
| 19 | 19 | public function __construct( $core ) { |
| 20 | 20 | parent::__construct( $core ); |
| 21 | - | |
| 22 | - if ( defined( 'PS_DISABLE_MENU' ) && PS_DISABLE_MENU ) { | |
| 23 | - return; | |
| 24 | - } | |
| 25 | - | |
| 26 | 21 | add_action( 'admin_head', [ $this, 'add_meta_nonce' ] ); |
| 27 | 22 | add_action( 'admin_menu', [ $this, 'add_menu_pages' ] ); |
| 28 | 23 | add_action( 'network_admin_menu', [ $this, 'network_menu' ] ); |
| 29 | 24 | add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_styles' ] ); |
| @@ -59,9 +54,11 @@ | ||
| 59 | 54 | * @return void |
| 60 | 55 | */ |
| 61 | 56 | public function network_menu() { |
| 62 | 57 | add_menu_page( 'Patchstack', 'Patchstack', 'manage_options', 'patchstack-multisite', [ $this->plugin->multisite, 'sites_section_callback' ] ); |
| 63 | - add_submenu_page( 'patchstack-multisite', 'Activate', 'Activate', 'manage_options', 'patchstack-multisite-settings', [ $this, 'render_settings_page' ] ); | |
| 58 | + add_submenu_page( 'patchstack-multisite', 'Activate', 'Activate', 'manage_options', 'patchstack-multisite-settings&tab=multisite', [ $this->plugin->multisite, 'settings' ] ); | |
| 59 | + add_submenu_page( 'patchstack-multisite', 'Sites', 'Sites', 'manage_options', 'patchstack-multisite', [ $this->plugin->multisite, 'sites_section_callback' ] ); | |
| 60 | + add_submenu_page( 'patchstack-multisite', 'Settings', 'Settings', 'manage_options', 'patchstack-multisite-settings', [ $this, 'render_settings_page' ] ); | |
| 64 | 61 | } |
| 65 | 62 | |
| 66 | 63 | /** |
| 67 | 64 | * Render the settings page. |
| @@ -82,10 +79,14 @@ | ||
| 82 | 79 | |
| 83 | 80 | // Load the Patchstack style on all Patchstack pages except site overview. |
| 84 | 81 | if ( isset( $screen->base, $_GET['page'] ) && stripos( $screen->base, 'patchstack' ) !== false && $_GET['page'] != 'patchstack-multisite' ) { |
| 85 | 82 | wp_enqueue_style( 'patchstack', $this->plugin->url . 'assets/css/patchstack.min.css', [], $this->plugin->version ); |
| 86 | - wp_enqueue_style( 'patchstack-hint', 'https://cdnjs.cloudflare.com/ajax/libs/hint.css/3.0.0/hint.min.css', [], $this->plugin->version ); | |
| 87 | 83 | } |
| 84 | + | |
| 85 | + // Only load the selectize CSS file on the firewall settings page. | |
| 86 | + if ( isset( $screen->base ) && stripos( $screen->base, 'patchstack' ) !== false ) { | |
| 87 | + wp_enqueue_style( 'patchstack-selectize', $this->plugin->url . 'assets/css/selectize.min.css', [ ], $this->plugin->version ); | |
| 88 | + } | |
| 88 | 89 | } |
| 89 | 90 | |
| 90 | 91 | /** |
| 91 | 92 | * Register the JavaScript for the admin area. |
| @@ -105,8 +106,13 @@ | ||
| 105 | 106 | 'nonce' => wp_create_nonce( 'patchstack-nonce' ), |
| 106 | 107 | 'error_message' => esc_attr__( 'Sorry, there was a problem processing your request.', 'patchstack' ), |
| 107 | 108 | ] |
| 108 | 109 | ); |
| 110 | + } | |
| 111 | + | |
| 112 | + // Only load the selectize library on the firewall settings page. | |
| 113 | + if ( isset( $screen->base ) && stripos( $screen->base, 'patchstack' ) !== false ) { | |
| 114 | + wp_enqueue_script( 'patchstack-selectize', $this->plugin->url . 'assets/js/selectize.min.js', [ ], $this->plugin->version ); | |
| 109 | 115 | } |
| 110 | 116 | } |
| 111 | 117 | |
| 112 | 118 | /** |