You are here

function _datereminder_form_submit_node in Date Reminder 7

Same name and namespace in other branches
  1. 6.2 datereminder.module \_datereminder_form_submit_node()
  2. 6 datereminder.module \_datereminder_form_submit_node()

Handle form submit when admin enables or disables reminder for a node.

Note: We don't need to check user access here. We'll only come here if datereminder_alter_node_form() said we should. And it will only do that if it's OK for the user to enable or disable reminders on this node. Note that if reminders are enabled for this node type, anyone who can modify a node of that type can enable or disable reminders.

@todo Move this into include/node.inc. Requires updating node_form.inc to direct the form update there.

Parameters

array &$form: The submitted form

array &$form_state: State of submitted form.

1 string reference to '_datereminder_form_submit_node'
datereminder_alter_node_form in includes/node_form.inc
Implements hool_alter_node_form().

File

./datereminder.module, line 328
Support for reminders for nodes with dates.

Code

function _datereminder_form_submit_node(&$form, &$form_state) {
  module_load_include('inc', 'datereminder', 'includes/defines');
  module_load_include('inc', 'datereminder', DATEREMINDER_DB);
  $node = $form['#node'];
  $newen = $form_state['values']['datereminder_enabled'];
  $node->datereminder_enabled = $newen;
}