Exemple #1
0
 /**
  * Creates option page's entry in Settings section of menu.
  */
 static function adminMenu()
 {
     self::$settings = add_options_page(__('Mandrill Settings', 'wpmandrill'), __('Mandrill', 'wpmandrill'), 'manage_options', 'wpmandrill', array(__CLASS__, 'showOptionsPage'));
     if (self::isConfigured()) {
         if (current_user_can('manage_options')) {
             self::$report = add_dashboard_page(__('Mandrill Reports', 'wpmandrill'), __('Mandrill Reports', 'wpmandrill'), 'manage_options', 'wpmandrill' . '-reports', array(__CLASS__, 'showReportPage'));
         }
         if (self::isPluginPage('-reports')) {
             wp_register_script('flot', plugins_url('/js/flot/jquery.flot.js', __FILE__), array('jquery'), null, true);
             wp_register_script('flotstack', plugins_url('/js/flot/jquery.flot.stack.js', __FILE__), array('flot'), null, true);
             wp_register_script('flotresize', plugins_url('/js/flot/jquery.flot.resize.js', __FILE__), array('flot'), null, true);
             wp_enqueue_script('flot');
             wp_enqueue_script('flotstack');
             wp_enqueue_script('flotresize');
             wp_enqueue_script('mandrill-report-export');
         }
     }
     wp_register_style('mandrill_stylesheet', plugins_url('/css/mandrill.css', __FILE__));
     wp_enqueue_style('mandrill_stylesheet');
     wp_register_script('mandrill', plugins_url('/js/mandrill.js', __FILE__), array(), null, true);
     wp_enqueue_script('mandrill');
 }