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
5049c3e1
Commit
5049c3e1
authored
Dec 28, 2004
by
Dries Buytaert
Browse files
- Reorganized the code a bit
parent
f4dfafe8
Changes
2
Hide whitespace changes
Inline
Side-by-side
modules/taxonomy.module
View file @
5049c3e1
...
...
@@ -906,42 +906,44 @@ function taxonomy_term_page($str_tids = '', $depth = 0, $op = 'page') {
while
(
$term
=
db_fetch_object
(
$result
))
{
$names
[]
=
$term
->
name
;
}
if
(
count
(
$names
)
==
0
)
{
drupal_not_found
();
return
;
}
drupal_set_title
(
$title
=
implode
(
', '
,
$names
));
switch
(
$op
)
{
case
'page'
:
// Build breadcrumb based on first hierarchy of first term:
$current
->
tid
=
$tids
[
0
];
$breadcrumbs
=
array
(
array
(
'path'
=>
$_GET
[
'q'
]));
while
(
$parents
=
taxonomy_get_parents
(
$current
->
tid
))
{
$current
=
array_shift
(
$parents
);
$breadcrumbs
[]
=
array
(
'path'
=>
'taxonomy/term/'
.
$current
->
tid
,
'title'
=>
$current
->
name
);
}
$breadcrumbs
=
array_reverse
(
$breadcrumbs
);
menu_set_location
(
$breadcrumbs
);
drupal_set_html_head
(
'<link 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
,
$operator
,
$depth
,
TRUE
));
$output
.
=
theme
(
'xml_icon'
,
url
(
"taxonomy/term/
$str_tids
/
$depth
/feed"
));
print
theme
(
'page'
,
$output
);
break
;
case
'feed'
:
$term
=
taxonomy_get_term
(
$tids
[
0
]);
$channel
[
'link'
]
=
url
(
'taxonomy/term/'
.
$str_tids
.
'/'
.
$depth
,
NULL
,
NULL
,
TRUE
);
$channel
[
'title'
]
=
variable_get
(
'site_name'
,
'drupal'
)
.
' - '
.
$title
;
$channel
[
'description'
]
=
$term
->
description
;
$result
=
taxonomy_select_nodes
(
$tids
,
$operator
,
$depth
,
FALSE
);
node_feed
(
$result
,
$channel
);
break
;
default
:
drupal_not_found
();
if
(
$names
)
{
drupal_set_title
(
$title
=
implode
(
', '
,
$names
));
switch
(
$op
)
{
case
'page'
:
// Build breadcrumb based on first hierarchy of first term:
$current
->
tid
=
$tids
[
0
];
$breadcrumbs
=
array
(
array
(
'path'
=>
$_GET
[
'q'
]));
while
(
$parents
=
taxonomy_get_parents
(
$current
->
tid
))
{
$current
=
array_shift
(
$parents
);
$breadcrumbs
[]
=
array
(
'path'
=>
'taxonomy/term/'
.
$current
->
tid
,
'title'
=>
$current
->
name
);
}
$breadcrumbs
=
array_reverse
(
$breadcrumbs
);
menu_set_location
(
$breadcrumbs
);
drupal_set_html_head
(
'<link 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
,
$operator
,
$depth
,
TRUE
));
$output
.
=
theme
(
'xml_icon'
,
url
(
"taxonomy/term/
$str_tids
/
$depth
/feed"
));
print
theme
(
'page'
,
$output
);
break
;
case
'feed'
:
$term
=
taxonomy_get_term
(
$tids
[
0
]);
$channel
[
'link'
]
=
url
(
'taxonomy/term/'
.
$str_tids
.
'/'
.
$depth
,
NULL
,
NULL
,
TRUE
);
$channel
[
'title'
]
=
variable_get
(
'site_name'
,
'drupal'
)
.
' - '
.
$title
;
$channel
[
'description'
]
=
$term
->
description
;
$result
=
taxonomy_select_nodes
(
$tids
,
$operator
,
$depth
,
FALSE
);
node_feed
(
$result
,
$channel
);
break
;
default
:
drupal_not_found
();
}
}
else
{
drupal_not_found
();
}
}
}
...
...
modules/taxonomy/taxonomy.module
View file @
5049c3e1
...
...
@@ -906,42 +906,44 @@ function taxonomy_term_page($str_tids = '', $depth = 0, $op = 'page') {
while
(
$term
=
db_fetch_object
(
$result
))
{
$names
[]
=
$term
->
name
;
}
if
(
count
(
$names
)
==
0
)
{
drupal_not_found
();
return
;
}
drupal_set_title
(
$title
=
implode
(
', '
,
$names
));
switch
(
$op
)
{
case
'page'
:
// Build breadcrumb based on first hierarchy of first term:
$current
->
tid
=
$tids
[
0
];
$breadcrumbs
=
array
(
array
(
'path'
=>
$_GET
[
'q'
]));
while
(
$parents
=
taxonomy_get_parents
(
$current
->
tid
))
{
$current
=
array_shift
(
$parents
);
$breadcrumbs
[]
=
array
(
'path'
=>
'taxonomy/term/'
.
$current
->
tid
,
'title'
=>
$current
->
name
);
}
$breadcrumbs
=
array_reverse
(
$breadcrumbs
);
menu_set_location
(
$breadcrumbs
);
drupal_set_html_head
(
'<link 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
,
$operator
,
$depth
,
TRUE
));
$output
.
=
theme
(
'xml_icon'
,
url
(
"taxonomy/term/
$str_tids
/
$depth
/feed"
));
print
theme
(
'page'
,
$output
);
break
;
case
'feed'
:
$term
=
taxonomy_get_term
(
$tids
[
0
]);
$channel
[
'link'
]
=
url
(
'taxonomy/term/'
.
$str_tids
.
'/'
.
$depth
,
NULL
,
NULL
,
TRUE
);
$channel
[
'title'
]
=
variable_get
(
'site_name'
,
'drupal'
)
.
' - '
.
$title
;
$channel
[
'description'
]
=
$term
->
description
;
$result
=
taxonomy_select_nodes
(
$tids
,
$operator
,
$depth
,
FALSE
);
node_feed
(
$result
,
$channel
);
break
;
default
:
drupal_not_found
();
if
(
$names
)
{
drupal_set_title
(
$title
=
implode
(
', '
,
$names
));
switch
(
$op
)
{
case
'page'
:
// Build breadcrumb based on first hierarchy of first term:
$current
->
tid
=
$tids
[
0
];
$breadcrumbs
=
array
(
array
(
'path'
=>
$_GET
[
'q'
]));
while
(
$parents
=
taxonomy_get_parents
(
$current
->
tid
))
{
$current
=
array_shift
(
$parents
);
$breadcrumbs
[]
=
array
(
'path'
=>
'taxonomy/term/'
.
$current
->
tid
,
'title'
=>
$current
->
name
);
}
$breadcrumbs
=
array_reverse
(
$breadcrumbs
);
menu_set_location
(
$breadcrumbs
);
drupal_set_html_head
(
'<link 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
,
$operator
,
$depth
,
TRUE
));
$output
.
=
theme
(
'xml_icon'
,
url
(
"taxonomy/term/
$str_tids
/
$depth
/feed"
));
print
theme
(
'page'
,
$output
);
break
;
case
'feed'
:
$term
=
taxonomy_get_term
(
$tids
[
0
]);
$channel
[
'link'
]
=
url
(
'taxonomy/term/'
.
$str_tids
.
'/'
.
$depth
,
NULL
,
NULL
,
TRUE
);
$channel
[
'title'
]
=
variable_get
(
'site_name'
,
'drupal'
)
.
' - '
.
$title
;
$channel
[
'description'
]
=
$term
->
description
;
$result
=
taxonomy_select_nodes
(
$tids
,
$operator
,
$depth
,
FALSE
);
node_feed
(
$result
,
$channel
);
break
;
default
:
drupal_not_found
();
}
}
else
{
drupal_not_found
();
}
}
}
...
...
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