diff options
Diffstat (limited to 'modules/taxonomy/taxonomy.module')
-rw-r--r-- | modules/taxonomy/taxonomy.module | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index 9a1228a37..50d2fd608 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -1,5 +1,4 @@ <?php -// $Id$ /** * @file @@ -683,8 +682,8 @@ function taxonomy_term_view($term, $view_mode = 'full', $langcode = NULL) { $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)); + field_attach_prepare_view('taxonomy_term', array($term->tid => $term), $view_mode, $langcode); + entity_prepare_view('taxonomy_term', array($term->tid => $term), $langcode); $build = array( '#theme' => 'taxonomy_term', @@ -695,12 +694,15 @@ function taxonomy_term_view($term, $view_mode = 'full', $langcode = NULL) { $build += field_attach_view('taxonomy_term', $term, $view_mode, $langcode); - $build['description'] = array( - '#markup' => check_markup($term->description, $term->format, '', TRUE), - '#weight' => 0, - '#prefix' => '<div class="taxonomy-term-description">', - '#suffix' => '</div>', - ); + // Add term description if the term has one. + if (!empty($term->description)) { + $build['description'] = array( + '#markup' => check_markup($term->description, $term->format, '', TRUE), + '#weight' => 0, + '#prefix' => '<div class="taxonomy-term-description">', + '#suffix' => '</div>', + ); + } $build['#attached']['css'][] = drupal_get_path('module', 'taxonomy') . '/taxonomy.css'; @@ -728,6 +730,7 @@ function template_preprocess_taxonomy_term(&$variables) { $variables = array_merge((array) $term, $variables); // Helpful $content variable for templates. + $variables['content'] = array(); foreach (element_children($variables['elements']) as $key) { $variables['content'][$key] = $variables['elements'][$key]; } @@ -747,7 +750,7 @@ function template_preprocess_taxonomy_term(&$variables) { } /** - * Returns whether the current page is the page of the passed in term. + * Returns whether the current page is the page of the passed-in term. * * @param $term * A term object. @@ -1313,7 +1316,7 @@ function taxonomy_field_validate($entity_type, $entity, $field, $instance, $lang if (!$validate) { $errors[$field['field_name']][$langcode][$delta][] = array( 'error' => 'taxonomy_term_reference_illegal_value', - 'message' => t('%name: illegal value.', array('%name' => t($instance['label']))), + 'message' => t('%name: illegal value.', array('%name' => $instance['label'])), ); } } @@ -1467,11 +1470,12 @@ function taxonomy_field_formatter_prepare_view($entity_type, $entities, $field, * * @param $term * A term object. + * * @return * The term name to be used as the page title. */ function taxonomy_term_title($term) { - return check_plain($term->name); + return $term->name; } /** |