You are here

function theme_privatemsg_list_field__tags in Privatemsg 7

Same name and namespace in other branches
  1. 7.2 privatemsg_filter/privatemsg_filter.module \theme_privatemsg_list_field__tags()

Default theme pattern function to display tags.

See also

theme_privatemsg_list_field()

File

privatemsg_filter/privatemsg_filter.module, line 618
Allows users to tag private messages and to filter based upon those tags.

Code

function theme_privatemsg_list_field__tags($arguments) {
  $thread = $arguments['thread'];
  if (!empty($thread['tags'])) {
    $tags = array();
    foreach ($thread['tags'] as $tag) {
      $tags[] = l(drupal_strlen($tag) > 15 ? drupal_substr($tag, 0, 13) . '...' : $tag, 'messages', array(
        'attributes' => array(
          'title' => $tag,
        ),
        'query' => array(
          'tags' => $tag,
        ),
      ));
    }
    return array(
      'data' => implode(', ', $tags),
      'class' => array(
        'privatemsg-list-tags',
      ),
    );
  }

  // Return an empty row.
  return array(
    'data' => '',
  );
}