You are here

function nodesinblock_nodeapi in Nodes In Block 6

Implementation of hook_nodeapi().

File

./nodesinblock.module, line 186
Nodes in block makes it possible to add multiple nodes in one block.

Code

function nodesinblock_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {

  // Save nodesinblock settings.
  if (isset($node->nodesinblock_enable)) {
    switch ($op) {
      case 'validate':
        _nodesinblock_validate($node);
        break;
      case 'insert':
      case 'update':
        _nodesinblock_save($node, $op);
        break;
    }
  }

  // Delete nodesinblock data.
  if ($op == 'delete') {
    _nodeisblock_load($node);
    if (isset($node->nodesinblock)) {
      $node->nodesinblock_delta = $node->nodesinblock;
      _nodesinblock_save($node, 'delete');
    }
  }
}