blockentrees.inc 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. $term_link["#attributes"] = array(
  13. "class" => array('term-'.$tid, 'term-link'),
  14. "tid" => $tid
  15. );
  16. $index_link = $entree['index_link']->toRenderable();
  17. $index_link['#prefix'] = '<span class="oblique-wrapper">';
  18. $index_link['#suffix'] = "</span>";
  19. $index_link['#attributes'] = array(
  20. 'class' => array('index-link'),
  21. "tid" => $tid
  22. );
  23. $notice_link = $entree['notice_link']->toRenderable();
  24. $notice_link['#prefix'] = '<span class="oblique-wrapper">';
  25. $notice_link['#suffix'] = "</span>";
  26. $notice_link['#attributes'] = array(
  27. 'class' => array('notice-link'),
  28. "tid" => $tid
  29. );
  30. $entree = array(
  31. '#wrapper_attributes' => array(
  32. 'class' => array('term-'.$tid, 'entree'),
  33. 'tid' => $tid
  34. ),
  35. 'term_link' => $term_link,
  36. 'entree_content' => array(
  37. '#type' => 'container',
  38. '#attributes' => array(
  39. 'class' => 'entree-content'
  40. ),
  41. 'index_link' => $index_link,
  42. 'notice_link' => $notice_link,
  43. 'description' => array(
  44. '#type' => 'container',
  45. '#markup' => $entree['description'],
  46. '#attributes' => array('class'=>'term-description')
  47. )
  48. )
  49. );
  50. // if (isset($entrees) && count($entrees) == count($terms)-3) {
  51. // $entree['#wrapper_attributes']['class'][] = 'opened';
  52. // }
  53. // dpm($entree);
  54. $entrees['#items'][] = $entree;
  55. }
  56. $vars['entrees'] = render($entrees);
  57. }