summaryrefslogtreecommitdiff
path: root/themes/engines/phptemplate/phptemplate.engine
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2007-07-03 18:48:41 +0000
committerDries Buytaert <dries@buytaert.net>2007-07-03 18:48:41 +0000
commit435f3154f9c347f35a4685d6456b9aded4171bc2 (patch)
tree2b12de72d697709b9904765313a242e1a71ba162 /themes/engines/phptemplate/phptemplate.engine
parentb5cdf535f4a233cd4156e6c091e6aa1f3f28800a (diff)
downloadbrdo-435f3154f9c347f35a4685d6456b9aded4171bc2.tar.gz
brdo-435f3154f9c347f35a4685d6456b9aded4171bc2.tar.bz2
- Patch #141730 by Earl: allow theming system to use wildcards. I promised in the issue that this patch would still go in, so here goes.
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;
}