Index: robotstxt.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/robotstxt/robotstxt.module,v
retrieving revision 1.4.4.8
diff -u -r1.4.4.8 robotstxt.module
--- robotstxt.module	2 May 2008 11:15:30 -0000	1.4.4.8
+++ robotstxt.module	21 May 2008 17:22:20 -0000
@@ -7,53 +7,58 @@
 function robotstxt_help($path, $arg) {
   switch ($path) {
     case 'admin/help#robotstxt':
-      return '<p>'. t('In a multisite environment, there is no mechanism for having a separate robots.txt file for each site. This module addresses that need by letting you administer the robots.txt file from the settings interface.') .'</p>';
-      break;
+      return '<p>'. t('In a multisite environment, there is no mechanism for having a separate /robots.txt file for each site. This module addresses that need by letting you administer the /robots.txt file from the settings interface.') .'</p>';
     case 'admin/settings/robotstxt':
-      return t('See http://www.robotstxt.org/ for more information concerning how to write your robots.txt file.');
-      break;
+      return '<p>'. t('See http://www.robotstxt.org/ for more information concerning how to write your /robots.txt file.') .'</p>';
   }
 }
+ 
+/**
+ * Implementation of hook_theme().
+ */
+function robotstxt_theme() {
+  return array(
+    'robotstxt' => array(
+      'arguments' => array('robotstxt' => NULL),
+    ),
+  );
+}
 
 /**
- * Defines the robots.txt path as a callback.
+ * Defines the /robots.txt path as a callback.
  */
 function robotstxt_menu() {
-  $access_config = array('administer site configuration');
-  $access_content = array('access content');
-
   $items['robots.txt'] = array(
-    'page callback' => 'robotstxt_robots',
+    'page callback' => 'robotstxt',
     'access callback' => TRUE,
     'type' => MENU_CALLBACK,
   );
   $items['admin/settings/robotstxt'] = array(
     'title' => 'RobotsTxt',
-    'description' => 'Manage your robots.txt file.',
+    'description' => 'Manage your /robots.txt file.',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('robotstxt_admin_settings'),
-    'access arguments' => $access_config,
+    'access arguments' => array('administer site configuration'),
   );
 
   return $items;
 }
 
 /**
- * You can edit the robots.txt for your site under admin/settings/robotstxt
+ * You can edit the /robots.txt for your site under admin/settings/robotstxt.
  */
 function robotstxt_admin_settings() {
-  $base = variable_get('robotstxt', FALSE);
+  $robotstxt = variable_get('robotstxt', FALSE);
 
-  if ($base === FALSE) {
-    $base = _robotstxt_get_file_contents();
+  if ($robotstxt === FALSE) {
+    $robotstxt = _robotstxt_get_file_contents();
   }
 
   $form['robotstxt'] = array(
     '#type' => 'textarea',
-    '#title' => t('Contents of robots.txt'),
-    '#default_value' => $base,
-    '#cols' => 60,
-    '#rows' => 20,
+    '#title' => t('Contents of /robots.txt'),
+    '#default_value' => $robotstxt,
+    '#rows' => 16,
     '#required' => FALSE,
   );
 
@@ -61,32 +66,43 @@
 }
 
 /**
- * Serve up the robots.txt file stored in the db.
+ * Serve up the /robots.txt file stored in the db.
  */
-function robotstxt_robots() {
-  $base = variable_get('robotstxt', FALSE);
+function robotstxt() {
+  $robotstxt = variable_get('robotstxt', FALSE);
 
-  if ($base === FALSE) {
-    $base = _robotstxt_get_file_contents();
+  if ($robotstxt === FALSE) {
+    $robotstxt = _robotstxt_get_file_contents();
   }
 
-  drupal_set_header("Content-type: text/plain");
-  echo trim(check_plain($base));
+  $robotstxt = trim(check_plain($robotstxt));
 
-  // Hook other modules for adding additional lines to robots.txt
+  // Hook other modules for adding additional lines to /robots.txt.
   $lines = module_invoke_all('robotstxt');
   foreach ($lines as $line) {
     $line = check_plain($line);
     if ($line != '') {
-      echo "\n" . trim($line);
+      $robotstxt .= "\n". trim($line);
     }
   }
 
-  exit;
+  return theme('robotstxt', $robotstxt);
+}
+
+/**
+ * Theme the /robots.txt output.
+ *
+ * @param $robotstxt
+ *   Contents of /robots.txt.
+ * @ingroup themeable
+ */
+function theme_robotstxt($robotstxt) {
+  drupal_set_header("Content-type: text/plain");
+  print $robotstxt;
 }
 
 /**
- * Implementation of hook_requirements()
+ * Implementation of hook_requirements().
  */
 function robotstxt_requirements($phase) {
   $requirements = array();
@@ -102,12 +118,12 @@
         );
       }
 
-      // Webservers prefer the robots.txt file on disk and does not allow menu path overwrite. 
+      // Webservers prefer the /robots.txt file on disk and does not allow menu path overwrite. 
       if (file_exists('./robots.txt')) {
         $requirements['robotstxt_file'] = array(
           'title' => t('RobotsTxt'),
           'severity' => REQUIREMENT_WARNING,
-          'value' => t('RobotsTxt module works only if you remove the existing robots.txt file in your website root.'),
+          'value' => t('RobotsTxt module works only if you remove the existing /robots.txt file in your website root.'),
         );
       }
   }
@@ -115,7 +131,7 @@
 }
 
 /**
- * Retrieve contents of robots.txt from site root or module directory
+ * Retrieve contents of /robots.txt from site root or module directory.
  */
 function _robotstxt_get_file_contents() {
   $file_contents = '';
Index: robotstxt.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/robotstxt/robotstxt.info,v
retrieving revision 1.3.4.3
diff -u -r1.3.4.3 robotstxt.info
--- robotstxt.info	30 Apr 2008 20:16:42 -0000	1.3.4.3
+++ robotstxt.info	21 May 2008 17:22:17 -0000
@@ -1,4 +1,4 @@
 ; $Id: robotstxt.info,v 1.3.4.3 2008/04/30 20:16:42 toddnienkerk Exp $
-name = robots.txt
-description = "Generates the robots.txt file dynamically and gives you the chance to edit it, on a per-site basis, from the web UI."
+name = RobotsTxt
+description = "Generates the /robots.txt file dynamically and gives you the chance to edit it, on a per-site basis, from the web UI."
 core = 6.x
