You are here

function theme_update_status_settings in Update Status 5

Same name and namespace in other branches
  1. 5.2 update_status.module \theme_update_status_settings()

File

./update_status.module, line 162

Code

function theme_update_status_settings($form) {
  if (isset($form['error'])) {
    return drupal_render($form);
  }
  $header = array(
    array(
      'data' => t('Project'),
      'class' => 'project',
    ),
    array(
      'data' => t('Warn if out of date'),
      'class' => 'status',
    ),
    array(
      'data' => t('Notes'),
      'class' => 'current-version',
    ),
  );
  $data = $form['data']['#value'];
  $info = $form['info']['#value'];
  $rows = array();
  foreach ($data as $key => $project) {
    if (array_key_exists($key, $info)) {

      // The name is returned in human-readable format. Change it to title
      // so it's not overwritten by the name key returned by update_status_get_projects().
      $row = array();
      $row['data'][] = array(
        'class' => 'project',
        'data' => check_plain($info[$key]['name']),
      );
      $row['data'][] = drupal_render($form['projects'][$key]['check']);
      $row['data'][] = drupal_render($form['projects'][$key]['notes']);
      $rows[] = $row;
    }
  }
  return theme('table', $header, $rows) . drupal_render($form);
}