function _print_friendly_urls in Printer, email and PDF versions 6
Same name and namespace in other branches
- 5.4 print.pages.inc \_print_friendly_urls()
- 5.3 print.pages.inc \_print_friendly_urls()
- 7.2 print.pages.inc \_print_friendly_urls()
- 7 print.pages.inc \_print_friendly_urls()
- 5.x print.pages.inc \_print_friendly_urls()
Auxiliary function to store the Printer-friendly URLs list as static.
Parameters
$url: absolute URL to be inserted in the list
Return value
list of URLs previously stored if $url is 0, or the current count otherwise.
3 calls to _print_friendly_urls()
- PrintBasicTest::testPrintRewriteUrls in tests/
print_basic.test - _print_rewrite_urls in ./
print.pages.inc - Callback function for the preg_replace_callback for URL-capable patterns
- _print_var_generator in ./
print.pages.inc - Post-processor that fills the array for the template with common details
File
- ./
print.pages.inc, line 424
Code
function _print_friendly_urls($url = 0) {
static $urls = array();
if ($url !== 0) {
$url_idx = array_search($url, $urls);
if ($url_idx !== FALSE) {
return $url_idx + 1;
}
else {
$urls[] = $url;
return count($urls);
}
}
$ret = $urls;
$urls = array();
return $ret;
}