You are here

function node_gallery_preprocess_node in Node Gallery 6.3

Same name and namespace in other branches
  1. 6 node_gallery.module \node_gallery_preprocess_node()
  2. 6.2 node_gallery.module \node_gallery_preprocess_node()

File

./node_gallery.module, line 1226
Node gallery module file.

Code

function node_gallery_preprocess_node(&$vars) {
  $node = $vars['node'];
  if (in_array($node->type, (array) node_gallery_get_types('image'))) {
    $new_slice = array(
      'node-gallery-image-' . $node->type,
      'node-' . $node->type,
    );
    $pos = array_search('node-' . $node->type, $vars['template_files']);
    if ($pos === FALSE) {
      $vars['template_files'] += $new_slice;
    }
    else {
      array_splice($vars['template_files'], $pos, 1, $new_slice);
    }
  }
}