MARK_NEW)); $options['fragment'] = 'new'; } $field['data'] = l($thread['subject'], 'messages/view/' . $thread['thread_id'], $options) . $is_new; $field['class'][] = 'privatemsg-list-subject'; return $field; } /** * Theme the replies field. * * @see theme_privatemsg_list_field() */ function theme_privatemsg_list_field__count($variables) { $thread = $variables['thread']; $field = array(); $field['data'] = $thread['count']; $options = array(); if (!empty($thread['is_new']) && $thread['is_new'] < $thread['count']) { $options['fragment'] = 'new'; $field['data'] .= '
' . l((format_plural($thread['is_new'], '(1 new)', '(@count new)')),'messages/view/' . $thread['thread_id'], $options); } $field['class'][] = 'privatemsg-list-count'; return $field; } /** * Theme the last updated column. * * @see theme_privatemsg_list_field() */ function theme_privatemsg_list_field__last_updated($variables) { $thread = $variables['thread']; $field['data'] = format_date($thread['last_updated'], 'small'); $field['class'][] = 'privatemsg-list-date'; return $field; } /** * Theme the thread started column. * * @see theme_privatemsg_list_field() */ function theme_privatemsg_list_field__thread_started($variables) { $thread = $variables['thread']; $field = array(); $field['data'] = format_date($thread['thread_started'], 'small'); $field['class'][] = 'privatemsg-list-date-started'; return $field; } /** * Define the table header for a specific column. * * This default theme function is used to ignore columns that should not be * displayed. Only columns with a specific theme pattern function are displayed. * * @return * A theme_table() compatible table header definition. Additionally, the key * "key" should be used to specify which row column should be displayed in * this column. */ function theme_privatemsg_list_header() { } /** * Define the subject header. * * @see theme_privatemsg_list_header() */ function theme_privatemsg_list_header__subject() { return array( 'data' => t('Subject'), 'field' => 'subject', 'class' => array('privatemsg-header-subject'), '#weight' => -40, ); } /** * Define the answers column. * * @see theme_privatemsg_list_header() */ function theme_privatemsg_list_header__count() { return array( 'data' => t('Messages'), 'class' => array('privatemsg-header-count'), '#weight' => -25, ); } /** * Define the participants column. * * @see theme_privatemsg_list_header() */ function theme_privatemsg_list_header__participants() { return array( 'data' => t('Participants'), 'class' => array('privatemsg-header-participants'), '#weight' => -30, ); } /** * Define the last updated column. * * @see theme_privatemsg_list_header() */ function theme_privatemsg_list_header__last_updated() { return array( 'data' => t('Last Updated'), 'field' => 'last_updated', 'sort' => 'asc', 'class' => array('privatemsg-header-lastupdated'), '#weight' => -20, ); } /** * Define the thread started column. * * @see theme_privatemsg_list_header() */ function theme_privatemsg_list_header__thread_started() { return array( 'data' => t('Started'), 'field' => 'thread_started', 'class' => array('privatemsg-header-threadstarted'), '#weight' => -15, ); } /** * Theme a block which displays the number of new messages a user has. */ function theme_privatemsg_new_block($count) { $count = $count['count']; if ($count == 0) { $text = t('Click here to go to your messages.'); } else { $text = format_plural($count, 'You have a new message, click here to read it', 'You have @count new messages, click here to read them', array('@count' => $count)); } return l($text, 'messages', array('attributes' => array('id' => 'privatemsg-new-link'))); } /** * @} */