ds.revision.inc 813 B

12345678910111213141516171819202122232425
  1. <?php
  2. /**
  3. * @file
  4. * Display Suite revision callback.
  5. */
  6. /**
  7. * Menu callback: show an individual revision node using the revision view mode.
  8. */
  9. function ds_revision_node_show($node, $message = NULL) {
  10. drupal_set_title(t('Revision of %title from %date', array('%title' => $node->title, '%date' => format_date($node->revision_timestamp))), PASS_THROUGH);
  11. // Update the history table, stating that this user viewed this node.
  12. node_tag_new($node);
  13. // Determine view mode.
  14. $layout = ds_get_layout('node', $node->type, 'revision', FALSE);
  15. $view_mode = ($layout) ? 'revision' : 'full';
  16. drupal_static('ds_view_mode', $view_mode);
  17. // For markup consistency with other pages, use node_view_multiple() rather than node_view().
  18. return node_view_multiple(array($node->nid => $node), $view_mode);
  19. }