function _print_page_match in Printer, email and PDF versions 5.3
Same name and namespace in other branches
- 5.4 print.module \_print_page_match()
- 6 print.module \_print_page_match()
- 7 print.module \_print_page_match()
- 5.x print.module \_print_page_match()
Determine if the current 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 478 - Displays Printer-friendly versions of Drupal pages.
Code
function _print_page_match($visibility, $pages) {
if ($pages) {
$path = drupal_get_path_alias($_GET['q']);
$page_match = _print_match_path($path, $pages);
if ($path != $_GET['q']) {
$page_match = $page_match || _print_match_path($_GET['q'], $pages);
}
return !($visibility xor $page_match);
}
else {
return !$visibility;
}
}