You are here

function drupalforfirebug_get_sql_log in Drupal For Firebug 5

Same name and namespace in other branches
  1. 6 drupalforfirebug.module \drupalforfirebug_get_sql_log()
  2. 7.2 drupalforfirebug.module \drupalforfirebug_get_sql_log()
  3. 7 drupalforfirebug.module \drupalforfirebug_get_sql_log()

Output Function to Return the Results of the SQL Log

1 call to drupalforfirebug_get_sql_log()
drupalforfirebug_footer in ./drupalforfirebug.module
Output Function to Return Hidden Div Containers in Footer

File

./drupalforfirebug.module, line 109

Code

function drupalforfirebug_get_sql_log() {
  $output = '<fieldset>';
  if (!module_exists('devel')) {
    $output .= '<legend>Devel Module is Not Installed</legend>';
    $output .= 'Please install and enable the Devel Module to display the SQL queries.';
    return $output;
  }
  elseif (!variable_get('dev_query', 0)) {
    $output .= '<legend>Query Logging is Not Enabled</legend>';
    $output .= 'Please enable "Collect query info" in the Devel Module Settings (admin/settings/devel) to use this feature.';
    return $output;
  }
  else {
    global $queries;
    list($counts, $query_summary) = devel_query_summary();
    $output .= '<legend>SQL Query Log</legend>';
    $output .= devel_query_table($queries, $counts);
  }
  $output .= '</fieldset>';
  return $output;
}