You are here

function vid_to_arg in Revisioning 6.4

Same name and namespace in other branches
  1. 8 revisioning.module \vid_to_arg()
  2. 6.3 revisioning.module \vid_to_arg()
  3. 7 revisioning.module \vid_to_arg()

Perform path manipulations for menu items containing %vid wildcard. $map contains what arg() function returns, eg. $map[0]=='node', $map[1]=='123'.

When vid is absent, return $map as empty array. This seems to disable menu items which require a vid context to work. So on the page "node/123/revisions" we won't see tasks like "node/123/revisions/456/edit".

An alternative implementation would be to substitute an empty vid with current revision id. In that case we should also change the tab titles (via title callbacks) for an enhanced user experience. For example: we'd change "Edit" to "Edit current".

See http://drupal.org/node/500864

File

./revisioning.module, line 502
Allows the creation and modification of pre-published as well as live content while the current revision remains unchanged and publicly visible until the changes have been reviewed by a moderator.

Code

function vid_to_arg($arg, &$map, $index) {
  if (empty($arg)) {

    //return node_tools_get_current_node_revision_id($nid = $map[1]);
    $map = array();
    return '';
  }
  return $arg;
}