' . esc_attr__( 'Settings', 'adminlabs' ) . ''; } return $links; } /** * Add our page to admin menu * * @since 0.0.1-alpha */ public function add_menu_page() { add_options_page( esc_attr__( 'AdminLabs', 'adminlabs' ), esc_attr__( 'AdminLabs', 'adminlabs' ), 'manage_options', 'adminlabs', array( $this, 'page_output' ) ); } // end add_menu_page /** * Output the settings page * * @since 1.0.0 */ public function page_output() { $active_tab = isset( $_GET['tab'] ) ? $_GET['tab'] : 'settings'; // @codingStandardsIgnoreLine ?>
'; echo wp_kses( 'AdminLabs WordPress plugin uses the official AdminLabs REST API. Generate and copy your API credentials on AdminLabs dashboard.', 'adminlabs' ); echo '
'; } public function field_callback_api_account_id() { $value = get_option( 'adminlabs_api_account_id' ); $value = ( ! empty( $value ) ) ? $value : ''; $readonly = ( ! empty( $value ) ) ? ' readonly' : ''; echo ''; } public function field_callback_api_key() { $value = get_option( 'adminlabs_api_key' ); $value = ( ! empty( $value ) ) ? $value : ''; $readonly = ( ! empty( $value ) ) ? ' readonly' : ''; echo ''; } public function field_callback_user() { $value = get_option( 'adminlabs_user' ); $all_users = self::$api_instance->call_api( 'users', null, true, 60 ); if ( is_array( $all_users ) ) { echo ''; echo '' . esc_attr__( 'Comments to outages and maintenances are sent in name of this user.', 'adminlabs' ) . '
'; } } // end function field_callback_monitors public function section_callback_monitors() { echo ''; esc_html_e( 'Select the monitor to show in dashboard.', 'adminlabs' ); echo '
'; } public function field_callback_monitors() { $value = get_option( 'adminlabs_monitors' ); $all_monitors = self::$api_instance->call_api( 'monitors', null, true, 60 ); if ( ! $all_monitors || ! is_array( $all_monitors ) ) { echo '';
esc_attr_e( "You don't have any monitors yet.", 'adminlabs' );
echo '
';
esc_attr_e( 'Add your first one!', 'adminlabs' );
echo '