You are here

function phptemplate_privatemsg_list_field__tags in Privatemsg 6.2

Same name and namespace in other branches
  1. 6 privatemsg_filter/privatemsg_filter.module \phptemplate_privatemsg_list_field__tags()

Default theme pattern function to display tags.

See also

theme_privatemsg_list_field()

File

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

Code

function phptemplate_privatemsg_list_field__tags($thread) {
  if (!empty($thread['tags'])) {
    $tags = array();
    foreach ($thread['tags'] as $tag_id => $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' => 'privatemsg-list-tags',
    );
  }
}