Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Implements hook_menu().
- */
- function node_revision_edit_menu() {
- $items['node/%node/revisions/%vid/modify'] = array(
- 'title' => 'Modify this revision',
- 'load arguments' => array(3),
- 'page callback' => 'drupal_get_form',
- 'page arguments' => array('node_revision_edit_form', 1, 3),
- 'access callback' => '_node_revision_edit_link_access',
- 'access arguments' => array('modify revisions'),
- 'file' => 'node_revision_edit.admin.inc',
- );
- return $items;
- }
- function node_revision_edit_form($form, &$form_state, $node, $vid) {
- // Prepare loading the node edit form
- form_load_include($form_state, 'inc', 'node', 'node.pages');
- // Populate the form state.
- $form_state += form_state_defaults();
- // Save the form id for the current content type.
- $nfid = $node->type . '_node_form';
- // Rebuild the entire user edit form for our needs
- $form = drupal_retrieve_form($nfid, $form_state);
- drupal_prepare_form($nfid, $form, $form_state);
- // Setup the already existing log in the field
- $form['revision_information']['log']['#default_value'] = node_revision_list($node)[$vid]->log;
- // Set the "Modify current revision, no moderation" as the default revision operation
- $form['revision_information']['revision_operation']['#default_value'] = 0;
- // Unset the options that we do not need
- // unset($form['options']);
- // Create a new submit button since we do not want to invoke the standard callback functions
- unset($form['#submit']);
- $form['#submit'] = array('node_revision_edit_form_submit');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement