phptemplate.engine 572 B

12345678910111213141516171819202122232425
  1. <?php
  2. /**
  3. * @file
  4. * Handles integration of PHP templates with the Drupal theme system.
  5. */
  6. /**
  7. * Implements hook_init().
  8. */
  9. function phptemplate_init($template) {
  10. $file = dirname($template->filename) . '/template.php';
  11. if (file_exists($file)) {
  12. include_once DRUPAL_ROOT . '/' . $file;
  13. }
  14. }
  15. /**
  16. * Implements hook_theme().
  17. */
  18. function phptemplate_theme($existing, $type, $theme, $path) {
  19. $templates = drupal_find_theme_functions($existing, array($theme));
  20. $templates += drupal_find_theme_templates($existing, '.tpl.php', $path);
  21. return $templates;
  22. }