summaryrefslogtreecommitdiff
path: root/themes
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2005-09-04 13:13:31 +0000
committerDries Buytaert <dries@buytaert.net>2005-09-04 13:13:31 +0000
commit0094e99b8733b23a94cd0283909fae6e1dce8720 (patch)
tree04a6236e0a152576c023ce1f4d9014ad28dc76fa /themes
parentc13025d2326a9ba916a26cdb916647eb4e36c063 (diff)
downloadbrdo-0094e99b8733b23a94cd0283909fae6e1dce8720.tar.gz
brdo-0094e99b8733b23a94cd0283909fae6e1dce8720.tar.bz2
- Patch #28576 by Robrecht Jacques: 'file' is a reserved variable.
Diffstat (limited to 'themes')
-rw-r--r--themes/engines/phptemplate/phptemplate.engine9
1 files changed, 5 insertions, 4 deletions
diff --git a/themes/engines/phptemplate/phptemplate.engine b/themes/engines/phptemplate/phptemplate.engine
index 366420fdd..b58d9dcb9 100644
--- a/themes/engines/phptemplate/phptemplate.engine
+++ b/themes/engines/phptemplate/phptemplate.engine
@@ -51,7 +51,7 @@ function phptemplate_regions() {
* @return
* The HTML generated by the template system.
*/
-function _phptemplate_callback($hook, $variables = array(), $file = null) {
+function _phptemplate_callback($hook, $variables = array(), $file = NULL) {
$variables = array_merge($variables, _phptemplate_default_variables($hook, $variables));
@@ -169,7 +169,7 @@ function phptemplate_page($content) {
if ($sidebar_right != '') {
$layout = ($layout == 'left') ? 'both' : 'right';
}
- $sidebar_indicator = null;
+ $sidebar_indicator = NULL;
// Construct page title
if (drupal_get_title()) {
@@ -310,7 +310,7 @@ function phptemplate_box($title, $content, $region = 'main') {
* @param $file
* A suggested template file to use.
*/
-function _phptemplate_default($hook, $variables, $file = null) {
+function _phptemplate_default($hook, $variables, $file = NULL) {
if ($file && file_exists(path_to_theme() . "/$file.tpl.php")) {
$file = path_to_theme() . "/$file.tpl.php";
}
@@ -324,13 +324,14 @@ function _phptemplate_default($hook, $variables, $file = null) {
}
else {
$variables['hook'] = $hook;
- watchdog('error', 'PHPTemplate was instructed to override the ' . $hook . ' theme function, but no valid template file was found.');
+ watchdog('error', t('PHPTemplate was instructed to override the %name theme function, but no valid template file was found.', array('%name' => theme('placeholder', $hook))));
$file = 'themes/engines/phptemplate/default.tpl.php';
}
}
}
if ($file) {
+ unset($variables['file']); // Make sure we don't override $file
extract($variables); // Extract the vars to local namespace
ob_start(); // Start output buffering
include($file); // Include the file