You are here

function img_assist_nodeapi in Image Assist 6

Same name and namespace in other branches
  1. 5.3 img_assist.module \img_assist_nodeapi()
  2. 5 img_assist.module \img_assist_nodeapi()
  3. 5.2 img_assist.module \img_assist_nodeapi()
  4. 6.2 img_assist.module \img_assist_nodeapi()

Implementation of hook_nodeapi().

  • Clear input filter cache.
  • Keep track of where images are used.
  • Catch nids of recently uploaded images.

File

./img_assist.module, line 433
Image Assist module

Code

function img_assist_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
  switch ($op) {
    case 'update':
      if ($node->type == 'image') {

        // Clear the input filter cache to force all node content to be rebuilt.
        // This is to make sure all image paths are up to date.
        cache_clear_all(NULL, 'cache_filter');
      }

    // break is intentionally left out.
    case 'insert':

      // Update the image map.
      img_assist_map_save($node);
      break;
    case 'delete':
      img_assist_map_delete($node);
      break;
  }
}