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
2d059380
Commit
2d059380
authored
Aug 23, 2006
by
Dries Buytaert
Browse files
- Patch
#66569
by m3avrck: Consolidate the drupal_add_link() calls.
parent
055844e7
Changes
5
Hide whitespace changes
Inline
Side-by-side
includes/common.inc
View file @
2d059380
...
...
@@ -153,14 +153,19 @@ function drupal_get_headers() {
*
* @param $url
* The url for the feed
* @param $t
heme_function
* The
name of the theming function to use to style the feed icon, defaults to
the
me_
feed
_icon()
* @param $t
itle
* The
title of
the
feed
*/
function
drupal_add_feed
(
$url
=
NULL
,
$t
heme_function
=
'feed_icon
'
)
{
function
drupal_add_feed
(
$url
=
NULL
,
$t
itle
=
'
'
)
{
static
$stored_feed_links
=
array
();
if
(
!
is_null
(
$url
))
{
$stored_feed_links
[
$url
]
=
theme
(
$theme_function
,
$url
);
$stored_feed_links
[
$url
]
=
theme
(
'feed_icon'
,
$url
);
drupal_add_link
(
array
(
'rel'
=>
'alternate'
,
'type'
=>
'application/rss+xml'
,
'title'
=>
$title
,
'href'
=>
$url
));
}
return
$stored_feed_links
;
}
...
...
modules/blog/blog.module
View file @
2d059380
...
...
@@ -163,12 +163,8 @@ function blog_page_user($uid) {
$output
.
=
node_view
(
node_load
(
$node
->
nid
),
1
);
}
$output
.
=
theme
(
'pager'
,
NULL
,
variable_get
(
'default_nodes_main'
,
10
));
drupal_add_feed
(
url
(
'blog/'
.
$account
->
uid
.
'/feed'
));
drupal_add_feed
(
url
(
'blog/'
.
$account
->
uid
.
'/feed'
)
,
t
(
'RSS - !title'
,
array
(
'!title'
=>
$title
)
);
drupal_add_link
(
array
(
'rel'
=>
'alternate'
,
'type'
=>
'application/rss+xml'
,
'title'
=>
t
(
'RSS - !title'
,
array
(
'!title'
=>
$title
)),
'href'
=>
url
(
"blog/
$account->uid
/feed"
)));
return
$output
;
}
else
{
...
...
@@ -190,12 +186,8 @@ function blog_page_last() {
$output
.
=
node_view
(
node_load
(
$node
->
nid
),
1
);
}
$output
.
=
theme
(
'pager'
,
NULL
,
variable_get
(
'default_nodes_main'
,
10
));
drupal_add_feed
(
url
(
'blog/feed'
));
drupal_add_feed
(
url
(
'blog/feed'
)
,
t
(
'RSS - blogs'
)
);
drupal_add_link
(
array
(
'rel'
=>
'alternate'
,
'type'
=>
'application/rss+xml'
,
'title'
=>
t
(
'RSS - blogs'
),
'href'
=>
url
(
"blog/feed"
)));
return
$output
;
}
...
...
modules/forum/forum.module
View file @
2d059380
...
...
@@ -930,13 +930,8 @@ function theme_forum_display($forums, $topics, $parents, $tid, $sortby, $forum_p
$output
.
=
theme
(
'forum_list'
,
$forums
,
$parents
,
$tid
);
if
(
$tid
&&
!
in_array
(
$tid
,
variable_get
(
'forum_containers'
,
array
())))
{
drupal_add_link
(
array
(
'rel'
=>
'alternate'
,
'type'
=>
'application/rss+xml'
,
'title'
=>
'RSS - '
.
$title
,
'href'
=>
url
(
'taxonomy/term/'
.
$tid
.
'/0/feed'
)));
$output
.
=
theme
(
'forum_topic_list'
,
$tid
,
$topics
,
$sortby
,
$forum_per_page
);
drupal_add_feed
(
url
(
'taxonomy/term/'
.
$tid
.
'/0/feed'
));
drupal_add_feed
(
url
(
'taxonomy/term/'
.
$tid
.
'/0/feed'
)
,
'RSS - '
.
$title
);
}
$output
.
=
'</div>'
;
}
...
...
modules/node/node.module
View file @
2d059380
...
...
@@ -2257,11 +2257,7 @@ function node_page_default() {
if
(
db_num_rows
(
$result
))
{
$feed_url
=
url
(
'rss.xml'
,
NULL
,
NULL
,
TRUE
);
drupal_add_feed
(
$feed_url
);
drupal_add_link
(
array
(
'rel'
=>
'alternate'
,
'type'
=>
'application/rss+xml'
,
'title'
=>
t
(
'RSS'
),
'href'
=>
$feed_url
));
drupal_add_feed
(
$feed_url
,
t
(
'RSS'
));
$output
=
''
;
while
(
$node
=
db_fetch_object
(
$result
))
{
...
...
modules/taxonomy/taxonomy.module
View file @
2d059380
...
...
@@ -1251,13 +1251,8 @@ function taxonomy_term_page($str_tids = '', $depth = 0, $op = 'page') {
$breadcrumbs
=
array_reverse
(
$breadcrumbs
);
menu_set_location
(
$breadcrumbs
);
drupal_add_link
(
array
(
'rel'
=>
'alternate'
,
'type'
=>
'application/rss+xml'
,
'title'
=>
'RSS - '
.
$title
,
'href'
=>
url
(
'taxonomy/term/'
.
$str_tids
.
'/'
.
$depth
.
'/feed'
)));
$output
=
taxonomy_render_nodes
(
taxonomy_select_nodes
(
$tids
,
$terms
[
'operator'
],
$depth
,
TRUE
));
drupal_add_feed
(
url
(
'taxonomy/term/'
.
$str_tids
.
'/'
.
$depth
.
'/feed'
));
drupal_add_feed
(
url
(
'taxonomy/term/'
.
$str_tids
.
'/'
.
$depth
.
'/feed'
)
,
'RSS - '
.
$title
);
return
$output
;
break
;
...
...
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