You are here

function certificate_update_node_mappings in Certificate 6

Same name and namespace in other branches
  1. 8.3 certificate.module \certificate_update_node_mappings()
  2. 6.2 certificate.module \certificate_update_node_mappings()
  3. 7.3 certificate.module \certificate_update_node_mappings()
  4. 7.2 certificate.module \certificate_update_node_mappings()
  5. 3.x certificate.module \certificate_update_node_mappings()

Submit handler to update node template mappings.

1 call to certificate_update_node_mappings()
certificate_nodeapi in ./certificate.module
Implements hook_nodeapi.

File

./certificate.module, line 517
Certificate module.

Code

function certificate_update_node_mappings(&$node) {
  $node_settings = $node->certificate['node_settings'];
  if (is_array($node_settings)) {
    db_query("DELETE FROM {certificate_node} WHERE nid = %d", $node->nid);
    foreach ($node_settings as $type => $template) {
      if ($template == 0) {
        continue;
      }
      db_query("INSERT INTO {certificate_node} (nid, type, template) VALUES (%d, '%s', %d)", $node->nid, $type, $template);
    }
  }
}