Пример #1
0
 /**
  * WordPress action to display important messages in the admin.
  * 
  * admin_notices {@link http://codex.wordpress.org/Plugin_API/Action_Reference#Advanced_Actions action}
  * called by WordPress.
  *
  * @since 1.3
  */
 public static function admin_notices()
 {
     global $geo_mashup_options;
     $message = array();
     if (!empty(self::$deactivate_geo_search_basename)) {
         deactivate_plugins(GeoMashupSearch::get_instance()->basename);
         $message_format = __('Geo Mashup now includes search, deactivating the old %s plugin. It\'s safe to delete it.', 'GeoMashup');
         $message[] = sprintf($message_format, self::$deactivate_geo_search_basename);
     }
     if (!self::is_options_page()) {
         // We're not looking at the settings, but it may be important to do so
         $google_key = $geo_mashup_options->get('overall', 'google_key');
         if (empty($google_key) and 'google' == $geo_mashup_options->get('overall', 'map_api') and current_user_can('manage_options')) {
             $message_format = __('Geo Mashup requires a Google API key in the <a href="%s">settings</a> before it will work.', 'GeoMashup');
             $message[] = sprintf($message_format, admin_url('options-general.php?page=' . GEO_MASHUP_PLUGIN_NAME));
         }
         if (GEO_MASHUP_DB_VERSION != GeoMashupDB::installed_version() and current_user_can('manage_options')) {
             $message_format = __('Geo Mashup needs to upgrade its database, visit the <a href="%s">settings</a> to do it now.', 'GeoMashup');
             $message[] = sprintf($message_format, admin_url('options-general.php?page=' . GEO_MASHUP_PLUGIN_NAME));
         }
     }
     if (!empty($message)) {
         echo '<div class="error fade"><p>' . implode('</p><p>', $message) . '</p></div>';
     }
 }