phptemplate.engine

  1. 7.x drupal-7.x/themes/engines/phptemplate/phptemplate.engine
  2. 6.x drupal-6.x/themes/engines/phptemplate/phptemplate.engine

Handles integration of PHP templates with the Drupal theme system.

File

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