You are here

function pagination_node_presave in Pagination (Node) 7

Implementation of hook_node_presave()

File

./pagination.module, line 193

Code

function pagination_node_presave($node) {
  module_invoke('pagination', 'node_delete', $node);
  if (!empty($node->pagination_headers)) {
    $headers = explode("\n", str_replace("\r\n", "\n", $node->pagination_headers));
    $fields = array(
      'nid' => $node->nid,
      'headers' => serialize($headers),
    );
    db_insert('node_pagination')
      ->fields($fields)
      ->execute();
  }
}