summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--includes/theme.inc15
-rw-r--r--themes/engines/phptemplate/phptemplate.engine4
2 files changed, 17 insertions, 2 deletions
diff --git a/includes/theme.inc b/includes/theme.inc
index 05626586a..a0a1e1654 100644
--- a/includes/theme.inc
+++ b/includes/theme.inc
@@ -215,6 +215,21 @@ function path_to_theme() {
}
/**
+ * Return the path to the currently selected engine.
+ */
+function path_to_engine() {
+ global $theme, $theme_engine;
+
+ if (!isset($theme)) {
+ init_theme();
+ }
+
+ $engines = list_theme_engines();
+
+ return dirname($engines[$theme_engine]->filename);
+}
+
+/**
* Retrieve an associative array containing the settings for a theme.
*
* The final settings are arrived at by merging the default settings,
diff --git a/themes/engines/phptemplate/phptemplate.engine b/themes/engines/phptemplate/phptemplate.engine
index 02d365a32..c8892b097 100644
--- a/themes/engines/phptemplate/phptemplate.engine
+++ b/themes/engines/phptemplate/phptemplate.engine
@@ -376,12 +376,12 @@ function _phptemplate_default($hook, $variables, $suggestions = array(), $extens
}
else {
if (in_array($hook, array('node', 'block', 'box', 'comment'))) {
- $file = "themes/engines/$theme_engine/$hook$extension";
+ $file = path_to_engine() .'/'. $hook . $extension;
}
else {
$variables['hook'] = $hook;
watchdog('error', t('%engine.engine was instructed to override the %name theme function, but no valid template file was found.', array('%engine' => $theme_engine, '%name' => $hook)));
- $file = "themes/engines/$theme_engine/default$extension";
+ $file = path_to_engine() .'/default'. $extension;
}
}
}