You are here

function print_format_link in Printer, email and PDF versions 5.2

Auxiliary function to fill the Printer-friendly link attributes

Return value

array of formatted attributes

3 calls to print_format_link()
print_insert_link in ./print.module
Auxiliary function to display a formatted Printer-friendly link
print_link in ./print.module
Implementation of hook_link().
print_link_alter in ./print.module
Implementation of hook_link_alter().

File

./print.module, line 582
Display printer-friendly versions of Drupal pages

Code

function print_format_link() {
  $print_settings = variable_get('print_settings', print_settings_default());
  $attributes = array(
    'title' => t('Display a printer-friendly version of this page.'),
    'class' => 'print-page',
  );
  switch ($print_settings['newwindow']) {
    case 1:
      $attributes['target'] = '_blank';
      break;
    case 2:
      $attributes['onclick'] = 'window.open(this.href); return false';
      break;
  }
  return array(
    'text' => t('Printer-friendly version'),
    'attributes' => $attributes,
  );
}