You are here

function drupalforfirebug_get_sql_log in Drupal For Firebug 7

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

Output Function to Return the Results of the SQL Log

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

File

./drupalforfirebug.module, line 238

Code

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