You are here

function copyprevention_preprocess_html in Copy Prevention 8

Same name and namespace in other branches
  1. 7 copyprevention.module \copyprevention_preprocess_html()

Implements hook_preprocess_html().

File

./copyprevention.module, line 35
Main file for Copy Prevention module.

Code

function copyprevention_preprocess_html(&$vars) {
  if (!_copyprevention_is_enabled()) {
    return;
  }
  $body_settings = array_filter(\Drupal::configFactory()
    ->getEditable('copyprevention.settings')
    ->get('copyprevention_body'));
  foreach ($body_settings as $value) {
    $vars['attributes']['on' . $value] = 'return false';
  }
}