function theme_profile2_diff_inline_metadata in Profile 2 7.2
Display inline diff metadata.
1 theme call to theme_profile2_diff_inline_metadata()
- profile2_diff_inline_show in contrib/
profile2_diff.pages.inc - Show the inline diff of a given profile object v. the profile with $old_vid. If $old_vid = 0 returns the normally rendered content of the profile object. If metadata is TRUE a header will be added with a legend explaining the color code. This function…
File
- contrib/
profile2_diff.theme.inc, line 11 - Themeable function callbacks for profile2_diff.module.
Code
function theme_profile2_diff_inline_metadata($vars) {
drupal_add_css(drupal_get_path('module', 'diff') . '/diff.css');
$profile = $vars['profile'];
$user = user_load($profile->authorid);
$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($profile->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;
}