'appinsights'))); exit; } } } function appinsights_setup() { global $AppInsights_Config; include_once ($AppInsights_Config->plugin_path . '/appinsights-tools.php'); $tools = new AppInsights_Tools(); if ($tools->check_roles($AppInsights_Config->options['appinsights_access_back'])) { include_once (dirname ( __FILE__ ) . '/admin/appinsights-dashboard-widgets.php'); wp_add_dashboard_widget( 'appinsights-widget', __ ( "Microsoft Azure Application Insights Dashboard", 'appinsights' ), array ( 'AppInsights_Widgets', 'appinsights_dashboard_widgets' ), $control_callback = null ); } } function appinsights_admin_enqueue_styles($hook) { if ('settings_page_appinsights' != $hook && 'index.php' != $hook) { return; } wp_register_style('appinsights', plugin_dir_url( __FILE__ ) . 'admin/css/appinsights.css'); wp_register_style('nvd3', plugin_dir_url( __FILE__ ) . 'admin/css/nv.d3.css'); wp_enqueue_style('appinsights'); wp_enqueue_style('nvd3'); wp_enqueue_script( 'd3', plugin_dir_url( __FILE__ ) . 'admin/js/d3.v3.js', array() ); wp_enqueue_script( 'nvd3', plugin_dir_url( __FILE__ ) . 'admin/js/nv.d3.js', array() ); wp_enqueue_script( 'appinsights-tooltip', plugin_dir_url( __FILE__ ) . 'admin/js/tooltip.js', array() ); wp_enqueue_script( 'appinsights-utils', plugin_dir_url( __FILE__ ) . 'admin/js/utils.js', array() ); wp_enqueue_script( 'appinsights-legend', plugin_dir_url( __FILE__ ) . 'admin/js/legend.js', array() ); wp_enqueue_script( 'appinsights-axis', plugin_dir_url( __FILE__ ) . 'admin/js/axis.js', array() ); wp_enqueue_script( 'appinsights-scatter', plugin_dir_url( __FILE__ ) . 'admin/js/scatter.js', array() ); wp_enqueue_script( 'appinsights-line', plugin_dir_url( __FILE__ ) . 'admin/js/line.js', array() ); wp_enqueue_script( 'appinsights-linechart', plugin_dir_url( __FILE__ ) . 'admin/js/lineChart.js', array() ); wp_enqueue_script( 'appinsights-ajax-script', plugin_dir_url( __FILE__ ) . 'admin/js/appinsights.js', array('jquery') ); wp_localize_script( 'appinsights-ajax-script', 'AppInsights_Ajax', array( 'ajax_url' => admin_url( 'admin-ajax.php' ), 'next_nonce' => wp_create_nonce( 'appinsights-next-nonce' ) ) ); } function appinsights_plugin_menu() { add_options_page( 'Microsoft Azure Application Insights Settings', 'Application Insights', 'manage_options', 'appinsights', array('AppInsights_Settings', 'appinsights_plugin_options_page') ); } ?>