You are here

function _revisioning_title_for_tab in Revisioning 7

Same name and namespace in other branches
  1. 8 revisioning.module \_revisioning_title_for_tab()
  2. 6.4 revisioning.module \_revisioning_title_for_tab()
  3. 6.3 revisioning.module \_revisioning_title_for_tab()

Callback for the primary View, Edit and Revisions tabs titles.

Parameters

object $node: the node object

string $tab: 'view', 'edit' or 'revisions'

Return value

string translatable title string

1 string reference to '_revisioning_title_for_tab'
revisioning_menu_alter in ./revisioning.module
Implements hook_menu_alter().

File

./revisioning.module, line 1189
Allows content to be updated and reviewed before submitting it for publication, while the current live revision remains unchanged and publicly visible until the changes have been reviewed and found fit for publication by a moderator.

Code

function _revisioning_title_for_tab($node, $tab) {
  if ($tab == 'revisions') {
    return is_numeric(arg(3)) ? t('Revision operations') : t('Revisions');
  }

  /*
  if (empty($node->revision_moderation) || $node->num_revisions <= 1) {
    return ($tab == 'edit' ? t('Edit') : t('View'));
  }
  if (_revisioning_load_op($node, $tab) == REVISIONING_LOAD_LATEST) {
    return ($tab == 'edit' ? t('Edit latest') : t('View latest'));
  }
  return ($tab == 'edit' ? t('Edit current') : t('View current'));
  */
  if (!empty($node->revision_moderation) && $node->num_revisions > 1) {
    if (_revisioning_load_op($node, $tab) == REVISIONING_LOAD_LATEST) {
      return $tab == 'edit' ? t('Edit latest') : t('View latest');
    }
    if (_revisioning_access_node_revision('view revisions', $node)) {
      return $tab == 'edit' ? t('Edit current') : t('View current');
    }
  }
  return $tab == 'edit' ? t('Edit') : t('View');
}