From 0355caac417d92973f4913efbb19342ae352bf2e Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Sat, 8 Aug 2009 22:52:59 +0000 Subject: #537654 by catch: Tidy up comment links, and remove hook_link() in favour of hook_page_alter(). --- modules/system/system.api.php | 65 ------------------------------------------- 1 file changed, 65 deletions(-) (limited to 'modules/system/system.api.php') diff --git a/modules/system/system.api.php b/modules/system/system.api.php index 9c5435275..37d37ea15 100644 --- a/modules/system/system.api.php +++ b/modules/system/system.api.php @@ -511,71 +511,6 @@ 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 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. - * - * The first format will use the l() function to render the link: - * - attributes: Optional. See l() for usage. - * - fragment: Optional. See l() for usage. - * - href: Required. The URL of the link. - * - html: Optional. See l() for usage. - * - query: Optional. See l() for usage. - * - title: Required. The name of the link. - * - * The second format can be used for non-links. Leaving out the href index will - * select this format: - * - title: Required. The text or HTML code to display. - * - attributes: Optional. An associative array of HTML attributes to apply to the span tag. - * - html: Optional. If not set to true, check_plain() will be run on the title before it is displayed. - * - * @param $type - * An identifier declaring what kind of link is being requested. - * Possible values: - * - comment: Links to be placed below a comment being viewed. - * @param $object - * A comment object. - * @param $build_mode - * Build mode for the node, e.g. 'full', 'teaser'... - * @return - * An array of the requested links. - * - */ -function hook_link($type, $object, $build_mode) { - $links = array(); - - if ($type == 'comment') { - $links = comment_links($object, FALSE); - return $links; - } - - return $links; -} - -/** - * Perform alterations before links on a comment are rendered. One popular use of - * this hook is to modify/remove links from other modules. If you want to add a link - * to the links section of a node, use hook_link instead. - * - * @param $links - * Nested array of links for the node keyed by providing module. - * @param $node - * A node object that contains the links. - */ -function hook_link_alter(array &$links, $node) { - foreach ($links as $module => $link) { - if (strpos($module, 'taxonomy_term') !== FALSE) { - // Link back to the forum and not the taxonomy term page - $links[$module]['href'] = str_replace('taxonomy/term', 'forum', $link['href']); - } - } -} - /** * Perform alterations profile items before they are rendered. You may omit/add/re-sort/re-categorize, etc. * -- cgit v1.2.3