You are here

function signup_node_admin_summary_form_submit in Signup 5.2

Same name and namespace in other branches
  1. 6.2 includes/node_admin_summary.inc \signup_node_admin_summary_form_submit()
  2. 6 includes/node_admin_summary.inc \signup_node_admin_summary_form_submit()
  3. 7 includes/node_admin_summary.inc \signup_node_admin_summary_form_submit()
1 call to signup_node_admin_summary_form_submit()
signup_admin_form_submit in ./signup.module

File

./signup.module, line 2151
The Signup module (http://drupal.org/project/signup) manages replies to nodes. In particular, it's good for event management. Signup supports sending reminder emails and automatically closing signups for nodes with a start time, via the Event…

Code

function signup_node_admin_summary_form_submit($form_id, $form_values) {
  $nid = $form_values['nid'];
  $node = node_load($nid);
  $limit_status = 0;
  if (isset($form_values['limit']) && $form_values['limit'] != $node->signup_close_signup_limit) {
    db_query("UPDATE {signup} SET close_signup_limit = %d WHERE nid = %d", $form_values['limit'], $nid);
    $node->signup_close_signup_limit = $form_values['limit'];
    $limit_status = _signup_check_limit($node, 'limit');
  }

  // Only consider the form's status value if the signup limit didn't
  // touch the status already.
  if (!$limit_status && isset($form_values['status']) && $form_values['status'] != $node->signup_status) {
    if ($form_values['status']) {
      signup_open_signup($nid);
      drupal_set_message(t('Signups opened for !title.', array(
        '!title' => l($node->title, "node/{$node->nid}"),
      )));
    }
    else {
      signup_close_signup($nid);
      drupal_set_message(t('Signups closed for !title.', array(
        '!title' => l($node->title, "node/{$node->nid}"),
      )));
    }
  }
}