diff options
author | Dries Buytaert <dries@buytaert.net> | 2008-12-16 22:05:51 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2008-12-16 22:05:51 +0000 |
commit | 18d22419f3da39ca4bf92f46d605a25957f311be (patch) | |
tree | d72732b1a23d479c4f2adc4d671d8ec901e2a187 /modules/system | |
parent | 9fe9144ae7804e3b80c0ffd8444b0448261f4436 (diff) | |
download | brdo-18d22419f3da39ca4bf92f46d605a25957f311be.tar.gz brdo-18d22419f3da39ca4bf92f46d605a25957f311be.tar.bz2 |
- Patch #339929 by Moshe et al: move node links into ->content.
Diffstat (limited to 'modules/system')
-rw-r--r-- | modules/system/system.api.php | 48 |
1 files changed, 8 insertions, 40 deletions
diff --git a/modules/system/system.api.php b/modules/system/system.api.php index faac9a174..5160fe19a 100644 --- a/modules/system/system.api.php +++ b/modules/system/system.api.php @@ -322,7 +322,7 @@ function hook_image_toolkits() { * Define internal Drupal links. * * This hook enables modules to add links to many parts of Drupal. Links - * may be added in nodes or in the navigation block, for example. + * may be added in the navigation block, for example. * * The returned array should be a keyed array of link entries. Each link can * be in one of two formats. @@ -345,11 +345,10 @@ function hook_image_toolkits() { * An identifier declaring what kind of link is being requested. * Possible values: * - comment: Links to be placed below a comment being viewed. - * - node: Links to be placed below a node being viewed. * @param $object - * A node object or a comment object according to the $type. + * A comment object. * @param $teaser - * In case of node link: a 0/1 flag depending on whether the node is + * A 0/1 flag depending on whether the node is * displayed with its teaser or its full form. * @return * An array of the requested links. @@ -358,48 +357,17 @@ function hook_image_toolkits() { function hook_link($type, $object, $teaser = FALSE) { $links = array(); - if ($type == 'node' && isset($object->parent)) { - if (!$teaser) { - if (book_access('create', $object)) { - $links['book_add_child'] = array( - 'title' => t('add child page'), - 'href' => "node/add/book/parent/$object->nid", - ); - } - if (user_access('see printer-friendly version')) { - $links['book_printer'] = array( - 'title' => t('printer-friendly version'), - 'href' => 'book/export/html/' . $object->nid, - 'attributes' => array('title' => t('Show a printer-friendly version of this book page and its sub-pages.')) - ); - } - } - } - - $links['sample_link'] = array( - 'title' => t('go somewhere'), - 'href' => 'node/add', - 'query' => 'foo=bar', - 'fragment' => 'anchorname', - 'attributes' => array('title' => t('go to another page')), - ); - - // Example of a link that's not an anchor - if ($type == 'video') { - if (variable_get('video_playcounter', 1) && user_access('view play counter')) { - $links['play_counter'] = array( - 'title' => format_plural($object->play_counter, '1 play', '@count plays'), - ); - } + if ($type == 'comment') { + $links = comment_links($object, FALSE); + return $links; } return $links; } /** - * Perform alterations before links on a node are rendered. - * - * One popular use of this hook is to add/delete links from other modules. + * Perform alterations before links on a comment are rendered. One popular use of + * this hook is to add/delete links from other modules. * * @param $links * Nested array of links for the node keyed by providing module. |