You are here

function certificate_node_load in Certificate 3.x

Same name and namespace in other branches
  1. 8.3 certificate.module \certificate_node_load()
  2. 7.3 certificate.module \certificate_node_load()
  3. 7.2 certificate.module \certificate_node_load()

Implements hook_node_load().

File

./certificate.module, line 400
Certificate module.

Code

function certificate_node_load($nodes, $types) {
  foreach ($nodes as $nid => $node) {
    if (certificate_node_is_certifiable($node)) {
      $nodes[$nid]->certificate = array(
        'node_settings' => certificate_course_node_template_settings($node->nid),
      );
    }
    if ($node->type == 'certificate') {
      $nodes[$nid]->certificate = db_query("select * from {certificate_node_settings} where nid = :nid", array(
        ':nid' => $node->nid,
      ))
        ->fetch(PDO::FETCH_ASSOC);
    }
  }
}