Same name and namespace in other branches
  1. 4.7.x modules/node.module \node_revisions()

Menu callback for revisions related activities.

1 string reference to 'node_revisions'
system_update_169 in modules/system/system.install

File

modules/node/node.module, line 2442
The core that allows content to be submitted to the site. Modules and scripts may programmatically submit nodes using the usual form API pattern.

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' => $node->title,
                '%date' => format_date($node->revision_timestamp),
              )));
              return node_show($node, arg(2));
            }
            drupal_access_denied();
            return;
          }
        }
        break;
    }
  }
  drupal_not_found();
}