You are here

function _print_format_link_aux in Printer, email and PDF versions 5.x

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

Auxiliary function to set the link text and html flag

Parameters

$type: type of link: 0 or 1 for a text-only link, 2 for icon-only and 3 for both text and icon

$text: text to be displayed on the link to the printer-friendly page

$img: path to the icon file

Return value

array with the link text and html flag

3 calls to _print_format_link_aux()
theme_print_format_link in ./print.module
Format the Printer-friendly link
theme_print_mail_format_link in print_mail/print_mail.module
Format the send by e-mail link
theme_print_pdf_format_link in print_pdf/print_pdf.module
Format the PDF version link

File

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

Code

function _print_format_link_aux($type = 0, $text = '', $img = '') {
  if ($type >= 2) {
    $html = TRUE;
    switch ($type) {
      case 2:
        $text = theme('image', $img, $text, $text, array(
          'class' => 'print-icon',
        ));
        break;
      case 3:
        $text = theme('image', $img, $text, $text, array(
          'class' => 'print-icon print-icon-margin',
        )) . $text;
        break;
    }
  }
  else {
    $html = FALSE;
  }
  return array(
    'text' => $text,
    'html' => $html,
  );
}