You are here

function _publishcontent_unpublish_access in Publish Content 7

Same name and namespace in other branches
  1. 5.2 publishcontent.module \_publishcontent_unpublish_access()
  2. 6 publishcontent.module \_publishcontent_unpublish_access()

Access callback for unpublish action.

1 string reference to '_publishcontent_unpublish_access'
publishcontent_menu in ./publishcontent.module
Implements hook_menu().

File

./publishcontent.module, line 104
Add link to publish or unpublish a node, with access control based on the node type

Code

function _publishcontent_unpublish_access($node, $token = FALSE) {
  if (!is_object($node)) {
    return FALSE;
  }
  if ($token && !drupal_valid_token($token)) {
    return FALSE;
  }
  if (!variable_get('publishcontent_' . $node->type, FALSE)) {
    return FALSE;
  }
  return $node->status && publishcontent_unpublish_access($node);
}