Commit 89f2dc0a authored by jcnventura's avatar jcnventura

Issue #1643376: fix missing content corner links when using numerical path aliases.

parent 587142d0
......@@ -278,7 +278,7 @@ function _print_get_title($path) {
*/
function print_insert_link($path = NULL, $node = NULL) {
if (function_exists('print_ui_insert_link')) {
return print_ui_insert_link(print_print_link(), $path, $node);
return print_ui_insert_link(print_print_link(), array('path' => $path, 'node' => $node));
}
else {
return FALSE;
......
......@@ -168,7 +168,7 @@ function print_epub_node_delete($node) {
*/
function print_epub_insert_link($path = NULL, $node = NULL) {
if (function_exists('print_ui_insert_link')) {
return print_ui_insert_link(print_epub_print_link(), $path, $node);
return print_ui_insert_link(print_epub_print_link(), array('path' => $path, 'node' => $node));
}
else {
return FALSE;
......
......@@ -298,7 +298,7 @@ function _print_mail_access($permission) {
*/
function print_mail_insert_link($path = NULL, $node = NULL) {
if (function_exists('print_ui_insert_link')) {
return print_ui_insert_link(print_mail_print_link(), $path, $node);
return print_ui_insert_link(print_mail_print_link(), array('path' => $path, 'node' => $node));
}
else {
return FALSE;
......
......@@ -255,7 +255,7 @@ function print_pdf_node_delete($node) {
*/
function print_pdf_insert_link($path = NULL, $node = NULL) {
if (function_exists('print_ui_insert_link')) {
return print_ui_insert_link(print_pdf_print_link(), $path, $node);
return print_ui_insert_link(print_pdf_print_link(), array('path' => $path, 'node' => $node));
}
else {
return FALSE;
......
......@@ -109,7 +109,7 @@ function print_ui_block_view($delta = '') {
$link_pos = variable_get('print_' . $link['format'] . '_link_pos', array(PRINT_UI_LINK_POS_DEFAULT => PRINT_UI_LINK_POS_DEFAULT));
if (!(empty($link_pos['block']))) {
$links = print_ui_insert_link($link, NULL, $node);
$links = print_ui_insert_link($link, array('node' => $node));
if (!empty($links)) {
$block['content'] .= $links;
}
......@@ -260,7 +260,7 @@ function print_ui_node_view($node, $view_mode) {
}
if (!empty($link_pos['corner'])) {
$corner_markup .= print_ui_insert_link($link, $path);
$corner_markup .= print_ui_insert_link($link, array('node' => $node, 'path' => $path));
}
}
}
......@@ -532,20 +532,25 @@ function theme_print_ui_format_link($vars) {
*
* @param array $link
* array returned by the hook_print_link() call.
* @param string $path
* (optional) path of the original. If not specified, the current URL is
* used.
* @param object $node
* (optional) node object, to be used in defining the path. If used, the
* path argument is irrelevant
* @param array $args
* Array with either:
* - node: (optional) node object, to be used in checking node access. If
* the path argument is not provided, the path used will be node/nid.
* - path: (optional) path of the link to be inserted. If not specified, the
* current URL is used.
*
* @return string
* string with the HTML link to the printer-friendly page
*/
function print_ui_insert_link($link, $path = NULL, $node = NULL) {
function print_ui_insert_link($link, $args = array()) {
$node = isset($args['node']) ? $args['node'] : NULL;
$path = isset($args['path']) ? $args['path'] : NULL;
if ($node !== NULL) {
$nid = $node->nid;
$path = 'node/' . $nid;
if ($path === NULL) {
$path = 'node/' . $nid;
}
$allowed_type = print_ui_link_allowed($link, array('node' => $node));
}
else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment