Project

General

Profile

« Previous | Next » 

Revision 6eaec849

Added by Katja Luther almost 5 years ago

implement blast search table for the result

View differences:

modules/cdm_dataportal/cdm_dataportal.module
431 431
  );
432 432

  
433 433
  $items['cdm_dataportal/occurrence'] = array(
434
      'page callback' => 'cdm_dataportal_specimen_page_view',
435
      'access arguments' => array('access cdm content'),
436
      'type' => MENU_CALLBACK,
437
      // Expected callback arguments: uuid.
438
  );
434
        'page callback' => 'cdm_dataportal_specimen_page_view',
435
        'access arguments' => array('access cdm content'),
436
        'type' => MENU_CALLBACK,
437
        // Expected callback arguments: uuid.
438
    );
439 439

  
440
    $items['cdm_dataportal/specimen/accession_number'] = array(
441
        'page callback' => 'cdm_dataportal_specimen_by_accession_number_page_view',
442
        'access arguments' => array('access cdm content'),
443
        'type' => MENU_CALLBACK,
444
        // Expected callback arguments: accession number.
445
    );
440 446
  $items['cdm_dataportal/named_area'] = array(
441 447
    'page callback' => 'cdm_dataportal_named_area_page_view',
442 448
    'access arguments' => array('access cdm content'),
......
499 505
    'access arguments' => array('access cdm content'),
500 506
    'type' => MENU_DEFAULT_LOCAL_TASK,
501 507
  );
502

  
508
if (variable_get(CDM_BLAST)) {
503 509
    $items['cdm_dataportal/search/blast'] = array(
504 510
        'title' => 'Blast', // will be passed through t()
505 511
        'page callback' => 'cdm_dataportal_view_search_blast',
506 512
        'access arguments' => array('access cdm content'),
507 513
        'type' => MENU_DEFAULT_LOCAL_TASK,
508 514
    );
509

  
515
}
510 516
  $items['cdm_dataportal/search/taxon_by_description'] = array(
511 517
    'title' => 'By content category', // will be passed through t()
512 518
    'page callback' => 'cdm_dataportal_view_search_taxon_by_description',
......
815 821

  
816 822
      if (variable_get('cdm_dataportal_show_advanced_search', 1)) {
817 823
        $block['content'] .= '<div>' . l(t('Advanced Search'), 'cdm_dataportal/search') . '</div>';
818
       // $block['content'] .= '<div>' . l(t('Blast Search'), 'cdm_dataportal/search/blast') . '</div>';
824
      }
825
      if (variable_get(CDM_BLAST)){
826
          $block['content'] .= '<div>' . l(t('Blast Search'), 'cdm_dataportal/search/blast') . '</div>';
819 827
      }
820 828
      return $block;
821 829
    case '4':
......
1588 1596

  
1589 1597
  return $taxonpage;
1590 1598
}
1599
function cdm_dataportal_specimen_by_accession_number_page_view($accession_number)
1600
{
1601
    if (isset($accession_number)) {
1602
        $specimen_or_observation = cdm_ws_get(CDM_WS_OCCURRENCE_ACCESSION_NUMBER, null, 'accessionNumber=' . $accession_number);
1603

  
1604
        if (isset($specimen_or_observation) && $specimen_or_observation){
1605
            cdm_dataportal_specimen_page_view($specimen_or_observation->uuid, $specimen_or_observation);
1606
        }
1591 1607

  
1608
    }
1609
}
1592 1610
/**
1593 1611
 * Creates a specimen page view.
1594 1612
 * @param string $uuid the UUID of the specimen
......
2085 2103
    }
2086 2104
}
2087 2105

  
2106
function path_to_specimen_by_accession_number($accession_number) {
2107

  
2108
    if (!$accession_number) {
2109
        return FALSE;
2110
    }
2111
    else {
2112
        return 'cdm_dataportal/specimen/accession_number/' . $accession_number;
2113
    }
2114
}
2115

  
2088 2116
function path_to_named_area($uuid) {
2089 2117

  
2090 2118
  if (!$uuid) {

Also available in: Unified diff