You are here

function _revisioning_node_info_msg in Revisioning 8

Same name and namespace in other branches
  1. 6.4 revisioning_api.inc \_revisioning_node_info_msg()
  2. 6.3 revisioning_api.inc \_revisioning_node_info_msg()
  3. 7 revisioning_api.inc \_revisioning_node_info_msg()

Return a string with details about the node that is about to be displayed.

Parameters

object $node: The node that is about to be viewed

Return value

string A translatable message containing details about the node

File

./revisioning_api.inc, line 699
API functions of Revisioning module

Code

function _revisioning_node_info_msg($node) {

  // Get username for the revision, not the creator of the node.
  $revision_author = user_load($node->revision_uid);
  $placeholder_data = array(
    '@content_type' => $node->type,
    '%title' => $node->title,
    '!author' => theme('username', array(
      'account' => $revision_author,
    )),
    '@date' => format_date($node->revision_timestamp, 'short'),
  );
  $revision_type = _revisioning_revision_is($node);
  switch ($revision_type) {
    case REVISION_PENDING:
      return t('Displaying <em>pending</em> revision of @content_type %title, last modified by !author on @date', $placeholder_data);
    case REVISION_CURRENT:
      return t('Displaying <em>current, published</em> revision of @content_type %title, last modified by !author on @date', $placeholder_data);
    case REVISION_ARCHIVED:
      return t('Displaying <em>archived</em> revision of @content_type %title, last modified by !author on @date', $placeholder_data);
  }
}