function theme_print_sourceurl in Printer, email and PDF versions 7.2
Returns HTML for the source URL line of the print template.
Parameters
array $vars: An associative array containing:
- $url: the URL to the full node view.
- $node: the node object.
- $cid; comment ID of the comment to display.
Return value
string HTML text with the footer
Related topics
1 theme call to theme_print_sourceurl()
- print.tpl.php in ./
print.tpl.php - Default theme implementation to display a printer-friendly version page.
File
- ./
print.pages.inc, line 313
Code
function theme_print_sourceurl($vars) {
global $base_url;
$sourceurl_date = variable_get('print_sourceurl_date', PRINT_SOURCEURL_DATE_DEFAULT);
$url = is_int($vars['cid']) ? $vars['url'] . '#comment-' . $vars['cid'] : $vars['url'];
$output = '<strong>' . t('Source URL');
if ($sourceurl_date && isset($vars['node'])) {
$output .= ' (';
$date = format_date($vars['node']->changed, 'short');
$output .= empty($vars['node']->nid) ? t('retrieved on !date', array(
'!date' => $date,
)) : t('modified on !date', array(
'!date' => $date,
));
$output .= ')';
}
$new_url = explode($base_url, $url);
$output .= ':</strong>' . "<a href=" . $new_url[1] . ">" . $url . '</a>';
return $output;
}