array( 'type' => 'signup', 'description' => t('Alter signup status'), 'configurable' => TRUE, ), ); } function signup_status_alter_action(&$signup, $context) { $status_labels = signup_status_labels(); $signup->status = $context['signup_status']; db_query("UPDATE {signup_log} SET status = %d WHERE sid = %d", $signup->status, $signup->sid); watchdog('action', 'Set status of %signup_label to %status_name.', array('%signup_label' => $signup->label, '%status_name' => $status_labels[$signup->status])); } function signup_status_alter_action_form($context) { // Obviously this should be from some signup_status function. $options = signup_status_labels(); $form['signup_status'] = array( '#type' => 'select', '#title' => t('Signup status'), '#options' => $options, ); return $form; } function signup_status_alter_action_validate($form, $form_state) { if (empty($form_state['values']['signup_status'])) { form_set_error('signup_status', t('You must select a status.')); } } function signup_status_alter_action_submit($form, $form_state) { return array('signup_status' => $form_state['values']['signup_status']); } /** * This should obviously be a function from signup_status that gets this from * the DB, not hard-coded... */ function signup_status_labels() { return array( '0' => t(''), '1' => t('Yes'), '2' => t('Maybe'), '3' => t('No'), ); }