Index: tql.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/tql/tql.module,v
retrieving revision 1.6
diff -u -p -r1.6 tql.module
--- tql.module	8 Apr 2008 14:09:18 -0000	1.6
+++ tql.module	9 Apr 2008 10:18:47 -0000
@@ -18,11 +18,41 @@ function tql_menu($may_cache) {
       'title'    => t('Autocomplete tql query'),
       'callback' => 'tql_autocomplete',
       'access'   => user_access('access content'),
-      'type'     => MENU_CALLBACK);
+      'type'     => MENU_CALLBACK
+    );
+
+    $items[] = array(
+      'path'               => 'admin/settings/tql',
+      'title'              => t('Taxonomy Query Language'),
+      'description'        => t('Modify the behavior of the TQL module.'),
+      'callback'           => 'drupal_get_form',
+      'callback arguments' => array('tql_admin_settings'),
+      'access'             => user_access('administer site configuration'),
+      'type'               => MENU_NORMAL_ITEM
+    );
   }
   return $items;
 }
 
+
+/**
+ * Menu callback for administration settings.
+ */
+function tql_admin_settings() {
+  $form = array();
+
+  $form['tql_dump_query'] = array(
+    '#type'          => 'checkbox',
+    '#title'         => t('Dump the query as a drupal message'),
+    '#description'   => t('Setting this will set a message showing the query in the "message" area of the page.'),
+    '#return_value'  => TRUE,
+    '#default_value' => variable_get('tql_dump_query', TRUE)
+  );
+
+  return system_settings_form($form);
+}
+
+
 /**
  * Implementation of hook_search().
  * This creates a tab on the search page to execute a query.
@@ -252,9 +282,11 @@ function tql_generate_sql($query, $vocab
     $sql_generator = new TqlMySqlGenerator();
     $sql = $sql_generator->generate($parser->ast, $tag_tank->terms, 'term_node');
 
-    // write the query nicely formatted
-    $dumper = new TqlAstDumper();
-    drupal_set_message($dumper->dump($parser->ast));
+    if (variable_get('tql_dump_query', TRUE)) {
+      // write the query nicely formatted
+      $dumper = new TqlAstDumper();
+      drupal_set_message($dumper->dump($parser->ast));
+    }
   }
   else {
     tql_create_tag_tank($parser->astParts, $vocabulary_list); 
