You are here

function theme_signup_admin_form in Signup 6.2

Same name and namespace in other branches
  1. 5.2 signup.module \theme_signup_admin_form()
  2. 6 theme/admin.inc \theme_signup_admin_form()

File

theme/admin.inc, line 36
Theme functions for signup administration.

Code

function theme_signup_admin_form($form) {
  if (!isset($form['nids'])) {
    $type = $_SESSION['signup_status_filter'];
    switch ($type) {
      case 'open':
        $filter = t('open');
        break;
      case 'closed':
        $filter = t('closed');
        break;
      default:
        $filter = t('enabled');
        break;
    }
    return t('No content is currently !status for signups.', array(
      '!status' => $filter,
    ));
  }
  foreach ($form['nids'] as $nid => $node_form) {
    if (!is_numeric($nid)) {
      continue;
    }
    $row = array();
    if (isset($node_form['start'])) {
      $row[] = drupal_render($form['nids'][$nid]['start']);
    }
    $row[] = drupal_render($form['nids'][$nid]['title']);
    $row[] = drupal_render($form['nids'][$nid]['total']);
    $row[] = drupal_render($form['nids'][$nid]['limit']);
    $row[] = drupal_render($form['nids'][$nid]['status']);
    $row[] = drupal_render($form['nids'][$nid]['operations']);
    $rows[] = $row;
  }
  $header = $form['header']['#value'];
  unset($form['header']);
  $output = theme('table', $header, $rows, array(
    'style' => 'width:100%',
  ));
  $output .= drupal_render($form);
  $pager = theme('pager', NULL, 25, 0);
  if (!empty($pager)) {
    $output .= $pager;
  }
  return $output;
}