Index: modules/node.module =================================================================== RCS file: /cvs/drupal/drupal/modules/node.module,v retrieving revision 1.647 diff -F^f -u -u -F^f -r1.647 node.module --- modules/node.module 7 May 2006 01:00:15 -0000 1.647 +++ modules/node.module 11 May 2006 03:38:20 -0000 @@ -1502,11 +1502,13 @@ function node_submit($node) { $node->created = $node->date ? strtotime($node->date) : NULL; } - // Force defaults in case people modify the form: - $node_options = variable_get('node_options_'. $node->type, array('status', 'promote')); - foreach (array('status', 'moderate', 'promote', 'sticky', 'revision') as $key) { - if (!$access || !isset($node->$key)) { - $node->$key = in_array($key, $node_options); + if (!user_access('administer nodes') && variable_get('node_reset_options_'. $node->type, 1)) { + // Reset post options to defaults if the user is not an administrator and the node type is set to reset to defaults. + $node_options = variable_get('node_options_'. $node->type, array('status', 'promote')); + foreach (array('status', 'moderate', 'promote', 'sticky', 'revision') as $key) { + if (!$access || !isset($node->$key)) { + $node->$key = in_array($key, $node_options); + } } } @@ -2123,6 +2125,13 @@ function node_form_alter($form_id, &$for ), '#description' => t('Users with the administer nodes permission will be able to override these options.'), ); + $form['workflow']['node_reset_options_'. $form['type']['#value']] = array( + '#type' => 'radios', + '#title' => t('Publishing options for unprivileged users'), + '#options' => array(1 => t('Revert when posts are edited'), 0 => t('Keep current settings')), + '#default_value' => variable_get('node_reset_options_'. $form['type']['#value'], 1), + '#description' => t('In some situations a user can create and edit their posts, but do not have permission to control the publishing options. Reverting the publishing options ensures that the new content goes through the same review by administrators as the initial posting.'), + ); } // Advanced node search form