node.pre.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. // dsm($vars);
  3. $node = $vars['node'];
  4. // $classes = array();
  5. $vars['classes_array'][] = 'node-'.$node->nid;
  6. // $vars['classes_array'][] = 'node type-'.$node->type;
  7. $vars['classes_array'][] = 'vm-'.$vars['view_mode'];
  8. // $classes[] = 'node-' . $vars['type'] . '-' . $vars['view_mode'];
  9. if($vars['sticky'])
  10. $vars['classes_array'][] = "sticky";
  11. if (!$vars['status'])
  12. $vars['classes_array'][] = "unpublished";
  13. if (isset($vars['flags']))
  14. $vars['classes_array'][] = "flaged";
  15. // $vars['classes_array'][] = $hook.' '.$hook.'-'.$vars['zebra'];
  16. if (isset($vars['workflow']))
  17. $vars['classes_array'][] = "workflow-".$vars['workflow'];
  18. $vars['theme_hook_suggestions'][] = 'node__'.$vars['view_mode'];
  19. $vars['theme_hook_suggestions'][] = 'node__' . $vars['type'] . '__' . $vars['view_mode'];
  20. if($vars['view_mode'] == 'bookmark')
  21. unset($vars['content']['links']);
  22. // dsm($vars);
  23. if($vars['type'] == 'didactique'){
  24. // dsm($node, 'node');
  25. if(!empty($node->field_emvideo))
  26. $vars['classes_array'][] = "emvideo";
  27. }