Revision 4295d33d
Added by Andreas Kohlbecker about 7 years ago
modules/cdm_dataportal/includes/descriptions.inc | ||
---|---|---|
1990 | 1990 |
} |
1991 | 1991 |
|
1992 | 1992 |
|
1993 |
/** |
|
1994 |
* Provides the content for a block of Uses Descriptions for a given taxon. |
|
1995 |
* |
|
1996 |
* Fetches the list of TaxonDescriptions tagged with the MARKERTYPE_USE |
|
1997 |
* and passes them to the theme function theme_cdm_UseDescription(). |
|
1998 |
* |
|
1999 |
* @param string $taxon_uuid |
|
2000 |
* The uuid of the Taxon |
|
2001 |
* |
|
2002 |
* @return array |
|
2003 |
* A drupal render array |
|
2004 |
*/ |
|
2005 |
function cdm_block_use_description_content($taxon_uuid) { |
|
2006 |
|
|
2007 |
$use_description_content = ''; |
|
2008 |
|
|
2009 |
if (is_uuid($taxon_uuid )) { |
|
2010 |
$markerTypes = array(); |
|
2011 |
$markerTypes['markerTypes'] = UUID_MARKERTYPE_USE; |
|
2012 |
$useDescriptions = cdm_ws_fetch_all(CDM_WS_PORTAL_TAXON . '/' . $taxon_uuid . '/descriptions', $markerTypes); |
|
2013 |
if (!empty($useDescriptions)) { |
|
2014 |
$use_description_content = theme('cdm_UseDescription', array('description' => $useDescriptions, 'taxonUuid' => $taxon_uuid)); |
|
2015 |
} |
|
2016 |
} |
|
2017 |
|
|
2018 |
return markup_to_render_array($use_description_content); |
|
2019 |
} |
|
2020 |
|
|
2021 |
|
modules/cdm_dataportal/theme/cdm_dataportal.descriptions.theme | ||
---|---|---|
487 | 487 |
|
488 | 488 |
return $out; |
489 | 489 |
} |
490 |
|
|
491 |
|
|
492 |
/** |
|
493 |
* Provides the content for a block of Uses Descriptions for a given taxon. |
|
494 |
* |
|
495 |
* Fetches the list of TaxonDescriptions tagged with the MARKERTYPE_USE |
|
496 |
* and passes them to the theme function theme_cdm_UseDescription(). |
|
497 |
* |
|
498 |
* @param string $taxon_uuid |
|
499 |
* The uuid of the Taxon |
|
500 |
* |
|
501 |
* @return array |
|
502 |
* A drupal render array |
|
503 |
*/ |
|
504 |
function cdm_block_use_description_content($taxon_uuid) { |
|
505 |
|
|
506 |
$use_description_content = ''; |
|
507 |
|
|
508 |
if (is_uuid($taxon_uuid )) { |
|
509 |
$markerTypes = array(); |
|
510 |
$markerTypes['markerTypes'] = UUID_MARKERTYPE_USE; |
|
511 |
$useDescriptions = cdm_ws_fetch_all(CDM_WS_PORTAL_TAXON . '/' . $taxon_uuid . '/descriptions', $markerTypes); |
|
512 |
if (!empty($useDescriptions)) { |
|
513 |
$use_description_content = theme('cdm_UseDescription', array('description' => $useDescriptions, 'taxonUuid' => $taxon_uuid)); |
|
514 |
} |
|
515 |
} |
|
516 |
|
|
517 |
return markup_to_render_array($use_description_content); |
|
518 |
} |
Also available in: Unified diff
ref #6374 moving cdm_block_use_description_content to includes files