cms/drupal/themes/engines/phptemplate/phptemplate.engine
changeset 541 e756a8c72c3d
equal deleted inserted replaced
540:07239de796bb 541:e756a8c72c3d
       
     1 <?php
       
     2 
       
     3 /**
       
     4  * @file
       
     5  * Handles integration of PHP templates with the Drupal theme system.
       
     6  */
       
     7 
       
     8 /**
       
     9  * Implements hook_init().
       
    10  */
       
    11 function phptemplate_init($template) {
       
    12   $file = dirname($template->filename) . '/template.php';
       
    13   if (file_exists($file)) {
       
    14     include_once DRUPAL_ROOT . '/' . $file;
       
    15   }
       
    16 }
       
    17 
       
    18 /**
       
    19  * Implements hook_theme().
       
    20  */
       
    21 function phptemplate_theme($existing, $type, $theme, $path) {
       
    22   $templates = drupal_find_theme_functions($existing, array($theme));
       
    23   $templates += drupal_find_theme_templates($existing, '.tpl.php', $path);
       
    24   return $templates;
       
    25 }