You are here

function node_revisions in Drupal 5

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

Menu callback for revisions related activities.

2 string references to 'node_revisions'
node_menu in modules/node/node.module
Implementation of hook_menu().
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();
}