diff options
author | Dries Buytaert <dries@buytaert.net> | 2006-05-18 14:58:57 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2006-05-18 14:58:57 +0000 |
commit | 1b291a2917a1c18194c54fce8bf0fd895db98019 (patch) | |
tree | a46473123aeb5709f8cc6f07e685fc84df90bf06 /modules/node/node.module | |
parent | be7bb9be9bb41c83795fa8d7fa119ce4025f2de0 (diff) | |
download | brdo-1b291a2917a1c18194c54fce8bf0fd895db98019.tar.gz brdo-1b291a2917a1c18194c54fce8bf0fd895db98019.tar.bz2 |
- Patch #18260 by Ber, m3averck et al: allow overriding of links returned by modules
Diffstat (limited to 'modules/node/node.module')
-rw-r--r-- | modules/node/node.module | 11 |
1 files changed, 10 insertions, 1 deletions
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.')) + ); } } |