You are here

function _print_page_match in Printer, email and PDF versions 5.4

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

Determine if the provided page is enabled according to the visibility settings

Parameters

$visibility: current visibility settings: 0 for show on every page except the listed pages 1 for show on only the listed pages

$pages: list of pages

Return value

TRUE if it is enabled, FALSE otherwise

3 calls to _print_page_match()
print_link_allowed in ./print.module
Determine a the link to the PF version is allowed depending on all possible settings
print_mail_link_allowed in print_mail/print_mail.module
Determine a the link to send by e-mail is allowed depending on all possible settings
print_pdf_link_allowed in print_pdf/print_pdf.module
Determine a the link to the PDF version is allowed depending on all possible settings

File

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

Code

function _print_page_match($visibility, $path, $pages) {
  if ($pages) {
    if ($visibility == 2) {
      return drupal_eval($pages);
    }
    $alias = drupal_get_path_alias($path);
    $page_match = _print_match_path($path, $pages);
    if ($alias != $path) {
      $page_match = $page_match || _print_match_path($alias, $pages);
    }
    return !($visibility xor $page_match);
  }
  else {
    return !$visibility;
  }
}