You are here

function theme_heartbeat_messages_admin_overview in Heartbeat 7

Same name and namespace in other branches
  1. 6.4 heartbeat.admin.inc \theme_heartbeat_messages_admin_overview()

Theme the comment admin form.

Parameters

$form: An associative array containing the structure of the form.

File

modules/heartbeat_ui/heartbeat_ui.admin.inc, line 95

Code

function theme_heartbeat_messages_admin_overview($variables) {
  $form = $variables['form'];
  $output = drupal_render($form['options']);
  if (isset($form['message']) && is_array($form['message'])) {
    foreach (element_children($form['message']) as $key) {
      $row = array();
      $row[] = drupal_render($form['heartbeat-activity'][$key]);
      $row[] = drupal_render($form['message'][$key]);
      $row[] = drupal_render($form['username'][$key]);
      $row[] = drupal_render($form['language'][$key]);
      $row[] = drupal_render($form['timestamp'][$key]);
      $row[] = drupal_render($form['operations'][$key]);
      $rows[] = $row;
    }
  }
  else {
    $rows[] = array(
      array(
        'data' => t('No messages available.'),
        'colspan' => '5',
      ),
    );
  }
  $output .= theme('table', array(
    'header' => $form['header']['#value'],
    'rows' => $rows,
  ));
  if ($form['pager']['#value']) {
    $output .= drupal_render($form['pager']);
  }
  $output .= drupal_render($form);
  return $output;
}