_node_save_revision
modules/node/node.module, строка 943
- Версии
- 6
_node_save_revision(&$node, $uid, $update = NULL)
Helper function to save a revision with the uid of the current user.
Node is taken by reference, becuse drupal_write_record()
updates the
$node
with the revision id, and we need to pass that back to the caller.
Код
<?php
function _node_save_revision(&$node, $uid, $update = NULL) {
$temp_uid = $node->uid;
$node->uid = $uid;
if (isset($update)) {
drupal_write_record('node_revisions', $node, $update);
}
else {
drupal_write_record('node_revisions', $node);
}
$node->uid = $temp_uid;
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии