summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoao Ventura2011-08-15 23:51:06 (GMT)
committer Joao Ventura2011-08-15 23:51:06 (GMT)
commitb73e9d6aa928aa0ad35660d3f88b2b6ac442c95a (patch)
tree2ccc05fe222633a6a3d542e5908d5f2e8f0c7a0b
parent9285c32370889b1e183c1a8cf39e30dff00657fe (diff)
Issue #1062634: correct order of operations in the preprocess functions.6.x-1.13
-rw-r--r--print.module14
1 files changed, 6 insertions, 8 deletions
diff --git a/print.module b/print.module
index e5f98f5..f9e8d79 100644
--- a/print.module
+++ b/print.module
@@ -142,6 +142,7 @@ function print_preprocess_print_node(&$variables) {
//Include the right template suggestions based on format (print, email) and type.
$format = $variables['type'];
$type = $variables['node']->type;
+
$variables['template_files'][] = "node";
$variables['template_files'][] = "node-$type";
$variables['template_files'][] = "print_node";
@@ -159,6 +160,9 @@ function print_preprocess_print_page(&$variables) {
$hooks = theme_get_registry();
}
+ $variables['show_blocks'] = FALSE;
+ $variables['show_messages'] = FALSE;
+
//Stolen from theme() so that ALL preprocess functions are called
$info = $hooks['page'];
if (isset($info['preprocess functions']) && is_array($info['preprocess functions'])) {
@@ -174,14 +178,8 @@ function print_preprocess_print_page(&$variables) {
$variables += $args[0];
$format = $variables['type'];
- if (isset($variables['node']->type)) {
- $type = $variables['node']->type;
- $variables['show_blocks'] = FALSE;
- $variables['show_messages'] = FALSE;
- }
- else {
- $type = '';
- }
+ $type = (isset($variables['node']->type)) ? $variables['node']->type : '';
+
$variables['template_files'][] = "print";
$variables['template_files'][] = "print.node-$type";
$variables['template_files'][] = "print_$format";