Project

General

Profile

« Previous | Next » 

Revision 3d526ffb

Added by Andreas Kohlbecker over 12 years ago

fixing #2679 (Improve Concept Relationships for Dataportal)

View differences:

5.x/modules/cdm_dataportal/cdm_dataportal.module
1296 1296

  
1297 1297

  
1298 1298
/**
1299
 * Enter description here...
1299
 * Creates a URL to the taxon page specified by the $uuid parameter.
1300
 * The URL will be prepended with a path element to a specific taxon page tab.
1301
 *
1302
 * This tab is either taken from the CDM_DATAPORTAL_DEFAULT_TAXON_TAB which can
1303
 * be set globally in the administrative settings or individually in the user
1304
 * profile. If the CDM_DATAPORTAL_DEFAULT_TAXON_TAB value is set to LAST_VISITED_TAB
1305
 * the last portal will stay on this last tab.
1306
 *
1307
 * A third option is offerered by the $page_tab parameter which allows overwriting this
1308
 * internal mechanism by a specific value.
1300 1309
 *
1301 1310
 * @param String $uuid the UUID of the taxon
1311
 * @param String $page_tab overwriting the preset mechanism by defining specific valuefor the taxon page tab.
1312
 *
1302 1313
 * @return the URL
1303 1314
 */
1304
function path_to_taxon($uuid, $no_tab = false){
1315
function path_to_taxon($uuid, $page_tab = false){
1316

  
1305 1317
  $tab = get_default_taxon_tab();
1306 1318
  $values = unserialize(CDM_DATAPORTAL_DEFAULT_TAXON_TAB);
1307 1319

  
1308 1320
  if(!$uuid) return false;
1309 1321

  
1310
  if (!$tab){
1322
  if($page_tab){
1323
    return 'cdm_dataportal/taxon/'.$uuid . '/' . $page_tab;
1324
  } else if (!$tab){
1311 1325
    return 'cdm_dataportal/taxon/'.$uuid;
1312 1326
  }else if(get_last_taxon_page_tab() &&  $tab == $values[CDM_DATAPORTAL_LAST_VISITED_TAB_ARRAY_INDEX]){
1313 1327
    return 'cdm_dataportal/taxon/'.$uuid . '/' . get_last_taxon_page_tab();
......
1316 1330
  }
1317 1331
}
1318 1332

  
1333
function uri_to_synonym($synonymUuid, $acceptedUuid){
1334
  $acceptedPath = path_to_taxon($acceptedUuid, "synonymy");
1335
  return url($acceptedPath, 'highlite='.$synonymUuid.'&acceptedFor='.$synonymUuid, $synonymUuid);
1336
}
1337

  
1319 1338
function path_to_key($keyType, $keyUuid){
1320 1339
  if(!$keyUuid || !$keyType) return false;
1321 1340
  $keyType{0} = strtolower($keyType{0});
......
1388 1407
  }
1389 1408
}
1390 1409

  
1391
function theme_cdm_uri_to_synonym($synonymUuid, $acceptedUuid, $pagePart = null){
1392
  $acceptedPath = path_to_taxon($acceptedUuid, true);
1393
  return url($acceptedPath.($pagePart ? '/'.$pagePart : ''), 'highlite='.$synonymUuid.'&acceptedFor='.$synonymUuid, $synonymUuid);
1394
}
1395 1410

  
1396 1411
/**
1397 1412
 * Preprocess the taggedName to normalize newly introduced tagtypes like hybridSign, separator, .. more?
......
1514 1529
}
1515 1530

  
1516 1531
function _is_invers_taxonRelationship($taxonRelationship, $focusedTaxon){
1517
  return $taxonRelationship->fromTaxon->uuid == $focusedTaxon->uuid;
1532
  return $taxonRelationship->toTaxon->uuid == $focusedTaxon->uuid;
1518 1533
}
1519 1534

  
1520 1535

  
......
1644 1659
  return $outArrayOfMedia;
1645 1660
}
1646 1661

  
1647
function cdm_annotations_as_footnotekeys($cdmBase, $footnote_list_key = null){
1662
/**
1663
 *
1664
 * @param - $cdmBase_list @param $cdmBase_list an array of CdmBase instances or a single instance
1665
 * @param - $footnote_list_key
1666
 */
1667
function cdm_annotations_as_footnotekeys($cdmBase_list, $footnote_list_key = null){
1648 1668
  $footNoteKeys = array();
1649 1669
  //is argument cdmBase an array?
1650
  if (!is_array($cdmBase)){
1670
  if (!is_array($cdmBase_list)){
1651 1671
    $cdmBase_array = array();
1652
    $cdmBase_array[] = $cdmBase;
1672
    $cdmBase_array[] = $cdmBase_list;
1653 1673
  }else{
1654
    $cdmBase_array = $cdmBase;
1674
    $cdmBase_array = $cdmBase_list;
1655 1675
  }
1656 1676
  //getting the key for the footnotemanager
1657 1677
  if( $footnote_list_key ){

Also available in: Unified diff