Index: signup_status.admin.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/signup_status/signup_status.admin.inc,v retrieving revision 1.5 diff -u -p -r1.5 signup_status.admin.inc --- signup_status.admin.inc 20 Sep 2009 01:29:06 -0000 1.5 +++ signup_status.admin.inc 20 Sep 2009 08:47:28 -0000 @@ -12,38 +12,39 @@ function theme_signup_status_admin_settings_form($form) { drupal_add_tabledrag('signup-status-admin-settings-table', 'order', 'self', 'signup-status-weight'); $header = array( - array('data' => t('Name')), - array('data' => t('Weight')), + array('data' => t('Name !required', array('!required' => '*'))), array('data' => t('Description')), - array('data' => t('Modifies signup count')), + array('data' => t('Modify signup count')), array('data' => t('Show on form')), + array('data' => t('Weight')), array('data' => t('Operations')) ); foreach (element_children($form['status']) as $key) { + $row = array(); + foreach (array('name', 'description', 'mod_signup_count', 'show_on_form', 'weight', 'delete') as $element) { + // Since we're rendering these in a table, remove any #title attributes. + if (!empty($form['status'][$key][$element]['#title'])) { + unset($form['status'][$key][$element]['#title']); + } + $row[] = drupal_render($form['status'][$key][$element]); + } $rows[] = array( 'class' => 'draggable', - 'data' => array( - drupal_render($form['status'][$key]['name']), - drupal_render($form['status'][$key]['weight']), - drupal_render($form['status'][$key]['description']), - drupal_render($form['status'][$key]['mod_signup_count']), - drupal_render($form['status'][$key]['show_on_form']), - drupal_render($form['status'][$key]['delete']), - ), + 'data' => $row, ); } $rows[] = array( 'class' => 'draggable', 'data' => array( drupal_render($form['status_add']['name']), - drupal_render($form['status_add']['weight']), drupal_render($form['status_add']['description']), drupal_render($form['status_add']['mod_signup_count']), drupal_render($form['status_add']['show_on_form']), + drupal_render($form['status_add']['weight']), NULL, ), ); - $output = '
' . theme('table', $header, $rows, array('id' => 'signup-status-admin-settings-table')) . '
'; + $output = theme('table', $header, $rows, array('id' => 'signup-status-admin-settings-table')); $output .= drupal_render($form); return $output; } @@ -65,6 +66,7 @@ function signup_status_admin_settings_fo if (!empty($signup_status_codes)) { foreach ($signup_status_codes as $cid => $status) { $form['status'][$cid]['name'] = array( + '#title' => t('Name'), '#type' => 'textfield', '#default_value' => $status['name'], '#maxlength' => 128, @@ -72,22 +74,26 @@ function signup_status_admin_settings_fo '#required' => TRUE, ); $form['status'][$cid]['weight'] = array( + '#title' => t('Weight'), '#type' => 'weight', '#default_value' => $status['weight'], '#delta' => 15, '#attributes' => array('class' => 'signup-status-weight'), ); $form['status'][$cid]['description'] = array( + '#title' => t('Description'), '#type' => 'textfield', '#default_value' => $status['description'], '#maxlength' => 128, '#size' => 30, ); $form['status'][$cid]['mod_signup_count'] = array( + '#title' => t('Modify signup count'), '#type' => 'checkbox', '#default_value' => $status['mod_signup_count'], ); $form['status'][$cid]['show_on_form'] = array( + '#title' => t('Show on form'), '#type' => 'checkbox', '#default_value' => $status['show_on_form'], ); @@ -123,6 +129,11 @@ function signup_status_admin_settings_fo '#type' => 'checkbox', ); + $form['help'] = array( + '#type' => 'item', + '#description' => t("This table defines the signup status options available on this site. If the 'Modify signup count' box is checked, signups in that status will be counted towards the signup limit (if any). Note that changing this value once signups exist will update those signups and potentially open or close signups on the affected event(s). If the 'Show on form' box is checked, users will have the option of selecting the status when they signup or edit an existing signup. The blank row at the bottom can be used to add a new status."), + ); + $form['submit'] = array( '#type' => 'submit', '#value' => t('Save configuration'), @@ -160,7 +171,7 @@ function signup_status_admin_settings_fo if (!empty($values['status_add']['description']) || !empty($values['status_add']['mod_signup_count']) || !empty($values['status_add']['show_on_form'])) { - form_set_error('status_add][name', t('A name is required for a new status.')); + form_set_error('status_add][name', t('Name is required for a new status.')); } } }