function theme_activity_username in Activity 7
Same name and namespace in other branches
- 5.4 activity.module \theme_activity_username()
- 5.3 activity.module \theme_activity_username()
- 6.2 activity.module \theme_activity_username()
- 6 activity.module \theme_activity_username()
Theme function to return username. This allows us to theme the username separately for activity feeds then the rest of the site.
1 theme call to theme_activity_username()
- activity_tokens in ./
activity.tokens.inc - Implements hook_tokens().
File
- ./
activity.module, line 757 - Records Activity across the site and surfaces that to Views.
Code
function theme_activity_username($variables) {
if (isset($variables['link_path'])) {
// We have a link path, so we should generate a link using l().
// Additional classes may be added as array elements like
// $variables['link_options']['attributes']['class'][] = 'myclass';
$output = l($variables['name'] . $variables['extra'], $variables['link_path'], $variables['link_options']);
}
else {
// Modules may have added important attributes so they must be included
// in the output. Additional classes may be added as array elements like
// $variables['attributes_array']['class'][] = 'myclass';
$output = '<span' . drupal_attributes($variables['attributes_array']) . '>' . $variables['name'] . $variables['extra'] . '</span>';
}
return $output;
}