function signup_node_admin_summary_form_submit in Signup 6.2
Same name and namespace in other branches
- 5.2 signup.module \signup_node_admin_summary_form_submit()
- 6 includes/node_admin_summary.inc \signup_node_admin_summary_form_submit()
- 7 includes/node_admin_summary.inc \signup_node_admin_summary_form_submit()
1 call to signup_node_admin_summary_form_submit()
1 string reference to 'signup_node_admin_summary_form_submit'
- signup_node_admin_summary_form in includes/
node_admin_summary.inc - @file Code related to the signup administration tab on each node.
File
- includes/
node_admin_summary.inc, line 55 - Code related to the signup administration tab on each node.
Code
function signup_node_admin_summary_form_submit($form, &$form_state) {
$nid = $form_state['values']['nid'];
$node = node_load($nid);
$limit_status = 0;
if (isset($form_state['values']['limit']) && $form_state['values']['limit'] != $node->signup_close_signup_limit) {
db_query("UPDATE {signup} SET close_signup_limit = %d WHERE nid = %d", $form_state['values']['limit'], $nid);
$node->signup_close_signup_limit = $form_state['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_state['values']['status']) && $form_state['values']['status'] != $node->signup_status) {
if ($form_state['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}"),
)));
}
}
}