You are here

function content_nodeapi in Content Construction Kit (CCK) 5

Same name and namespace in other branches
  1. 6.3 content.module \content_nodeapi()
  2. 6 content.module \content_nodeapi()
  3. 6.2 content.module \content_nodeapi()

Implementation of hook_nodeapi().

When a revision is deleted, make sure the appropriate cache item is cleared. @todo: deprecate op==validate & op==submit in favor of form callbacks.

File

./content.module, line 313
Allows administrators to associate custom fields to content types.

Code

function content_nodeapi(&$node, $op, $teaser, $page) {
  switch ($op) {
    case 'load':
      return content_load($node);
    case 'validate':
      content_validate($node);
      break;
    case 'submit':
      content_submit($node);
      break;
    case 'insert':
      if ($node->devel_generate) {
        include_once './' . drupal_get_path('module', 'content') . '/content.devel.inc';
        content_generate_fields($node);
      }
      content_insert($node);
      break;
    case 'update':
      content_update($node);
      break;
    case 'delete':
      content_delete($node);
      break;
    case 'delete revision':
      content_delete_revision($node);
      break;
    case 'view':
    case 'print':
      content_view($node, $teaser, $page);
      break;
  }
}