function commons_origins_preprocess_privatemsg_view in Drupal Commons 7.3
Implements hook_preprocess_privatemsg_view().
File
- themes/
commons/ commons_origins/ template.php, line 189 - Process theme data.
Code
function commons_origins_preprocess_privatemsg_view(&$variables, $hook) {
// Make the template conform with Drupal standard attributes.
if (isset($variables['message_classes'])) {
$variables['classes_array'] = array_merge($variables['classes_array'], $variables['message_classes']);
}
$variables['classes_array'][] = 'clearfix';
$variables['attributes_array']['id'] = 'privatemsg-mid-' . $variables['mid'];
$variables['content_attributes_array']['class'][] = 'privatemsg-message-content';
// Add a distinct class to the "Delete" action.
if (isset($variables['message_links']['#links'])) {
foreach ($variables['message_links']['#links'] as &$link) {
// Due to the lack of a proper key-baed identifier, a string search is the
// only flexible way to sniff out the link.
if (strpos($link['href'], 'delete')) {
$link['attributes']['class'][] = 'message-delete';
}
}
}
}