web/drupal/themes/engines/phptemplate/phptemplate.engine
branchdrupal
changeset 74 0ff3ba646492
equal deleted inserted replaced
73:fcf75e232c5b 74:0ff3ba646492
       
     1 <?php
       
     2 // $Id: phptemplate.engine,v 1.69 2007/10/02 16:19:23 dries Exp $
       
     3 
       
     4 /**
       
     5  * @file
       
     6  * Handles integration of templates written in pure php with the Drupal theme system.
       
     7  */
       
     8 
       
     9 function phptemplate_init($template) {
       
    10   $file = dirname($template->filename) .'/template.php';
       
    11   if (file_exists($file)) {
       
    12     include_once "./$file";
       
    13   }
       
    14 }
       
    15 
       
    16 /**
       
    17  * Implementation of hook_theme to tell Drupal what templates the engine
       
    18  * and the current theme use. The $existing argument will contain hooks
       
    19  * pre-defined by Drupal so that we can use that information if
       
    20  * we need to.
       
    21  */
       
    22 function phptemplate_theme($existing, $type, $theme, $path) {
       
    23   $templates = drupal_find_theme_functions($existing, array('phptemplate', $theme));
       
    24   $templates += drupal_find_theme_templates($existing, '.tpl.php', $path);
       
    25   return $templates;
       
    26 }
       
    27