diff options
author | Dries Buytaert <dries@buytaert.net> | 2005-07-17 19:52:10 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2005-07-17 19:52:10 +0000 |
commit | 7c61046a94c71db11770845575d0cba93a646128 (patch) | |
tree | f063d155e711f20750f486a3b651f56ce1ef91bc /themes | |
parent | 40b13e55b09c3912c9eae89bd2539b88dd7e47f0 (diff) | |
download | brdo-7c61046a94c71db11770845575d0cba93a646128.tar.gz brdo-7c61046a94c71db11770845575d0cba93a646128.tar.bz2 |
- Patch #24862 by chx: flatten the node object's member fields.
Also replaced some double quotes by single quotes.
Diffstat (limited to 'themes')
-rw-r--r-- | themes/engines/phptemplate/phptemplate.engine | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/themes/engines/phptemplate/phptemplate.engine b/themes/engines/phptemplate/phptemplate.engine index 59616a619..5578ecce6 100644 --- a/themes/engines/phptemplate/phptemplate.engine +++ b/themes/engines/phptemplate/phptemplate.engine @@ -124,21 +124,21 @@ function phptemplate_page($content) { /** * Populate sidebars. */ - $layout = "none"; + $layout = 'none'; global $sidebar_indicator; /** * Sidebar_indicator tells the block counting code to count sidebars seperately. */ $sidebar_indicator = 'left'; - $sidebar_left = theme("blocks", "left"); - if ($sidebar_left != "") { - $layout = "left"; + $sidebar_left = theme('blocks', 'left'); + if ($sidebar_left != '') { + $layout = 'left'; } $sidebar_indicator = 'right'; - $sidebar_right = theme("blocks", "right"); - if ($sidebar_right != "") { - $layout = ($layout == "left") ? "both" : "right"; + $sidebar_right = theme('blocks', 'right'); + if ($sidebar_right != '') { + $layout = ($layout == 'left') ? 'both' : 'right'; } $sidebar_indicator = null; @@ -178,7 +178,7 @@ function phptemplate_page($content) { return _phptemplate_callback('page', $variables); } -/** +/* * Prepare the values passed to the theme_node function to be passed * into a pluggable template engine. */ @@ -192,23 +192,22 @@ function phptemplate_node($node, $main = 0, $page = 0) { $variables = array( 'title' => check_plain($node->title), - 'node_url' => url('node/' . $node->nid), - 'terms' => theme('links',$taxonomy), + 'node_url' => url('node/'. $node->nid), + 'terms' => theme('links', $taxonomy), 'name' => format_name($node), 'date' => format_date($node->created), - 'sticky' => $node->sticky, 'content' => ($main && $node->teaser) ? $node->teaser : $node->body, 'links' => $node->links ? theme('links', $node->links) : '', 'mission' => $mission, 'page' => $page, 'taxonomy' => $taxonomy, - - /* Lastly , pass the actual node to allow more customization */ - 'node' => $node, 'main' => $main, 'page' => $page ); + // Flatten the node object's member fields. + $variables = array_merge(object2array($node), $variables); + // Display info only on certain node types. if (theme_get_setting('toggle_node_info_' . $node->type)) { $variables['submitted'] = t('Submitted by %a on %b.', array('%a' => format_name($node), '%b' => format_date($node->created))); @@ -289,7 +288,7 @@ 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.'); - $file = "themes/engines/phptemplate/default.tpl.php"; + $file = 'themes/engines/phptemplate/default.tpl.php'; } } } |