You are here

function _print_url_list_enabled in Printer, email and PDF versions 7

Same name and namespace in other branches
  1. 5.4 print.pages.inc \_print_url_list_enabled()
  2. 6 print.pages.inc \_print_url_list_enabled()
  3. 7.2 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 461

Code

function _print_url_list_enabled($node, $format = PRINT_HTML_FORMAT) {
  if (!isset($node->type)) {
    switch ($format) {
      case PRINT_HTML_FORMAT:
        $node_urllist = variable_get('print_display_sys_urllist', PRINT_TYPE_SYS_URLLIST_DEFAULT);
        break;
      case PRINT_MAIL_FORMAT:
        $node_urllist = variable_get('print_mail_display_sys_urllist', PRINT_TYPE_SYS_URLLIST_DEFAULT);
        break;
      case PRINT_PDF_FORMAT:
        $node_urllist = variable_get('print_pdf_display_sys_urllist', PRINT_TYPE_SYS_URLLIST_DEFAULT);
        break;
      default:
        $node_urllist = PRINT_TYPE_SYS_URLLIST_DEFAULT;
    }
  }
  else {
    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);
        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);
        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);
        break;
      default:
        $node_urllist = PRINT_TYPE_URLLIST_DEFAULT;
    }
  }

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