You are here

function node_registration_node_settings_status_submit in Node registration 7

Submit handler for node_registration_registrations_settings_form().

Toggles registration status for a node/event.

1 string reference to 'node_registration_node_settings_status_submit'
node_registration_registrations_settings_form in includes/node_registration.forms.inc
Return a form for a node's registration settings.

File

includes/node_registration.forms.inc, line 1432
New registration forms. Public and admin.

Code

function node_registration_node_settings_status_submit($form, &$form_state) {
  $node = $form['#node'];
  $settings = $node->registration;

  // Update these values.
  $update = array(
    // Toggle status.
    'status' => $settings
      ->enabled() ? 0 : 1,
  );
  $settings
    ->update($update);
}