', array( $o, 'widget_form' ), Util_Ui::admin_url( 'admin.php?page=w3tc_cdn' ), 'normal' ); } /** * Displays the widget form for BunnyCDN configuration. * * This method checks whether the user is authorized to view the BunnyCDN widget. If authorized, it includes a view that * shows the authorized settings. If the user is not authorized, a view indicating that they are unauthorized will be shown. * * @since 2.6.0 * * @return void */ public function widget_form() { $c = Dispatcher::config(); $authorized = $c->get_string( 'cdn.engine' ) === 'bunnycdn' && ( ! empty( $c->get_integer( 'cdn.bunnycdn.pull_zone_id' ) ) || ! empty( $c->get_integer( 'cdnfsd.bunnycdn.pull_zone_id' ) ) ); if ( $authorized ) { include __DIR__ . DIRECTORY_SEPARATOR . 'Cdn_BunnyCdn_Widget_View_Authorized.php'; } else { include __DIR__ . DIRECTORY_SEPARATOR . 'Cdn_BunnyCdn_Widget_View_Unauthorized.php'; } } /** * Enqueues the styles for the BunnyCDN widget in the admin area. * * This method enqueues the required CSS files for the BunnyCDN widget in the WordPress admin area. It ensures that the * widget's styles are applied correctly on the dashboard page. * * @since 2.6.0 * * @return void */ public function admin_print_styles() { wp_enqueue_style( 'w3tc-widget' ); wp_enqueue_style( 'w3tc-bunnycdn-widget', plugins_url( 'Cdn_BunnyCdn_Widget_View.css', W3TC_FILE ), array(), W3TC_VERSION ); } }