Project

General

Profile

« Previous | Next » 

Revision db725031

Added by Andreas Kohlbecker about 4 years ago

ref #7495 Registration page implemented

View differences:

modules/cdm_dataportal/cdm_dataportal.module
1318 1318
 * also subordinate objects will be converted.
1319 1319
 *
1320 1320
 * @param object $object
1321
 * @return the array
1321
 *  the object to be converted
1322
 * @return array
1323
 *  The array
1322 1324
 */
1323
function convert_to_array($object) {
1325
function object_to_array($object) {
1324 1326
  if(is_object($object) || is_array($object)) {
1325 1327
    $array = (array)$object;
1326 1328
    foreach ($array as $key=>$value){
1327
      $array[$key] = convert_to_array($value);
1329
      $array[$key] = object_to_array($value);
1328 1330
    }
1329 1331
    return $array;
1330 1332
  } else {
......
1847 1849
      . "</br>&nbsp;</div>");
1848 1850
    $render_array['summary'] = markup_to_render_array("<div>" . cdm_tagged_text_to_markup($registration_dto->summaryTaggedText) . "</div>");
1849 1851

  
1850
//    $registration = cdm_ws_get("registration/identifier/" . $registration_identifier_encoded);
1851
//    if(is_array($registration->typeDesignations)){
1852
//      $type_designations_markup = "";
1853
//      foreach ($registration->typeDesignations as $type_designation){
1854
//        $type_designations_markup .= render_cdm_specimen($type_designation);
1855
//      }
1856
//      $render_array['type_designations'] = markup_to_render_array($type_designations_markup);
1857
//    }
1852
    if(is_object($registration_dto->orderdTypeDesignationWorkingSets)){
1853

  
1854
      $field_unit_uuids = array();
1855
      foreach((array)$registration_dto->orderdTypeDesignationWorkingSets as $field_unit_ref => $obj){
1856
        $tokens = explode("#", $field_unit_ref);
1857
        $field_unit_uuids[] = $tokens[1];
1858
      }
1859
      $render_array['specimen_table'] = compose_derivate_hierarchy_table($field_unit_uuids);
1860
    }
1858 1861

  
1859 1862
  } else {
1860 1863
    drupal_set_title(t('Registration not found'), PASS_THROUGH);
modules/cdm_dataportal/includes/name.inc
82 82
  if($split_render_templates == NULL) {
83 83
    $render_templates = variable_get(CDM_NAME_RENDER_TEMPLATES, $default_render_templates);
84 84
    // needs to be converted to an array
85
    $render_templates = (convert_to_array($render_templates));
85
    $render_templates = (object_to_array($render_templates));
86 86

  
87 87
    // separate render templates which are combined with a comma
88 88
    $split_render_templates = array();
......
226 226

  
227 227
  static $part_definitions = null;
228 228
  if (!isset($part_definitions)) {
229
    $part_definitions = convert_to_array(variable_get(CDM_PART_DEFINITIONS, $default_part_definitions));
229
    $part_definitions = object_to_array(variable_get(CDM_PART_DEFINITIONS, $default_part_definitions));
230 230
  }
231 231

  
232 232
  $dtype = nameTypeToDTYPE($taxonNameType);
modules/cdm_dataportal/includes/pages.inc
99 99
        $occurrence_query = $occurrence_queryDto->occurrenceQuery;
100 100
        $legend_format_query = null;
101 101
        $distribution_query = NULL;
102
        $render_array['map'] = compose_map('specimens', $occurrence_query, $distribution_query, $legend_format_query, array());
102
        $map_render_array = compose_map('specimens', $occurrence_query, $distribution_query, $legend_format_query, array());
103 103
      }
104 104
    }
105

  
106
    // -------------------------------------------------------
107
    $render_array['map'] = $map_render_array;
108

  
105 109
    if(variable_get('cdm_dataportal_compressed_specimen_derivate_table')){
106 110

  
107 111
        //COMPRESSED SPECIMEN DERIVATE TABLE

Also available in: Unified diff