You are here

function _site_disclaimer_nodeapi_work in Site Disclaimer 6

Same name and namespace in other branches
  1. 7 site_disclaimer.module \_site_disclaimer_nodeapi_work()
1 call to _site_disclaimer_nodeapi_work()
site_disclaimer_nodeapi in ./site_disclaimer.module
Implementation of hook_nodeapi().

File

./site_disclaimer.module, line 419
This module adds Site Disclaimer to the registration page.

Code

function _site_disclaimer_nodeapi_work($node, $op) {
  $nid = variable_get('site_disclaimer_node_id', '');
  $nids = $nid != '' ? _site_disclaimer_nid_all_translations($nid) : array();
  $nids += variable_get('site_disclaimer_allow_nodes', array());

  // Figure out translation relationships of the node
  if (!empty($node->tnid)) {
    $node_tnid = $node->tnid;
  }
  elseif (!empty($node->translation_source)) {
    $node_tnid = $node->translation_source->tnid ? $node->translation_source->tnid : $node->translation_source->nid;
  }

  //?  if (!$node_tnid) {

  //    $node_tnid = $_GET['translation'];
  //  }
  if (isset($node->nid) && in_array($node->nid, $nids) || !empty($node_tnid) && in_array($node_tnid, $nids)) {
    module_load_include('inc', 'site_disclaimer', 'site_disclaimer.admin');
    _site_disclaimer_prep_allowed_paths($nid, $op == 'delete' ? $node->nid : NULL);
  }
}