diff includes/theme.inc @ 11:589fb7c02327 6.5

Drupal 6.5
author Franck Deroche <webmaster@defr.org>
date Tue, 23 Dec 2008 14:32:19 +0100
parents fff6d4c8c043
children 8b6c45761e01
line wrap: on
line diff
--- a/includes/theme.inc	Tue Dec 23 14:32:08 2008 +0100
+++ b/includes/theme.inc	Tue Dec 23 14:32:19 2008 +0100
@@ -1,5 +1,5 @@
 <?php
-// $Id: theme.inc,v 1.415.2.9 2008/07/09 21:48:28 goba Exp $
+// $Id: theme.inc,v 1.415.2.12 2008/09/17 08:57:23 goba Exp $
 
 /**
  * @file
@@ -8,7 +8,7 @@
  * The theme system allows for nearly all output of the Drupal system to be
  * customized by user themes.
  *
- * @see <a href="http://drupal.org/node/253">Theme system</a>
+ * @see <a href="http://drupal.org/node/171179">Theme guide</a>
  * @see themeable
  */
 
@@ -247,8 +247,8 @@
 
 /**
  * Process a single invocation of the theme hook. $type will be one
- * of 'module', 'theme_engine' or 'theme' and it tells us some
- * important information.
+ * of 'module', 'theme_engine', 'base_theme_engine', 'theme', or 'base_theme'
+ * and it tells us some important information.
  *
  * Because $cache is a reference, the cache will be continually
  * expanded upon; new entries will replace old entries in the
@@ -314,7 +314,7 @@
           // to provide preprocess functions even if they are not the owner of the current hook.
           $prefixes += module_list();
         }
-        elseif ($type == 'theme_engine') {
+        elseif ($type == 'theme_engine' || $type == 'base_theme_engine') {
           // Theme engines get an extra set that come before the normally named preprocessors.
           $prefixes[] = $name .'_engine';
           // The theme engine also registers on behalf of the theme. The theme or engine name can be used.
@@ -381,7 +381,7 @@
 
   // Process each base theme.
   foreach ($base_theme as $base) {
-    // If the theme uses a theme engine, process its hooks.
+    // If the base theme uses a theme engine, process its hooks.
     $base_path = dirname($base->filename);
     if ($theme_engine) {
       _theme_process_registry($cache, $theme_engine, 'base_theme_engine', $base->name, $base_path);
@@ -957,18 +957,19 @@
 /**
  * Render a system default template, which is essentially a PHP template.
  *
- * @param $file
- *   The filename of the template to render.
+ * @param $template_file
+ *   The filename of the template to render. Note that this will overwrite
+ *   anything stored in $variables['template_file'] if using a preprocess hook.
  * @param $variables
  *   A keyed array of variables that will appear in the output.
  *
  * @return
  *   The output generated by the template.
  */
-function theme_render_template($file, $variables) {
+function theme_render_template($template_file, $variables) {
   extract($variables, EXTR_SKIP);  // Extract the variables to a local namespace
   ob_start();                      // Start output buffering
-  include "./$file";               // Include the file
+  include "./$template_file";      // Include the template file
   $contents = ob_get_contents();   // Get the contents of the buffer
   ob_end_clean();                  // End buffering and discard
   return $contents;                // Return the contents