summaryrefslogtreecommitdiff
path: root/themes/engines/phptemplate/phptemplate.engine
diff options
context:
space:
mode:
Diffstat (limited to 'themes/engines/phptemplate/phptemplate.engine')
-rw-r--r--themes/engines/phptemplate/phptemplate.engine32
1 files changed, 2 insertions, 30 deletions
diff --git a/themes/engines/phptemplate/phptemplate.engine b/themes/engines/phptemplate/phptemplate.engine
index 4e9c065af..48f620838 100644
--- a/themes/engines/phptemplate/phptemplate.engine
+++ b/themes/engines/phptemplate/phptemplate.engine
@@ -20,36 +20,8 @@ function phptemplate_init($template) {
* we need to.
*/
function phptemplate_theme($existing, $type, $theme, $path) {
- $templates = array();
-
- // Check for template overrides.
- $files = drupal_system_listing('\.tpl\.php$', $path, 'name', 0);
-
- foreach ($files as $template => $file) {
- // chop off the .tpl
- $template = substr($template, 0, -4);
- if (isset($existing[$template])) {
- $templates[$template] = array(
- 'file' => $template,
- 'path' => dirname($file->filename),
- );
- }
- }
-
- // Check for function overrides.
- foreach ($existing as $hook => $info) {
- if (function_exists($theme .'_'. $hook)) {
- $templates[$hook] = array(
- 'function' => $theme .'_'. $hook,
- );
- }
- else if (function_exists('phptemplate_'. $hook)) {
- $templates[$hook] = array(
- 'function' => 'phptemplate_'. $hook,
- );
- }
- }
-
+ $templates = drupal_find_theme_functions($existing, array('phptemplate', $theme));
+ $templates += drupal_find_theme_templates($existing, '.tpl.php', $path);
return $templates;
}