summaryrefslogtreecommitdiff
path: root/modules/taxonomy
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-10-03 01:15:34 +0000
committerDries Buytaert <dries@buytaert.net>2010-10-03 01:15:34 +0000
commit8ec40cc27a72e3dec43d80432a3250af7c03aed3 (patch)
treefcc37f6506cc2e8c511399584a899c40c70e0772 /modules/taxonomy
parent69e9e3e3a2c2d52a149914565fa451ed967280e1 (diff)
downloadbrdo-8ec40cc27a72e3dec43d80432a3250af7c03aed3.tar.gz
brdo-8ec40cc27a72e3dec43d80432a3250af7c03aed3.tar.bz2
- Patch #922824 by plach: no way to specify the language to view entities in.
Diffstat (limited to 'modules/taxonomy')
-rw-r--r--modules/taxonomy/taxonomy.module12
1 files changed, 10 insertions, 2 deletions
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module
index d73196313..c214dca18 100644
--- a/modules/taxonomy/taxonomy.module
+++ b/modules/taxonomy/taxonomy.module
@@ -599,11 +599,18 @@ function taxonomy_term_delete($tid) {
* A term object.
* @param $view_mode
* View mode, e.g. 'full', 'teaser'...
+ * @param $langcode
+ * (optional) A language code to use for rendering. Defaults to the global
+ * content language of the current request.
*
* @return
* An array as expected by drupal_render().
*/
-function taxonomy_term_view($term, $view_mode = 'full') {
+function taxonomy_term_view($term, $view_mode = 'full', $langcode = NULL) {
+ if (!isset($langcode)) {
+ $langcode = $GLOBALS['language_content']->language;
+ }
+
field_attach_prepare_view('taxonomy_term', array($term->tid => $term), $view_mode);
entity_prepare_view('taxonomy_term', array($term->tid => $term));
@@ -611,9 +618,10 @@ function taxonomy_term_view($term, $view_mode = 'full') {
'#theme' => 'taxonomy_term',
'#term' => $term,
'#view_mode' => $view_mode,
+ '#language' => $langcode,
);
- $build += field_attach_view('taxonomy_term', $term, $view_mode);
+ $build += field_attach_view('taxonomy_term', $term, $view_mode, $langcode);
$build['description'] = array(
'#markup' => check_markup($term->description, $term->format, '', TRUE),