You are here

function taxonomy_revision_show in Taxonomy revision 7

Generate an array which displays a taxonomy term detail page.

Parameters

$term: A taxonomy term object.

$message: A flag which sets a page title relevant to the revision being viewed.

Return value

A $page element suitable for use by drupal_render().

1 string reference to 'taxonomy_revision_show'
taxonomy_revision_menu in ./taxonomy_revision.module
Implements hook_menu().

File

./taxonomy_revision.module, line 407
This is the main module file for the Taxonomy revision module.

Code

function taxonomy_revision_show($term, $message = FALSE) {
  if ($message) {
    drupal_set_title(t('Revision of %name from %date', array(
      '%name' => $term->name,
      '%date' => format_date($term->timestamp),
    )), PASS_THROUGH);
  }

  // Emulates non existing taxonomy_term_view_multiple().
  // See http://drupal.org/node/708730.
  // See node_show().
  $terms = array(
    $term->tid => $term,
  );
  $view_mode = 'full';
  field_attach_prepare_view('taxonomy_term', $terms, $view_mode);
  entity_prepare_view('taxonomy_term', $terms);
  $build = array();
  $weight = 0;
  foreach ($terms as $term) {
    $build['terms'][$term->tid] = taxonomy_term_view($term, $view_mode);
    $build['terms'][$term->tid]['#weight'] = $weight;
    $weight++;
  }
  $build['terms']['#sorted'] = TRUE;
  return $build;
}