blockentrees.inc 1.7 KB

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