You are here

function ad_channel_nodeapi in Advertisement 7

Same name and namespace in other branches
  1. 5.2 channel/ad_channel.module \ad_channel_nodeapi()
  2. 6.3 channel/ad_channel.module \ad_channel_nodeapi()
  3. 6.2 channel/ad_channel.module \ad_channel_nodeapi()

Implementation of hook_nodeapi().

File

channel/ad_channel.module, line 543
Ad Channel module.

Code

function ad_channel_nodeapi($node, $op, $arg = 0) {
  switch ($op) {
    case 'view':
      return _ad_channel_view_node($node);
    case 'load':
      return _ad_channel_load_node($node);
    case 'insert':
    case 'update':
      if (is_object($node) && isset($node->adtype) && isset($node->nid)) {
        return _ad_channel_save_node($node);
      }
      break;
    case 'delete':
      return _ad_channel_delete_node($node);
    case 'validate':
      return _ad_channel_validate_nodes($node);
  }
}