You are here

function theme_user_rev_diff_inline_metadata in User Revision 7.2

Same name in this branch
  1. 7.2 diff/user_rev_diff.api.php \theme_user_rev_diff_inline_metadata()
  2. 7.2 diff/user_rev_diff.theme.inc \theme_user_rev_diff_inline_metadata()

Display inline diff metadata.

1 theme call to theme_user_rev_diff_inline_metadata()
user_rev_diff_inline_show in diff/user_rev_diff.pages.inc
Show the inline diff of a given user object v. the user with $old_vid. If $old_vid = 0 returns the normally rendered content of the user object. If metadata is TRUE a header will be added with a legend explaining the color code. This function returns…

File

diff/user_rev_diff.theme.inc, line 11
Themeable function callbacks for user_rev_diff.module.

Code

function theme_user_rev_diff_inline_metadata($vars) {
  drupal_add_css(drupal_get_path('module', 'diff') . '/diff.css');
  $user = $vars['user'];
  $output = "<div class='diff-inline-metadata clear-block'>";
  $output .= "<div class='diff-inline-byline'>";
  $output .= t('Updated by !name on @date', array(
    '!name' => theme('username', array(
      'account' => $user,
    )),
    '@date' => format_date($user->revision_timestamp, 'small'),
  ));
  $output .= "</div>";
  $output .= "<div class='diff-inline-legend clear-block'>";
  $output .= "<label>" . t('Legend') . "</label>";
  $output .= theme('diff_inline_chunk', array(
    'text' => t('Added'),
    'type' => 'add',
  ));
  $output .= theme('diff_inline_chunk', array(
    'text' => t('Changed'),
    'type' => 'change',
  ));
  $output .= theme('diff_inline_chunk', array(
    'text' => t('Deleted'),
    'type' => 'relete',
  ));
  $output .= "</div>";
  $output .= "</div>";
  return $output;
}