You are here

function override_node_options_submit_node in Override Node Options 5

Same name and namespace in other branches
  1. 8 override_node_options.module \override_node_options_submit_node()
  2. 6 override_node_options.module \override_node_options_submit_node()

Perform additional node form submission processing normally skipped by core.

File

./override_node_options.module, line 126
Allow users to override the default publishing options for nodes they can edit without giving them the 'administer nodes' permission.

Code

function override_node_options_submit_node($form_id, $form_values) {

  // Populate the "authored by" field.
  if ($account = user_load(array(
    'name' => $form_values['name'],
  ))) {
    form_set_value(array(
      '#parents' => array(
        'uid',
      ),
    ), $account->uid);
  }
  else {
    form_set_value(array(
      '#parents' => array(
        'uid',
      ),
    ), 0);
  }
}