You are here

function access_unpublished_get_access_url in Access unpublished 6

Generate url to access the unpublished node.

1 call to access_unpublished_get_access_url()
access_unpublished_nodeapi in ./access_unpublished.module
Implements hook_nodeapi().

File

./access_unpublished.module, line 117
This module is used to allow access to unpublished nodes

Code

function access_unpublished_get_access_url($node) {
  if ($node->path != "") {
    return url($node->path, array(
      'query' => _access_unpublished_get_querystring() . '=' . _access_unpublished_get_hash($node->nid),
      'absolute' => TRUE,
    ));
  }
  else {
    return url('node/' . $node->nid, array(
      'query' => _access_unpublished_get_querystring() . '=' . _access_unpublished_get_hash($node->nid),
      'absolute' => TRUE,
    ));
  }
}