node_revision_revert_confirm_submit

Хочешь помочь с переводом? Это очень просто и быстро. Лишь зарегистрируйся, и можешь тут же начать переводить.

modules/node/node.module, строка 1787

Версии
5
node_revision_revert_confirm_submit($form_id, $form_values)
6
node_revision_revert_confirm_submit($form, &$form_state)

Код

<?php
function node_revision_revert_confirm_submit($form_id, $form_values) {
  $node = $form_values['node'];

  $node->revision = 1;
  $node->log = t('Copy of the revision from %date.', array('%date' => format_date($node->revision_timestamp)));
  if (module_exists('taxonomy')) {
    $node->taxonomy = array_keys($node->taxonomy);
  }

  node_save($node);

  drupal_set_message(t('%title has been reverted back to the revision from %revision-date', array('%revision-date' => format_date($node->revision_timestamp), '%title' => $node->title)));
  watchdog('content', t('@type: reverted %title revision %revision.', array('@type' => t($node->type), '%title' => $node->title, '%revision' => $node->vid)));

  return 'node/'. $node->nid .'/revisions';
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии

Вход в систему