2005-05-04 18:12:18 +00:00
|
|
|
<?php
|
|
|
|
// $Id$
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* Handles integration of templates written in pure php with the Drupal theme system.
|
|
|
|
*/
|
|
|
|
|
|
|
|
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
|
|
|
/**
|
2007-04-27 07:42:54 +00:00
|
|
|
* Implementation of hook_theme to tell Drupal what templates the engine
|
2007-04-06 13:27:23 +00:00
|
|
|
* and the current theme use. The $existing argument will contain hooks
|
|
|
|
* pre-defined by Drupal so that we can use that information if
|
|
|
|
* we need to.
|
|
|
|
*/
|
2007-05-06 05:47:52 +00:00
|
|
|
function phptemplate_theme($existing, $type, $theme, $path) {
|
2007-07-03 18:48:41 +00:00
|
|
|
$templates = drupal_find_theme_functions($existing, array('phptemplate', $theme));
|
|
|
|
$templates += drupal_find_theme_templates($existing, '.tpl.php', $path);
|
2007-04-06 13:27:23 +00:00
|
|
|
return $templates;
|
|
|
|
}
|
|
|
|
|