Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
c11c1c28
Commit
c11c1c28
authored
Jul 19, 2006
by
Neil Drumm
Browse files
#73605
by RobRoy, make hook_link() implementations consistent with documentation.
parent
751a6979
Changes
6
Hide whitespace changes
Inline
Side-by-side
modules/blog/blog.module
View file @
c11c1c28
...
...
@@ -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'
)
{
...
...
modules/book/book.module
View file @
c11c1c28
...
...
@@ -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'
),
...
...
modules/comment/comment.module
View file @
c11c1c28
...
...
@@ -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
;
...
...
modules/node/node.module
View file @
c11c1c28
...
...
@@ -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
"
,
...
...
modules/statistics/statistics.module
View file @
c11c1c28
...
...
@@ -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
();
...
...
modules/upload/upload.module
View file @
c11c1c28
...
...
@@ -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
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment