Project

General

Profile

« Previous | Next » 

Revision 37252893

Added by Andreas Kohlbecker almost 11 years ago

implementing solution for #3489 (dataportal must not always load all descriptionelements for the general tab)

View differences:

7.x/modules/cdm_dataportal/theme/cdm_dataportal.page.theme
154 154
  // --- PAGE PART: DESCRIPTION --- //
155 155
  if ($page_part == 'description' || $page_part == 'all') {
156 156

  
157
  /*
157 158
    $markerTypesEmpty = array();
158 159
    $markerTypesEmpty['markerTypes'] = '';
159 160
    $queryString = $markerTypesEmpty['markerTypes'] ? queryString($markerTypesEmpty) : '';
161

  
160 162
    // Retrieve all descriptions for the taxon.
161 163
    $taxonDescriptions = cdm_ws_get(CDM_WS_PORTAL_TAXON_DESCRIPTIONS, $taxon->uuid, $queryString);
162

  
163 164
    $nonStructuredDescriptions = array();
164 165
    if ($taxonDescriptions != NULL) {
165 166
      foreach ($taxonDescriptions as $taxonDescription) {
166
        // Check if structured description.
167
        // handling of structured data:
168
        // structured data will be transformed in to natural language and is then readded
169
        // to the array of descriptions
167 170
        $hasStructuredData = cdm_ws_get(CDM_WS_DESCRIPTION_HAS_STRUCTRURED_DATA, $taxonDescription->uuid);
168 171
        if (isset($hasStructuredData->Boolean)) {
169 172
          $hasStructuredData = $hasStructuredData->Boolean == 'TRUE';
......
197 200
        }
198 201
        $nonStructuredDescriptions[] = $taxonDescription;
199 202
      }
203
      // ...............................................END
200 204
      // Release memory.
201 205
      $taxonDescriptions = NULL;
202 206
    }
207
    */
203 208

  
204
    $mergedTrees = cdm_ws_descriptions_by_featuretree(get_profile_featureTree(), $nonStructuredDescriptions, variable_get('cdm_dataportal_descriptions_separated', FALSE));
209
    $merged_tree = cdm_ws_descriptions_by_featuretree(get_profile_featureTree(), $taxon->uuid);
205 210

  
206 211
    $profile_html = '<div id="general">';
207 212
    $profile_html .= theme('cdm_taxon_page_profile', array(
208 213
      'taxon' => $taxon,
209
      'mergedTrees' => $mergedTrees,
214
      'merged_tree' => $merged_tree,
210 215
      'media' => $media,
211 216
      'hideImages' => $hideImages,
212 217
      ));
......
286 291
 */
287 292
function theme_cdm_taxon_page_profile($variables) {
288 293
  $taxon = $variables['taxon'];
289
  $mergedTrees = $variables['mergedTrees'];
294
  $merged_tree = $variables['merged_tree'];
290 295
  $media = $variables['media'];
291 296
  $hideImages = $variables['hideImages'];
292 297
  $out = '';
......
336 341
  }
337 342

  
338 343
  // Description TOC.
339
  $out .= theme('cdm_featureTreeTOCs', array('mergedTrees' => $mergedTrees));
344
  $out = '<div id="featureTOC">';
345
  $out .= '<h2>' . t('Content') . '</h2>';
346
  $out .= theme('cdm_feature_nodesTOC', array('featureNodes' => $merged_tree->root->children));
347
  $out .= '</div>';
340 348

  
341 349
  // Description.
342
  $out .= theme('cdm_featureTrees', array('mergedTrees' => $mergedTrees, 'taxon' => $taxon));
350
  $out .= theme('cdm_feature_nodes', array('mergedFeatureNodes' => $merged_tree->root->children, 'taxon' => $taxon));
343 351

  
344 352
  return $out;
345 353
}

Also available in: Unified diff