Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.520
diff -u -9 -p -r1.520 theme.inc
--- includes/theme.inc	9 Sep 2009 21:44:01 -0000	1.520
+++ includes/theme.inc	10 Sep 2009 20:10:16 -0000
@@ -263,35 +263,38 @@ function drupal_theme_rebuild() {
 
 /**
  * Process a single implementation of hook_theme().
  *
  * @param $cache
  *   The theme registry that will eventually be cached; It is an associative
  *   array keyed by theme hooks, whose values are associative arrays describing
  *   the hook:
  *   - 'type': The passed in $type.
- *   - 'theme path': The passed in $path.
+ *   - 'arguments': The arguments for this theme hook as defined in
+ *     hook_theme(). If there is more than one implementation and 'arguments' is
+ *     not specified in a later one, then the previous definition is kept.
  *   - 'function': The name of the function generating output for this theme
  *     hook. Either defined explicitly in hook_theme() or, if neither 'function'
  *     nor 'template' is defined, then the default theme function name is used.
  *     The default theme function name is the theme hook prefixed by either
  *     'theme_' for modules or '$name_' for everything else. If 'function' is
  *     defined, 'template' is not used.
- *   - 'template': The filename of the template generating output for this
- *     theme hook. The template is in the directory defined by the 'path' key of
- *     hook_theme() or defaults to $path.
- *   - 'arguments': The arguments for this theme hook as defined in
- *     hook_theme(). If there is more than one implementation and 'arguments' is
- *     not specified in a later one, then the previous definition is kept.
+ *   - 'file': The file that will be included prior to the theme being rendered.
+ *     The path is relative to the Drupal root directory.
+ *   - 'template': The path of the template file generating output for this
+ *     theme hook. The template is in the directory defined by the 'theme path'
+ *     key of hook_theme() if present, or $path. The path is relative to the
+ *     Drupal root directory.
+ *   - 'theme path': The directory containing 'template'.
  *   - 'theme paths': The paths where implementations of a theme hook can be
  *     found. Its definition is similarly inherited like 'arguments'. Each time
  *     _theme_process_registry() is called for this theme hook, either the
- *     'path' key from hook_theme() (if defined) or $path is added.
+ *     'theme path' key from hook_theme() (if defined) or $path is added.
  *   - 'preprocess functions': See theme() for detailed documentation.
  *   - 'process functions': See theme() for detailed documentation.
  * @param $name
  *   The name of the module, theme engine, base theme engine, theme or base
  *   theme implementing hook_theme().
  * @param $type
  *   One of 'module', 'theme_engine', 'base_theme_engine', 'theme', or
  *   'base_theme'. Unlike regular hooks that can only be implemented by modules,
  *   each of these can implement hook_theme(). _theme_process_registry() is
@@ -299,79 +302,84 @@ function drupal_theme_rebuild() {
  *   example, if a theme hook is both defined by a module and a theme, then the
  *   definition in the theme will be used.
  * @param $theme
  *   The loaded $theme object as returned from list_themes().
  * @param $path
  *   The directory where $name is. For example, modules/system or
  *   themes/garland.
  *
  * @see theme()
- * @see _theme_process_registry()
  * @see hook_theme()
  * @see list_themes()
  */
 function _theme_process_registry(&$cache, $name, $type, $theme, $path) {
   $result = array();
   $function = $name . '_theme';
 
   // Processor functions work in two distinct phases with the process
   // functions always being executed after the preprocess functions.
   $variable_process_phases = array(
     'preprocess functions' => 'preprocess',
     'process functions'    => 'process',
   );
 
   if (function_exists($function)) {
     $result = $function($cache, $type, $theme, $path);
     foreach ($result as $hook => $info) {
       $result[$hook]['type'] = $type;
-      $result[$hook]['theme path'] = $path;
-      // if function and file are left out, default to standard naming
+
+      // If function and file are left out, default to standard naming
       // conventions.
       if (!isset($info['template']) && !isset($info['function'])) {
         $result[$hook]['function'] = ($type == 'module' ? 'theme_' : $name . '_') . $hook;
       }
       // If a path is set in the info, use what was set. Otherwise use the
       // default path. This is mostly so system.module can declare theme
       // functions on behalf of core .include files.
       // All files are included to be safe. Conditionally included
       // files can prevent them from getting registered.
       if (isset($cache[$hook]['includes'])) {
         $result[$hook]['includes'] = $cache[$hook]['includes'];
       }
       if (isset($info['file'])) {
-        $include_file = isset($info['path']) ? $info['path'] : $path;
+        $include_file = isset($info['file path']) ? $info['file path'] : $path;
         $include_file .= '/' . $info['file'];
         include_once DRUPAL_ROOT . '/' . $include_file;
         $result[$hook]['includes'][] = $include_file;
       }
 
+      // Generate path relative to the Drupal root directory. The default path
+      // may be overridden using $info['theme path'].
+      if (isset($info['theme path'])) {
+        $result[$hook]['theme path'] = $info['theme path'];
+      }
+      else {
+        $result[$hook]['theme path'] = $path;
+      }
+
       // If 'arguments' have been defined previously, carry them forward.
       // This should happen if a theme overrides a Drupal defined theme
       // function, for example.
       if (!isset($info['arguments']) && isset($cache[$hook])) {
         $result[$hook]['arguments'] = $cache[$hook]['arguments'];
       }
 
       // The following apply only to theming hooks implemented as templates.
       if (isset($info['template'])) {
-        // Prepend the current theming path when none is set.
-        if (!isset($info['path'])) {
-          $result[$hook]['template'] = $path . '/' . $info['template'];
-        }
+        // Generate path relative to the Drupal root directory.
+        $result[$hook]['template'] = $result[$hook]['theme path'] . '/' . $info['template'];
 
         // These are used for template naming suggestions. Theme implementations
         // can occur in multiple paths. Suggestions should follow.
         if (!isset($info['theme paths']) && isset($cache[$hook])) {
           $result[$hook]['theme paths'] = $cache[$hook]['theme paths'];
         }
-        // Check for sub-directories.
-        $result[$hook]['theme paths'][] = isset($info['path']) ? $info['path'] : $path;
+        $result[$hook]['theme paths'][] = $result[$hook]['theme path'];
       }
 
       // Allow variable processors for all theming hooks, whether the hook is
       // implemented as a template or as a function.
       foreach ($variable_process_phases as $phase_key => $phase) {
         // Check for existing variable processors. Ensure arrayness.
         if (!isset($info[$phase_key]) || !is_array($info[$phase_key])) {
           $info[$phase_key] = array();
           $prefixes = array();
@@ -904,21 +912,18 @@ function theme() {
       $suggestions[] = $variables['template_file'];
     }
 
     if ($suggestions) {
       $template_file = drupal_discover_template($info['theme paths'], $suggestions, $extension);
     }
 
     if (empty($template_file)) {
       $template_file = $info['template'] . $extension;
-      if (isset($info['path'])) {
-        $template_file = $info['path'] . '/' . $template_file;
-      }
     }
     $output = $render_function($template_file, $variables);
   }
   // restore path_to_theme()
   $theme_path = $temp;
   return $output;
 }
 
 /**
@@ -1084,19 +1089,19 @@ function drupal_find_theme_templates($ca
     if (($pos = strpos($template, '.')) !== FALSE) {
       $template = substr($template, 0, $pos);
     }
     // Transform - in filenames to _ to match function naming scheme
     // for the purposes of searching.
     $hook = strtr($template, '-', '_');
     if (isset($cache[$hook])) {
       $templates[$hook] = array(
         'template' => $template,
-        'path' => dirname($file->uri),
+        'theme path' => dirname($file->uri),
       );
     }
     // Ensure that the pattern is maintained from base themes to its sub-themes.
     // Each sub-theme will have their templates scanned so the pattern must be
     // held for subsequent runs.
     if (isset($cache[$hook]['pattern'])) {
       $templates[$hook]['pattern'] = $cache[$hook]['pattern'];
     }
   }
@@ -1110,19 +1115,19 @@ function drupal_find_theme_templates($ca
       $pattern = strtr($info['pattern'], '_', '-');
 
       $matches = preg_grep('/^' . $pattern . '/', $patterns);
       if ($matches) {
         foreach ($matches as $match) {
           $file = substr($match, 0, strpos($match, '.'));
           // Put the underscores back in for the hook name and register this pattern.
           $templates[strtr($file, '-', '_')] = array(
             'template' => $file,
-            'path' => dirname($files[$match]->uri),
+            'theme path' => dirname($files[$match]->uri),
             'arguments' => $info['arguments'],
           );
         }
       }
     }
   }
   return $templates;
 }
 
Index: modules/field/field.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/field/field.module,v
retrieving revision 1.32
diff -u -9 -p -r1.32 field.module
--- modules/field/field.module	9 Sep 2009 21:21:53 -0000	1.32
+++ modules/field/field.module	10 Sep 2009 20:10:16 -0000
@@ -151,19 +151,19 @@ function field_help($path, $arg) {
 /**
  * Implement hook_theme().
  */
 function field_theme() {
   $path = drupal_get_path('module', 'field') . '/theme';
   $items = array(
     'field' => array(
       'template' => 'field',
       'arguments' => array('element' => NULL),
-      'path' => $path,
+      'theme path' => $path,
     ),
     'field_multiple_value_form' => array(
       'arguments' => array('element' => NULL),
     ),
   );
   $field_formatters = field_info_formatter_types(NULL);
   foreach ($field_formatters as $key => $field_formatter) {
 	$items["field_formatter_$key"] = array(
       'arguments' => array('element' => NULL),
Index: modules/system/system.api.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.api.php,v
retrieving revision 1.74
diff -u -9 -p -r1.74 system.api.php
--- modules/system/system.api.php	10 Sep 2009 06:38:20 -0000	1.74
+++ modules/system/system.api.php	10 Sep 2009 20:10:16 -0000
@@ -756,68 +756,66 @@ function hook_permission() {
 }
 
 /**
  * Register a module (or theme's) theme implementations.
  *
  * Modules and themes implementing this return an array of arrays. The key
  * to each sub-array is the internal name of the hook, and the array contains
  * info about the hook. Each array may contain the following items:
  *
- * - arguments: (required) An array of arguments that this theme hook uses. This
+ * - 'arguments': (required) An array of arguments that this theme hook uses. This
  *   value allows the theme layer to properly utilize templates. The
  *   array keys represent the name of the variable, and the value will be
  *   used as the default value if not specified to the theme() function.
  *   These arguments must be in the same order that they will be given to
  *   the theme() function.
- * - file: The file the implementation resides in. This file will be included
+ * - 'file': The file the implementation resides in. This file will be included
  *   prior to the theme being rendered, to make sure that the function or
  *   preprocess function (as needed) is actually loaded; this makes it possible
- *   to split theme functions out into separate files quite easily.
- * - path: Override the path of the file to be used. Ordinarily the module or
- *   theme path will be used, but if the file will not be in the default path,
- *   include it here. This path should be relative to the Drupal root
- *   directory.
- * - template: If specified, this theme implementation is a template, and this
+ *   to split theme functions out into separate files quite easily. If 'file
+ *   path' is specified, the file should be in this directory; otherwise it
+ *   should be in $path.
+ * - 'file path': The directory containing 'file', if this is different from
+ *   $path. This path should be relative to the Drupal root directory.
+ * - 'template': If specified, this theme implementation is a template, and this
  *   is the template file <b>without an extension</b>. Do not put .tpl.php
  *   on this file; that extension will be added automatically by the default
- *   rendering engine (which is PHPTemplate). If 'path', above, is specified,
- *   the template should also be in this path.
- * - function: If specified, this will be the function name to invoke for this
+ *   rendering engine (which is PHPTemplate). If 'theme path' is specified, the
+ *   the template should be in this directory; otherwise it should be in $path.
+ * - 'theme path': The directory containing 'template', if this is different from
+ *   $path. This path should be relative to the Drupal root directory.
+ * - 'theme paths': An array of other directories that may contain 'template'.
+ *   The paths should be relative to the Drupal root directory.
+ * - 'function': If specified, this will be the function name to invoke for this
  *   implementation. If neither file nor function is specified, a default
  *   function name will be assumed. For example, if a module registers
  *   the 'node' theme hook, 'theme_node' will be assigned to its function.
  *   If the chameleon theme registers the node hook, it will be assigned
  *   'chameleon_node' as its function.
- * - pattern: A regular expression pattern to be used to allow this theme
+ * - 'pattern': A regular expression pattern to be used to allow this theme
  *   implementation to have a dynamic name. The convention is to use __ to
  *   differentiate the dynamic portion of the theme. For example, to allow
  *   forums to be themed individually, the pattern might be: 'forum__'. Then,
- *   when the forum is themed, call: <code>theme(array('forum__' . $tid, 'forum'),
- *   $forum)</code>.
- * - preprocess functions: A list of functions used to preprocess this data.
+ *   when the forum is themed, call: <code>theme(array('forum__' . $tid,
+ *   'forum'), $forum)</code>.
+ * - 'preprocess functions': A list of functions used to preprocess this data.
  *   Ordinarily this won't be used; it's automatically filled in. By default,
  *   for a module this will be filled in as template_preprocess_HOOK. For
  *   a theme this will be filled in as phptemplate_preprocess and
  *   phptemplate_preprocess_HOOK as well as themename_preprocess and
  *   themename_preprocess_HOOK.
- * - override preprocess functions: Set to TRUE when a theme does NOT want the
+ * - 'override preprocess functions': Set to TRUE when a theme does NOT want the
  *   standard preprocess functions to run. This can be used to give a theme
  *   FULL control over how variables are set. For example, if a theme wants
  *   total control over how certain variables in the page.tpl.php are set,
  *   this can be set to true. Please keep in mind that when this is used
  *   by a theme, that theme becomes responsible for making sure necessary
  *   variables are set.
- * - type: (automatically derived) Where the theme hook is defined:
- *   'module', 'theme_engine', or 'theme'.
- * - theme path: (automatically derived) The directory path of the theme or
- *   module, so that it doesn't need to be looked up.
- * - theme paths: (automatically derived) An array of template suggestions where
- *   .tpl.php files related to this theme hook may be found.
  *
  * The following parameters are all optional.
  *
  * @param $existing
  *   An array of existing implementations that may be used for override
  *   purposes. This is primarily useful for themes that may wish to examine
  *   existing implementations to extract data (such as arguments) so that
  *   it may properly register its own, higher priority implementations.
  * @param $type
Index: modules/toolbar/toolbar.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/toolbar/toolbar.module,v
retrieving revision 1.10
diff -u -9 -p -r1.10 toolbar.module
--- modules/toolbar/toolbar.module	5 Sep 2009 15:05:05 -0000	1.10
+++ modules/toolbar/toolbar.module	10 Sep 2009 20:10:16 -0000
@@ -19,19 +19,18 @@ function toolbar_permission() {
 }
 
 /**
  * Implement hook_theme().
  */
 function toolbar_theme($existing, $type, $theme, $path) {
   $items['toolbar'] = array(
     'arguments' => array('toolbar' => array()),
     'template' => 'toolbar',
-    'path' => drupal_get_path('module', 'toolbar'),
   );
   return $items;
 }
 
 /**
  * Implement hook_page_build().
  * 
  * Add admin toolbar to the page_top region automatically.
  */
