You are here

function _print_url_list_enabled in Printer, email and PDF versions 5.4

Same name and namespace in other branches
  1. 6 print.pages.inc \_print_url_list_enabled()
  2. 7.2 print.pages.inc \_print_url_list_enabled()
  3. 7 print.pages.inc \_print_url_list_enabled()
  4. 5.x print.pages.inc \_print_url_list_enabled()

Check URL list settings for this node

Parameters

node: node object

$format: format of the page being generated

Return value

TRUE if URL list should be displayed, FALSE otherwise

3 calls to _print_url_list_enabled()
_print_generate_book in ./print.pages.inc
Prepare a Printer-friendly-ready node body for book pages
_print_generate_node in ./print.pages.inc
Prepare a Printer-friendly-ready node body for content nodes
_print_generate_path in ./print.pages.inc
Prepare a Printer-friendly-ready node body for non-content pages

File

./print.pages.inc, line 508

Code

function _print_url_list_enabled($node, $format = PRINT_HTML_FORMAT) {
  if (!isset($node->type)) {
    return TRUE;
  }
  switch ($format) {
    case PRINT_HTML_FORMAT:
      $node_urllist = isset($node->print_display_urllist) ? $node->print_display_urllist : variable_get('print_display_urllist_' . $node->type, PRINT_TYPE_URLLIST_DEFAULT);
      $fmt = '';
      break;
    case PRINT_MAIL_FORMAT:
      $node_urllist = isset($node->print_mail_display_urllist) ? $node->print_mail_display_urllist : variable_get('print_mail_display_urllist_' . $node->type, PRINT_TYPE_URLLIST_DEFAULT);
      $fmt = $format . '_';
      break;
    case PRINT_PDF_FORMAT:
      $node_urllist = isset($node->print_pdf_display_urllist) ? $node->print_pdf_display_urllist : variable_get('print_pdf_display_urllist_' . $node->type, PRINT_TYPE_URLLIST_DEFAULT);
      $fmt = $format . '_';
      break;
  }
  if (!isset($node_urllist)) {
    $node_urllist = PRINT_TYPE_URLLIST_DEFAULT;
  }

  // Get value of Printer-friendly URLs setting
  return variable_get('print_urls', PRINT_URLS_DEFAULT) && $node_urllist;
}