You are here

function htmlpurifier_nodeapi in HTML Purifier 7

Same name and namespace in other branches
  1. 6.2 htmlpurifier.module \htmlpurifier_nodeapi()
  2. 7.2 htmlpurifier.module \htmlpurifier_nodeapi()

Implements of hook_nodeapi().

File

./htmlpurifier.module, line 117
Implements HTML Purifier as a Drupal filter.

Code

function htmlpurifier_nodeapi(&$node, $op, $a3, $a4) {
  if ($op == 'view') {

    // Should we load CSS cache data from teaser or body?
    if ($a3 == TRUE) {
      _htmlpurifier_add_css($node->content['teaser']['#value'], $node->nid);
    }
    else {
      _htmlpurifier_add_css($node->content['body']['#value'], $node->nid);
    }
  }

  // @todo: Deal with CCK fields - probably needs to go in op alter?
}