You are here

function print_preprocess_node in Printer, email and PDF versions 7.2

Same name and namespace in other branches
  1. 7 print.module \print_preprocess_node()

Implements hook_preprocess_HOOK().

File

./print.module, line 125
Displays Printer-friendly versions of Drupal pages.

Code

function print_preprocess_node(&$variables) {
  if ($variables['elements']['#view_mode'] == PRINT_VIEW_MODE && isset($variables['elements']['#print_format'])) {
    $type = $variables['elements']['#node']->type;
    $format = $variables['elements']['#print_format'];
    $nid = $variables['elements']['#node']->nid;
    $variables['theme_hook_suggestions'][] = "node__print";
    $variables['theme_hook_suggestions'][] = "node__print__{$format}";
    $variables['theme_hook_suggestions'][] = "node__print__{$format}__node__{$type}";
    $variables['theme_hook_suggestions'][] = "node__print__{$format}__node__{$nid}";
  }
}