You are here

function _themekey_ui_nodeapi in ThemeKey 6

Function _themekey_ui_nodeapi().

1 call to _themekey_ui_nodeapi()
themekey_ui_nodeapi in ./themekey_ui.module
Implementation of hook_nodeapi().

File

./themekey_ui_admin.inc, line 112

Code

function _themekey_ui_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
  switch ($op) {
    case 'insert':
    case 'update':
      if (isset($node->theme) && $node->theme != 'default') {
        if (variable_get('themekey_nodeaspath', 0)) {
          themekey_ui_set_path_theme('node/' . $node->nid, $node->theme);
        }
        else {
          themekey_ui_set_node_theme($node->nid, $node->theme);
        }
      }
      else {
        if (variable_get('themekey_nodeaspath', 0)) {
          themekey_ui_del_path_theme('node/' . $node->nid);
        }
        else {
          themekey_ui_del_node_theme($node->nid);
        }
      }
      break;
    case 'delete':
      if (variable_get('themekey_nodeaspath', 0)) {
        themekey_ui_del_path_theme('node/' . $node->nid);
      }
      else {
        themekey_ui_del_node_theme($node->nid);
      }
      break;
  }
}