You are here

function print_pdf_node_update in Printer, email and PDF versions 7

Same name and namespace in other branches
  1. 7.2 print_pdf/print_pdf.module \print_pdf_node_update()

Implements hook_node_update().

File

print_pdf/print_pdf.module, line 411
Displays Printer-friendly versions of Drupal pages.

Code

function print_pdf_node_update($node) {
  if (user_access('administer print') || user_access('node-specific print configuration')) {
    if (!isset($node->print_pdf_display) || $node->print_pdf_display === NULL) {
      $node->print_pdf_display = variable_get('print_pdf_display_' . $node->type, PRINT_TYPE_SHOW_LINK_DEFAULT);
    }
    if (!isset($node->print_pdf_display_comment) || $node->print_pdf_display_comment === NULL) {
      $node->print_pdf_display_comment = variable_get('print_pdf_display_comment_' . $node->type, PRINT_TYPE_COMMENT_LINK_DEFAULT);
    }
    if (!isset($node->print_pdf_display_urllist) || $node->print_pdf_display_urllist === NULL) {
      $node->print_pdf_display_urllist = variable_get('print_pdf_display_urllist_' . $node->type, PRINT_TYPE_URLLIST_DEFAULT);
    }
    _print_pdf_node_conf_modify($node->nid, $node->print_pdf_display, $node->print_pdf_display_comment, $node->print_pdf_display_urllist);
  }
}