From 1b291a2917a1c18194c54fce8bf0fd895db98019 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Thu, 18 May 2006 14:58:57 +0000 Subject: - Patch #18260 by Ber, m3averck et al: allow overriding of links returned by modules --- modules/node/node.module | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'modules/node/node.module') diff --git a/modules/node/node.module b/modules/node/node.module index fb8bd7035..3eb21d638 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -536,6 +536,11 @@ function node_view($node, $teaser = FALSE, $page = FALSE, $links = TRUE) { node_invoke_nodeapi($node, 'view', $teaser, $page); if ($links) { $node->links = module_invoke_all('link', 'node', $node, !$page); + + foreach (module_implements('link_alter') AS $module) { + $function = $module .'_link_alter'; + $function($node, $node->links); + } } // unset unused $node part so that a bad theme can not open a security hole if ($teaser) { @@ -810,7 +815,11 @@ function node_link($type, $node = 0, $main = 0) { } if ($main == 1 && $node->teaser && $node->readmore) { - $links[] = l(t('read more'), "node/$node->nid", array('title' => t('Read the rest of this posting.'), 'class' => 'read-more')); + $links['node_read_more'] = array( + '#title' => t('read more'), + '#href' => "node/$node->nid", + '#attributes' => array('title' => t('Read the rest of this posting.')) + ); } } -- cgit v1.2.3