Project

General

Profile

« Previous | Next » 

Revision dd1c109a

Added by Andreas Kohlbecker over 9 years ago

more flexible table of content creation, hook_cdm_feature_node_toc_items_alter() no longer needed

View differences:

7.x/modules/cdm_dataportal/includes/pages.inc
550 550
  // Render the sections for each feature
551 551
  $render_array['taxon_description_features'] = compose_cdm_feature_nodes($merged_tree->root->childNodes, $taxon);
552 552

  
553
  $toc = array(
554
    '#theme' => 'item_list',
555
    '#items' => cdm_feature_node_toc_items($merged_tree->root->childNodes),
556
    '#title' => t('Content'),
557
    '#weight' => -100,                  // move to the top
558
    '#suffix' => '</div>',
559
    '#prefix'=> '<div id="page-toc">'
560
  );
561
  $render_array['taxon_description_feature_toc'] = $toc; //markup_to_render_array($toc_html);
562

  
563 553
  $bibliography_settings = get_bibliography_settings();
564 554
  if($bibliography_settings['enabled'] == 1){
565 555
    $bibliography_block = feature_block(t('Bibliography'));
......
575 565
      ),
576 566
      100 // weight
577 567
    );
578
    $render_array['taxon_description_feature_toc']['#items'][] = toc_list_item('Bibliography', array('class' => 'bibliography'));
568

  
569
    cdm_toc_list_add_item('Bibliography', 'bibliography');
579 570
  }
580 571

  
572
  // create the table of content
573
  $toc = array(
574
    '#theme' => 'item_list',
575
    '#items' => cdm_toc_list(),
576
    '#title' => t('Content'),
577
    '#weight' => -100,                  // move to the top
578
    '#suffix' => '</div>',
579
    '#prefix'=> '<div id="page-toc">'
580
  );
581
  $render_array['taxon_description_feature_toc'] = $toc;
581 582

  
582 583
  return $render_array;
583 584
}

Also available in: Unified diff