From c11c1c2800a91e1795ca75fb4206948015a976c3 Mon Sep 17 00:00:00 2001
From: Neil Drumm <drumm@3064.no-reply.drupal.org>
Date: Wed, 19 Jul 2006 07:15:35 +0000
Subject: [PATCH] #73605 by RobRoy, make hook_link() implementations consistent
 with documentation.

---
 modules/blog/blog.module             | 2 +-
 modules/book/book.module             | 4 ++--
 modules/comment/comment.module       | 6 +++---
 modules/node/node.module             | 4 ++--
 modules/statistics/statistics.module | 2 +-
 modules/upload/upload.module         | 4 ++--
 6 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/modules/blog/blog.module b/modules/blog/blog.module
index 13da3d34fa8b..a2a0ccbff6c8 100644
--- a/modules/blog/blog.module
+++ b/modules/blog/blog.module
@@ -244,7 +244,7 @@ function blog_view(&$node, $teaser = FALSE, $page = FALSE) {
 /**
  * Implementation of hook_link().
  */
-function blog_link($type, $node = 0, $main = 0) {
+function blog_link($type, $node = NULL, $teaser = FALSE) {
   $links = array();
 
   if ($type == 'node' && $node->type == 'blog') {
diff --git a/modules/book/book.module b/modules/book/book.module
index a5384acd4eca..c83209be2f2c 100644
--- a/modules/book/book.module
+++ b/modules/book/book.module
@@ -51,12 +51,12 @@ function book_access($op, $node) {
 /**
  * Implementation of hook_link().
  */
-function book_link($type, $node = 0, $main = 0) {
+function book_link($type, $node = NULL, $teaser = FALSE) {
 
   $links = array();
 
   if ($type == 'node' && isset($node->parent)) {
-    if (!$main) {
+    if (!$teaser) {
       if (book_access('create', $node)) {
         $links['book_add_child'] = array(
           'title' => t('add child page'),
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index 842a5fc10924..9002ceb9b8e4 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -183,12 +183,12 @@ function theme_comment_block() {
 /**
  * Implementation of hook_link().
  */
-function comment_link($type, $node = 0, $main = 0) {
+function comment_link($type, $node = NULL, $teaser = FALSE) {
   $links = array();
 
   if ($type == 'node' && $node->comment) {
 
-    if ($main) {
+    if ($teaser) {
       // Main page: display the number of comments that have been posted.
 
       if (user_access('access comments')) {
@@ -252,7 +252,7 @@ function comment_link($type, $node = 0, $main = 0) {
   }
 
   if ($type == 'comment') {
-    $links = comment_links($node, $main);
+    $links = comment_links($node, $teaser);
   }
 
   return $links;
diff --git a/modules/node/node.module b/modules/node/node.module
index d2fe1775a341..f47836660700 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -801,7 +801,7 @@ function node_comment_mode($nid) {
 /**
  * Implementation of hook_link().
  */
-function node_link($type, $node = 0, $main = 0) {
+function node_link($type, $node = NULL, $teaser = FALSE) {
   $links = array();
 
   if ($type == 'node') {
@@ -809,7 +809,7 @@ function node_link($type, $node = 0, $main = 0) {
       $links = $node->links;
     }
 
-    if ($main == 1 && $node->teaser && $node->readmore) {
+    if ($teaser == 1 && $node->teaser && $node->readmore) {
       $links['node_read_more'] = array(
         'title' => t('read more'),
         'href' => "node/$node->nid",
diff --git a/modules/statistics/statistics.module b/modules/statistics/statistics.module
index 256d9c06541c..c7150d2d66eb 100644
--- a/modules/statistics/statistics.module
+++ b/modules/statistics/statistics.module
@@ -92,7 +92,7 @@ function statistics_perm() {
 /**
  * Implementation of hook_link().
  */
-function statistics_link($type, $node = 0, $main = 0) {
+function statistics_link($type, $node = NULL, $teaser = FALSE) {
   global $id;
   $links = array();
 
diff --git a/modules/upload/upload.module b/modules/upload/upload.module
index c05562953dfa..a07ecbc26328 100644
--- a/modules/upload/upload.module
+++ b/modules/upload/upload.module
@@ -41,11 +41,11 @@ function upload_perm() {
 /**
  * Implementation of hook_link().
  */
-function upload_link($type, $node = 0, $main = 0) {
+function upload_link($type, $node = NULL, $teaser = FALSE) {
   $links = array();
 
   // Display a link with the number of attachments
-  if ($main && $type == 'node' && isset($node->files) && user_access('view uploaded files')) {
+  if ($teaser && $type == 'node' && isset($node->files) && user_access('view uploaded files')) {
     $num_files = 0;
     foreach ($node->files as $file) {
       if ($file->list) {
-- 
GitLab