Commit c11c1c28 authored by drumm's avatar drumm

#73605 by RobRoy, make hook_link() implementations consistent with documentation.

parent 751a6979
......@@ -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') {
......
......@@ -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'),
......
......@@ -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;
......
......@@ -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",
......
......@@ -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();
......
......@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment