2005-05-04 18:12:18 +00:00
|
|
|
<?php
|
|
|
|
// $Id$
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file
|
2010-02-23 19:03:37 +00:00
|
|
|
* Handles integration of PHP templates with the Drupal theme system.
|
2005-05-04 18:12:18 +00:00
|
|
|
*/
|
|
|
|
|
2010-02-23 19:03:37 +00:00
|
|
|
/**
|
|
|
|
* Implements hook_init().
|
|
|
|
*/
|
2005-05-04 18:12:18 +00:00
|
|
|
function phptemplate_init($template) {
|
2008-04-14 17:48:46 +00:00
|
|
|
$file = dirname($template->filename) . '/template.php';
|
2005-05-04 18:12:18 +00:00
|
|
|
if (file_exists($file)) {
|
2008-09-20 20:22:25 +00:00
|
|
|
include_once DRUPAL_ROOT . '/' . $file;
|
2005-05-04 18:12:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-04-06 13:27:23 +00:00
|
|
|
/**
|
2010-02-23 19:03:37 +00:00
|
|
|
* Implements hook_theme().
|
2007-04-06 13:27:23 +00:00
|
|
|
*/
|
2007-05-06 05:47:52 +00:00
|
|
|
function phptemplate_theme($existing, $type, $theme, $path) {
|
2009-06-02 03:57:22 +00:00
|
|
|
$templates = drupal_find_theme_functions($existing, array($theme));
|
2007-07-03 18:48:41 +00:00
|
|
|
$templates += drupal_find_theme_templates($existing, '.tpl.php', $path);
|
2007-04-06 13:27:23 +00:00
|
|
|
return $templates;
|
|
|
|
}
|