t('Signup summary'), '#collapsible' => TRUE, '#collapsed' => FALSE, '#value' => theme('table', $header, array($row)), ); return theme('fieldset', $fieldset); } function theme_signup_node_admin_details_form($form) { $fieldset = array( '#title' => t('Signup details'), '#collapsible' => TRUE, '#collapsed' => FALSE, ); 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'] = '
'; $fieldset['#value'] .= drupal_render($form['operation']); $fieldset['#value'] .= drupal_render($form['submit']); $fieldset['#value'] .= '
'; $fieldset['#value'] .= theme('table', $header, $rows); } else { $fieldset['#value'] = ''. drupal_render($form['no_users']) .''; } return theme('fieldset', $fieldset) . drupal_render($form); } /** * Renders custom signup user data into a human-readable format. * * WARNING: This theme function is recursive (it calls itself for * nested data), so if you override it, be sure not to change the part * where it does "call_user_func(__FUNCTION__)". * * @param $data * Array of custom user signup data. * * @return * User data directly formatted in divs. * * @see theme_signup_user_form() */ function theme_signup_custom_data($data) { $output = ''; // All of the possible array key values should already be translated as // string literals in theme_signup_user_form() via the #title attributes, so // passing a variable to t() is actually safe here. However, to avoid // warnings when extracting strings, "hide" the call to t() by using a // variable to hold the function name. $tr = 't'; // Loop through each first level element. foreach ($data as $key => $value) { $output .= '
'; if (is_array($value)) { // Element is nested, render it recursively. // Instead of the overhead of theme(), just call ourself directly. $output .= call_user_func(__FUNCTION__, $value); } else { $output .= $tr($key) .': '. check_plain($value); } $output .= "
\n"; } return $output; } function theme_signup_attended_text($attended = NULL) { if ($attended === NULL) { return ''; } if ($attended == 0) { return t('Did not attend'); } else { return t('Attended'); } }