You are here

function views_plugin_query_default::get_preview_info in Views (for Drupal 7) 6.3

Return preview info.

Return value

$rows An array of strings with info to be shown in the preview.

Overrides views_plugin_query::get_preview_info

File

plugins/views_plugin_query_default.inc, line 1370
views_plugin_query_default.inc Defines the default query object which builds SQL to execute using the Drupal database API.

Class

views_plugin_query_default
Object used to create a SELECT query.

Code

function get_preview_info() {
  $rows = array();
  $query = db_prefix_tables($this->query);
  if ($this->query_args) {
    _db_query_callback($this->query_args, TRUE);
    $query = preg_replace_callback(DB_QUERY_REGEXP, '_db_query_callback', $query);
  }
  $rows[] = array(
    '<strong>' . t('Query') . '</strong>',
    '<pre>' . check_plain($query) . '</pre>',
  );
  return $rows;
}