You are here

function print_insert_link in Printer, email and PDF versions 7.2

Same name and namespace in other branches
  1. 5.4 print.module \print_insert_link()
  2. 5.2 print.module \print_insert_link()
  3. 5.3 print.module \print_insert_link()
  4. 6 print.module \print_insert_link()
  5. 7 print.module \print_insert_link()
  6. 5.x print.module \print_insert_link()

Auxiliary function to display a formatted Printer-friendly link.

Function made available so that developers may call this function from their defined pages/blocks.

Parameters

string $path: path to be used in the link. If not specified, the current URL is used.

object $node: node object, to be used in checking node access. If the path argument is not provided, the path used will be node/nid.

string $location: Where in the page where the link is being inserted ('link', 'corner', 'block', 'help').

Return value

string HTML link to the printer-friendly page

Related topics

File

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

Code

function print_insert_link($path = NULL, $node = NULL, $location = '') {
  if (function_exists('print_ui_insert_link')) {
    return print_ui_insert_link(print_print_link(), array(
      'path' => $path,
      'node' => $node,
      'location' => $location,
    ));
  }
  else {
    return FALSE;
  }
}