Project

General

Profile

« Previous | Next » 

Revision 0ebb6efc

Added by Andreas Kohlbecker about 8 years ago

restructuring description element code

View differences:

modules/cdm_dataportal/cdm_dataportal.module
2304 2304
 *
2305 2305
 * @TODO this function may have become obsolete by the new method of detecting empty blocks,
2306 2306
 *       see $block_content_is_not_empty in compose_feature_blocks() and
2307
 *       $feature_block_has_content in compose_description_elements_other_features
2307
 *       $feature_block_has_content in compose_feature_block_items_generic
2308 2308
 */
2309 2309
function has_feature_node_description_elements($featureNode) {
2310 2310

  
modules/cdm_dataportal/includes/descriptions.inc
529 529
         * Content/COMMON_NAME.
530 530
         */
531 531
        else if ($node->feature->uuid == UUID_COMMON_NAME) {
532
          $common_names_render_array = compose_description_elements_common_name($node->descriptionElements, $node->feature);
532
          $common_names_render_array = compose_feature_block_items_feature_common_name($node->descriptionElements, $node->feature);
533 533
          $block->content[] = $common_names_render_array;
534 534
          $block_content_is_empty = FALSE;
535 535
        }
......
553 553
            if(isset($taxon) ) {
554 554
              $taxon_uuid = $taxon->uuid;
555 555
            }
556
            $elements_render_array = compose_description_elements_other_features($node->descriptionElements, $node->feature, $taxon_uuid);
556
            $elements_render_array = compose_feature_block_items_generic($node->descriptionElements, $node->feature, $taxon_uuid);
557 557
            $block_content_is_empty = empty($elements_render_array);
558 558
            $block->content[] = $elements_render_array;
559 559
          }
......
573 573
              if (isset($child->descriptionElements) && is_array($child->descriptionElements)) {
574 574
                foreach ($child->descriptionElements as $element) {
575 575

  
576
                  //TODO it woud be better if we could use compose_description_elements_other_features() directly instead of the below stuff
576
                  //TODO it woud be better if we could use compose_feature_block_items_generic() directly instead of the below stuff
577 577

  
578 578
                  if (is_array($element->media)) {
579 579
                    // Append media of subordinate elements to list of main
......
851 851

  
852 852

  
853 853
  /**
854
   * Composes a drupal render array for CDM TextData description elements.
854
   * Composes a drupal render array for single CDM TextData description element.
855 855
   *
856 856
   * @param $element
857
   *    The CDM TextData description element which contains the textual  information.
857
   *    The CDN TextData  description element.
858 858
   * @param $asListElement
859 859
   *    A boolean which determines whether the citations should
860 860
   *     be rendered as a list or not.
......
1048 1048
   *
1049 1049
   * @ingroup compose
1050 1050
   */
1051
  function compose_description_elements_other_features($descriptionElements, $feature) {
1051
  function compose_feature_block_items_generic($descriptionElements, $feature) {
1052 1052

  
1053 1053
    $render_array = array();
1054 1054
    $elements_out_array = array();
......
1138 1138
 *
1139 1139
 * @ingroup compose
1140 1140
 */
1141
function compose_description_elements_common_name($elements, $feature, $weight = FALSE) {
1141
function compose_feature_block_items_feature_common_name($elements, $feature, $weight = FALSE) {
1142 1142

  
1143 1143
  $common_name_out = '';
1144 1144
  $common_name_feature_elements = array();
......
1245 1245
}
1246 1246

  
1247 1247
  /**
1248
   * Composes the render array for a CDM Distribution element
1248
   * Composes the render array for a CDM Distribution description element
1249 1249
   *
1250
   * @param $descriptionElements
1251
   *   The CDM Distribution element
1250
   * @param array $descriptionElements
1251
   *   Array of CDM Distribution instances
1252 1252
   * @param $enclosingTag
1253 1253
   *   The html tag to be use for the enclosing element
1254 1254
   *

Also available in: Unified diff