blockentrees.inc 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. function template_preprocess_blockentrees(&$vars){
  3. $entrees = array (
  4. '#theme' => 'item_list',
  5. '#items' => array(),
  6. );
  7. foreach ($vars['entrees_items'] as $entree) {
  8. $tid = $entree['tid'];
  9. $term_link = $entree['term_link']->toRenderable();
  10. $term_link['#prefix'] = '<span class="oblique-wrapper">';
  11. $term_link['#suffix'] = "</span>";
  12. $index_link = $entree['index_link']->toRenderable();
  13. $index_link['#prefix'] = '<span class="oblique-wrapper">';
  14. $index_link['#suffix'] = "</span>";
  15. $notice_link = $entree['notice_link']->toRenderable();
  16. $notice_link['#prefix'] = '<span class="oblique-wrapper">';
  17. $notice_link['#suffix'] = "</span>";
  18. $entree = array(
  19. '#wrapper_attributes' => array(
  20. 'class' => array('term-'.$tid, 'entree'),
  21. 'tid' => $tid
  22. ),
  23. 'term_link' => $term_link,
  24. 'entree_content' => array(
  25. '#type' => 'container',
  26. '#attributes' => array(
  27. 'class' => 'entree-content'
  28. ),
  29. 'index_link' => $index_link,
  30. 'notice_link' => $notice_link,
  31. 'description' => array(
  32. '#type' => 'container',
  33. '#markup' => $entree['description'],
  34. '#attributes' => array('class'=>'term-description')
  35. )
  36. )
  37. );
  38. // if (isset($entrees) && count($entrees) == count($terms)-3) {
  39. // $entree['#wrapper_attributes']['class'][] = 'opened';
  40. // }
  41. // dpm($entree);
  42. $entrees['#items'][] = $entree;
  43. }
  44. $vars['entrees'] = render($entrees);
  45. }