Project

General

Profile

Revision 7965ef92

ID7965ef9295704bdd6dee088aeabe6363063618d3
Parent 267da0d1
Child d3f77ada

Added by Katja Luther about 2 years ago

add item list to table resolves the problem of rendering the description items

View differences:

modules/cdm_dataportal/includes/pages.inc
76 76
    $specimensOrObservations = array_merge($type_specimens, $other_occurrences);
77 77

  
78 78
    // Collect media (fieldObjectMedia, derivedUnitMedia) and add as a custom field
79
    // $occurrence->_fieldObjectMedia
80
   // foreach ($specimensOrObservations as &$occurrence) {
81
    //    $occurrence->_fieldObjectMedia = cdm_ws_get(CDM_WS_DERIVEDUNIT_FACADE, array(
82
    //        $occurrence->uuid,
83
    //        'fieldObjectMedia',
84
    //    ));
85
    //    $occurrence->_derivedUnitMedia = cdm_ws_get(CDM_WS_DERIVEDUNIT_FACADE, array(
86
    //        $occurrence->uuid,
87
    //        'derivedUnitMedia',
88
    //    ));
89
    //}
79
     $occurrence->_fieldObjectMedia;
80
    foreach ($specimensOrObservations as &$occurrence) {
81
        $occurrence->_fieldObjectMedia = cdm_ws_get(CDM_WS_DERIVEDUNIT_FACADE, array(
82
            $occurrence->uuid,
83
            'fieldObjectMedia',
84
        ));
85
        $occurrence->_derivedUnitMedia = cdm_ws_get(CDM_WS_DERIVEDUNIT_FACADE, array(
86
            $occurrence->uuid,
87
            'derivedUnitMedia',
88
        ));
89
    }
90 90

  
91 91
    // --- get map service HTTP query parameters
92 92

  
......
119 119

  
120 120
    // -------------------------------------------------------
121 121
    $render_array['map'] = $map_render_array;
122
    $cdm_dataportal_list_view = true;
122
    $cdm_dataportal_list_view = false;
123 123
    if(variable_get('cdm_dataportal_compressed_specimen_derivate_table')){
124 124

  
125 125
        //COMPRESSED SPECIMEN DERIVATE TABLE
......
153 153
        );
154 154
    }
155 155
    else if($cdm_dataportal_list_view){
156
        $specimen_table = array(
157
            '#theme' => 'table',
158
            '#weight' => 2,
159
            // prefix attributes and rows with '#' to let it pass toF the theme function,
160
            // otherwise it is handled as child render array
161
            '#attributes' => array('class' => 'specimens'),
162
            '#rows' => array(),
163
        );
156 164
        $specimen_array = create_specimen_array($specimensOrObservations);
157
        $render_array['specimen_list'] = array('#theme'=>'item_list', '#items'=>$specimen_array, '#type'=>'ul');
165

  
166
        foreach($specimen_array as $value){
167
            $renderArray = array(
168
                '#theme' => 'item_list',
169
                '#items' => array($value),
170
                '#type' => 'ul');
171
            $output = drupal_render($renderArray);
172
            $specimen_table['#rows'][] = array(
173
                // An array of table rows. Every row is an array of cells, or an associative array
174
                'data' => array($output),
175
                'class' =>  array(
176
                    'descriptionElement',
177
                    'descriptionElement_IndividualsAssociation'
178
                ),
179
            );
180
        }
181

  
182
        $render_array['specimen_list'] = $specimen_table;
158 183
      //  $render_array['specimen_list'] = $specimen_array;
159 184

  
160 185
    }
......
282 307
            10 // weight
283 308
        );
284 309
    }
310
    $render_array['pager'] = markup_to_render_array(
311
        theme('cdm_pager', array(
312
            'pager' => $pager,
313
            'path' => $_REQUEST['q'],
314
            'parameters' => $_REQUEST,
315
        )),
316
        10 // weight
317
    );
285 318
    RenderHints::popFromRenderStack();
286 319
    return $render_array;
287 320
}

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)