Project

General

Profile

Revision 6eaec849

ID6eaec8496bd0ce44b1ac261c6d0db7c3734f951d
Parent 9a7fc46c
Child 55a557d8

Added by Katja Luther over 1 year ago

implement blast search table for the result

View differences:

modules/cdm_dataportal/includes/occurrences.inc
41 41
    ));
42 42
    $gallery_settings = getGallerySettings(CDM_DATAPORTAL_SPECIMEN_GALLERY_NAME);
43 43
    $captionElements = array(
44
        'title',
44 45
        '#uri' => t('open media'),
45 46
    );
46 47
    if (isset($specimen->fieldObjectMediaDTO) ) {
......
260 261
            }
261 262
        }
262 263

  
264

  
265

  
263 266
        $gallery_html = compose_cdm_media_gallerie(array(
264 267
            'mediaList' => $images,
265 268
            'galleryName' => $galleryName,
......
268 271
            'maxRows' => isset($gallery_settings['cdm_dataportal_media_maxRows']) ? isset($gallery_settings['cdm_dataportal_media_maxRows']) : null,
269 272
            'captionElements' => $captionElements,
270 273
            'mediaLinkType' => 'LIGHTBOX',
271
            'alternativeMediaUri' => $alternativeMediaUris,
274
          // 'alternativeMediaUri' => $alternativeMediaUris,
275
            'alternativeMediaUri' => NULL,
272 276
            'galleryLinkUri' => NULL,
273 277
        ));
274 278
    }
......
462 466
                            $taxon_name = '';
463 467
                            $name_link = '';
464 468
                            if ($determinationEvent->taxonName) {
465
                                $taxon_name = $determinationEvent->taxonName;
466
                            } else if ($determinationEvent->taxon) {
467
                                $taxon_name = cdm_ws_get(CDM_WS_TAXON . '/$0/name', $determinationEvent->taxon->uuid);
468
                                $name_link = path_to_taxon($determinationEvent->taxon->uuid);
469
                                $taxon_name = cdm_ws_get(CDM_WS_NAME, $determinationEvent->taxonName->uuid);
470
                                $taxon_name->taggedName = cdm_ws_get(CDM_WS_NAME, array($determinationEvent->taxonName->uuid, "taggedName"));
471
                                $name_link = path_to_name($determinationEvent->taxonName->uuid);
472
                            }else if ($determinationEvent->taxon) {
473
                                 $taxon_name = cdm_ws_get(CDM_WS_TAXON . '/$0/name', $determinationEvent->taxon->uuid);
474
                                 $name_link = path_to_taxon($determinationEvent->taxon->uuid);
469 475
                            }
470 476
                            if ($taxon_name) {
471 477
                                $taxon_html = render_taxon_or_name($taxon_name, $name_link);
......
1033 1039
            }
1034 1040
        }
1035 1041

  
1036
        $title = $type_label . ': ' . $specimen_or_observation->titleCache;
1042
        if (isset($typeDesignation)){
1043
            $title = $type_label . ' for: ' . $typeDesignation->typifiedNames;
1044
        }else{
1045
            $title = $type_label;
1046
        }
1047

  
1037 1048
        $items['data'] = $title;
1038 1049

  
1039 1050
        $groups = array();
......
1074 1085

  
1075 1086
                    case 'listOfMedia':
1076 1087
                        $gallery_settings = getGallerySettings(CDM_DATAPORTAL_SPECIMEN_GALLERY_NAME);
1088

  
1077 1089
                        $captionElements = array(
1090
                            'title',
1078 1091
                            '#uri' => t('open media'),
1079 1092
                        );
1080 1093
                        $gallery_html = compose_cdm_media_gallerie(array(
......
1087 1100
                            'mediaLinkType' => 'LIGHTBOX',
1088 1101
                            'alternativeMediaUri' => NULL,
1089 1102
                            'galleryLinkUri' => NULL,
1103
                            'showCaption' => true
1090 1104
                        ));
1091 1105

  
1092 1106
                         //@_description_list_group_add($groups, cdm_occurrence_field_name_label($field), $gallery_html);
......
1232 1246
    return $output;
1233 1247
}
1234 1248

  
1249
function compose_table_of_blast_result(array $data){
1250

  
1251
    foreach ($data as $row_data){
1252
        $pathToSpecimen = path_to_specimen_by_accession_number($row_data['id']);
1253
        $specimenPageLink = l($row_data['id'], $pathToSpecimen, array('attributes' => array('target' => '_blank')));
1254

  
1255
        $rows[] =  array(
1256
            'data' => array(
1257
                array(
1258
                    'data' => $row_data['def'],
1259
                ),
1260
                array(
1261
                    'data' => $specimenPageLink,
1262
                ),
1263
                array(
1264
                    'data' => $row_data['hsp_align_length'],
1265
                ),
1266
              //  array(
1267
              //     'data' => $row_data['midline'],
1268
              //  ),
1269
                array(
1270
                    'data' => $row_data['hsp_evalue'],
1271
                )
1272
            )
1273
        );
1274
    }
1275
    $tableId = "blast_result_table";
1276
    $blast_result_table = array(
1277
        "#theme" => "table",
1278
        "#weight" => 2,
1279
        "#header" => array(
1280
                        "Name", "id", "Align Length", "e Value"),
1281
        "#rows" => $rows,
1282
        "#attributes" => array(
1283
            "id" => $tableId,
1284
            "border" => 2
1285
        )
1286
    );
1287

  
1288
    drupal_add_js_rowToggle("#".$tableId);
1289

  
1290
    $render_array['content'] = $blast_result_table;
1291
    $out = drupal_render($render_array);
1292
   //$blast_result_page-> content = drupal_render($render_array);
1293
   return $out;
1294
}
1295

  
1296

  
1297

  

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)