You are here

function theme_privatemsg_contacts_table in Privatemsg 5.3

Same name and namespace in other branches
  1. 5 privatemsg.module \theme_privatemsg_contacts_table()
1 theme call to theme_privatemsg_contacts_table()
privatemsg_contacts_form in ./privatemsg.module
Display a user's contacts list and let them write a PM to multiple contacts.

File

./privatemsg.module, line 2277

Code

function theme_privatemsg_contacts_table($form) {
  $rows = array();
  foreach (element_children($form) as $key) {
    $rows[] = array(
      drupal_render($form[$key]['selected']),
      $form[$key]['contact']['#value'],
      $form[$key]['operations']['#value'],
    );
  }
  if (count($rows) == 0) {
    $rows[] = array(
      array(
        'data' => t('No contacts.'),
        'colspan' => 3,
      ),
    );
    $select_cell = NULL;
  }
  else {
    $select_cell = theme('table_select_header_cell');
  }
  $header = array(
    $select_cell,
    t('Contact'),
    t('Operations'),
  );
  return theme('table', $header, $rows, array(
    'class' => 'pm-contacts-table',
  ));
}