Project

General

Profile

« Previous | Next » 

Revision 9aff46e4

Added by Andreas Kohlbecker over 9 years ago

introducing the api hook cdm_feature_node_blocks_alter and removing hook_cdm_feature_node_blocks_alter, this makes theme_cdm_feature_nodes obsolte, reducing speccial code in palmweb theme

View differences:

7.x/modules/cdm_dataportal/theme/cdm_dataportal.descriptions.theme
52 52
 * @param $taxon
53 53
 *
54 54
 * @return array
55
 *  A Drupal render array
55
 *  A Drupal render array containing feature blocks and the table of content
56 56
 *
57 57
 * @ingroup compose
58 58
 */
59 59
function compose_cdm_feature_nodes($mergedFeatureNodes, $taxon) {
60 60

  
61
  $out = '';
61
  $block_list = array();
62 62

  
63 63
  RenderHints::pushToRenderStack('feature_nodes');
64 64

  
......
91 91
      else if ($node->feature->uuid == UUID_COMMON_NAME) {
92 92
        $common_names_render_array = compose_cdm_common_names($node->descriptionElements, $node->feature);
93 93
        $block->content[] = $common_names_render_array;
94
        $block_content_is_empty = FALSE;
95
      }
96

  
97
      else if ($node->feature->uuid == UUID_USE_RECORD) {
98
        $block_uses_content_html = theme('cdm_block_Uses', array('taxonUuid' => $taxon->uuid));
99
        $block->content[] = markup_to_render_array($block_uses_content_html);
100
        $block_content_is_empty = FALSE;
94 101
      }
95 102

  
96 103
      /*
......
170 177
      } // END all other features
171 178

  
172 179
      if(!$block_content_is_empty){ // skip empty block content
173
        $out .= theme('block',
174
          array(
175
            'elements' => array(
176
              '#block' => $block,
177
              '#children' => drupal_render($block->content),
178
            ),
179
          )
180
        );
180
        $block_list[] = $block;
181 181
        cdm_toc_list_add_item(cdm_term_representation($node->feature), $node->feature->uuid);
182 182
      } // END: skip empty block content
183 183
    } // END: skip empty or supressed features
184 184
  } // END: creating a block per feature
185

  
186
  drupal_alter('cdm_feature_node_blocks', $block_list, $taxon);
187

  
185 188
  RenderHints::popFromRenderStack();
186 189

  
187
  return markup_to_render_array($out);
190
  return _block_get_renderable_array($block_list);
188 191
}
189 192

  
190 193
  /**

Also available in: Unified diff