You are here

function theme_signup_node_admin_details_form in Signup 7

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

@todo Please document this function.

See also

http://drupal.org/node/1354

File

theme/node.admin.inc, line 87
Theme functions for the signup node administration page (node/N/signups).

Code

function theme_signup_node_admin_details_form($variables) {
  $form = $variables['form'];
  $fieldset = array(
    '#title' => t('Signup details'),
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
    '#attributes' => array(),
    '#children' => '',
  );
  if (!empty($form['users']['#options'])) {
    $header = $form['#header'];
    $rows = array();
    foreach ($form['users']['#options'] as $key => $value) {
      $rows[] = array(
        'cancel_checkbox' => drupal_render($form['users'][$key]),
        'username' => drupal_render($form['username'][$key]),
        'signup_date' => drupal_render($form['signup_date'][$key]),
        'signup_form_data' => drupal_render($form['signup_form_data'][$key]),
        'attended' => drupal_render($form['attended'][$key]),
      );
    }
    $fieldset['#value'] = '<div class="container-inline">';
    $fieldset['#value'] .= drupal_render($form['operation']);
    $fieldset['#value'] .= drupal_render($form['submit']);
    $fieldset['#value'] .= '</div>';
    $fieldset['#value'] .= theme('table', array(
      'header' => $header,
      'rows' => $rows,
    ));
  }
  else {
    $fieldset['#value'] = '<span>' . drupal_render($form['no_users']) . '</span>';
  }
  return theme('fieldset', array(
    'element' => $fieldset,
  )) . drupal_render_children($form);
}