function node_revisions in Drupal 4
Same name and namespace in other branches
- 5 modules/node/node.module \node_revisions()
Menu callback for revisions related activities.
2 string references to 'node_revisions'
- node_menu in modules/
node.module - Implementation of hook_menu().
- system_update_169 in database/
updates.inc
File
- modules/
node.module, line 1995 - The core that allows content to be submitted to the site.
Code
function node_revisions() {
if (is_numeric(arg(1)) && arg(2) == 'revisions') {
$op = arg(4) ? arg(4) : 'overview';
switch ($op) {
case 'overview':
$node = node_load(arg(1));
if ((user_access('view revisions') || user_access('administer nodes')) && node_access('view', $node)) {
return node_revision_overview($node);
}
drupal_access_denied();
return;
case 'view':
if (is_numeric(arg(3))) {
$node = node_load(arg(1), arg(3));
if ($node->nid) {
if ((user_access('view revisions') || user_access('administer nodes')) && node_access('view', $node)) {
drupal_set_title(t('Revision of %title from %date', array(
'%title' => theme('placeholder', $node->title),
'%date' => format_date($node->revision_timestamp),
)));
return node_show($node, arg(2));
}
drupal_access_denied();
return;
}
}
break;
case 'revert':
return node_revision_revert(arg(1), arg(3));
break;
case 'delete':
return node_revision_delete(arg(1), arg(3));
break;
}
}
drupal_not_found();
}