You are here

function w3c_validator_node_view in W3C Validator 7

Implements hook_node_load().

File

./w3c_validator.module, line 103

Code

function w3c_validator_node_view($node, $view_mode, $langcode) {

  // Build the uri
  $uri = 'node/' . $node->nid;

  // Check if a validation operation is possible
  //	(not on frontpage + validation is outdated + user permission + module configration + node is published).
  $process_mode = variable_get('w3c_validator_options', array(
    'w3c_on_run' => 1,
  ));
  if (!drupal_is_front_page() && _w3c_validator_check_uri_expired($uri) && user_access('use_w3c') && $process_mode['w3c_on_run'] && $node->status == 1) {

    // Check the result.
    _w3c_validator_full_validation_operation($uri, 1);
  }
}