You are here

function content_theme_node_load in Content Theme 7

Same name and namespace in other branches
  1. 7.2 content_theme.module \content_theme_node_load()

Implements hook_node_load().

File

./content_theme.module, line 253
This module allows to use different themes than the site default on content creating, editing, and viewing pages.

Code

function content_theme_node_load($nodes, $types) {
  foreach ($nodes as $nid => $node) {
    $nodes[$nid]->content_theme_content_node_edit = '-content_type-';
    $nodes[$nid]->content_theme_content_node_view = '-content_type-';
  }
  $result = db_query('SELECT nid, action, theme FROM {content_theme_node} WHERE nid IN (:nids)', array(
    ':nids' => array_keys($nodes),
  ));
  foreach ($result as $record) {
    if ($record->action == 'edit') {
      $nodes[$record->nid]->content_theme_content_node_edit = $record->theme;
    }
    if ($record->action == 'view') {
      $nodes[$record->nid]->content_theme_content_node_view = $record->theme;
    }
  }
}