phptemplate.engine 580 Bytes
Newer Older
1 2 3 4 5
<?php
// $Id$

/**
 * @file
6
 * Handles integration of PHP templates with the Drupal theme system.
7 8
 */

9 10 11
/**
 * Implements hook_init().
 */
12
function phptemplate_init($template) {
13
  $file = dirname($template->filename) . '/template.php';
14
  if (file_exists($file)) {
15
    include_once DRUPAL_ROOT . '/' . $file;
16 17 18
  }
}

19
/**
20
 * Implements hook_theme().
21
 */
22
function phptemplate_theme($existing, $type, $theme, $path) {
23
  $templates = drupal_find_theme_functions($existing, array($theme));
24
  $templates += drupal_find_theme_templates($existing, '.tpl.php', $path);
25 26
  return $templates;
}