Project

General

Profile

« Previous | Next » 

Revision b8bfa4bd

Added by Andreas Kohlbecker almost 11 years ago

#3309 (taxon page tab keys: redirect if only one key) implemented

View differences:

7.x/modules/cdm_dataportal/cdm_dataportal.module
1614 1614
}
1615 1615

  
1616 1616
/**
1617
 * @todo Please document this function.
1618
 * @see http://drupal.org/node/1354
1617
 * Compses the drupal path to the key identified by the uuid.
1618
 *
1619
 * @param string $keyType
1620
 *    the key typer corresponds to the specific class of the CDM
1621
 *    IdentificationKey. Possible values are
1622
 *      -PolytomousKey
1623
 *      -MultimediaKey
1624
 *      - ...
1625
 * @param UUID $keyUuid
1626
 *   The UUID of the key
1619 1627
 */
1620 1628
function path_to_key($keyType, $keyUuid) {
1621 1629
  if (!$keyUuid || !$keyType) {
7.x/modules/cdm_dataportal/theme/cdm_dataportal.page.theme
254 254
  }
255 255

  
256 256
  // --- PAGE PART: KEYS --- //
257
  if ($identificationKeyCount > 0 && ($page_part == 'keys' || $page_part == 'all')) {
257
  if ($identificationKeyCount == 1 && $page_part == 'keys'){
258
    drupal_goto(path_to_key($polytomousKeysPager->records[0]->class, $polytomousKeysPager->records[0]->uuid));
259
  }
260
  else if ($identificationKeyCount > 0 && ($page_part == 'keys' || $page_part == 'all')) {
258 261
    $keys_html = '<div id="keys">';
259 262
    if ($page_part == 'all') {
260 263
      $keys_html .= '<h2>' . t('Keys') . '</h2>';

Also available in: Unified diff