Revision 8d0fe343
Added by Andreas Kohlbecker about 10 years ago
7.x/modules/cdm_dataportal/cdm_api/webservice_uris.php | ||
---|---|---|
32 | 32 |
define('CDM_WS_PORTAL_TAXON', 'portal/taxon'); |
33 | 33 |
define('CDM_WS_PORTAL_TAXON_SYNONYMY', 'portal/taxon/$0/synonymy'); |
34 | 34 |
define('CDM_WS_PORTAL_TAXON_RELATIONS', 'portal/taxon/$0/taxonRelationships'); |
35 |
define('CDM_WS_PORTAL_TAXON_NAMERELATIONS', 'portal/taxon/$0/nameRelationships'); |
|
36 | 35 |
define('CDM_WS_PORTAL_TAXON_DESCRIPTIONS', 'portal/taxon/$0/descriptions'); |
37 | 36 |
|
38 | 37 |
/** |
7.x/modules/cdm_dataportal/theme/cdm_dataportal.name.theme | ||
---|---|---|
275 | 275 |
return ($aQuantifier < $bQuantifier) ? -1 : 1; |
276 | 276 |
} |
277 | 277 |
|
278 |
/** |
|
279 |
* @todo Please document this function. |
|
280 |
* @see http://drupal.org/node/1354 |
|
281 |
*/ |
|
282 |
function theme_cdm_nameRelationships($variables) { |
|
283 |
$nameRelationships = $variables['nameRelationships']; |
|
284 |
$skipTypes = $variables['skipTypes']; |
|
285 |
if (!$nameRelationships) { |
|
286 |
return; |
|
287 |
} |
|
288 |
|
|
289 |
RenderHints::pushToRenderStack('nameRelationships'); |
|
290 |
$footnoteListKey = 'nameRelationships'; |
|
291 |
RenderHints::setFootnoteListKey($footnoteListKey); |
|
292 |
|
|
293 |
// Group by relationship type. |
|
294 |
$relationshipGroups = array(); |
|
295 |
foreach ($nameRelationships as $nameRelationship) { |
|
296 |
if (!array_key_exists($nameRelationship->type->uuid, $relationshipGroups)) { |
|
297 |
$relationshipGroups[$nameRelationship->type->uuid] = array(); |
|
298 |
} |
|
299 |
$relationshipGroups[$nameRelationship->type->uuid][] = $nameRelationship; |
|
300 |
} |
|
301 |
|
|
302 |
// Generate output. |
|
303 |
$out = ''; |
|
304 |
$block = new stdclass(); // Empty object. |
|
305 |
foreach ($relationshipGroups as $group) { |
|
306 |
$type = $group[0]->type; |
|
307 |
|
|
308 |
if (is_array($skipTypes) && in_array($type->uuid, $skipTypes)) { |
|
309 |
continue; |
|
310 |
} |
|
311 |
|
|
312 |
$block->module = 'cdm_dataportal'; |
|
313 |
$block->subject = t(ucfirst($type->inverseRepresentation_L10n)); |
|
314 |
$block->delta = generalizeString(strtolower($type->inverseRepresentation_L10n)); |
|
315 |
|
|
316 |
foreach ($group as $relationship) { |
|
317 |
$relatedNames[] = cdm_taggedtext2html($relationship->fromName->taggedName); |
|
318 |
} |
|
319 |
|
|
320 |
$block->content = implode('; ', $relatedNames); |
|
321 |
$out .= theme('block', array('elements'=>array('#block' =>$block))); |
|
322 |
} |
|
323 |
$out .= theme('cdm_footnotes', array('footnoteListKey' => $footnoteListKey, 'enclosingTag' => 'li')); |
|
324 |
|
|
325 |
RenderHints::popFromRenderStack(); |
|
326 |
return $out; |
|
327 |
} |
|
328 |
|
|
329 | 278 |
/** |
330 | 279 |
* @todo Please document this function. |
331 | 280 |
* @see http://drupal.org/node/1354 |
7.x/modules/cdm_dataportal/theme/cdm_dataportal.page.theme | ||
---|---|---|
162 | 162 |
$out .= theme('cdm_taxonRelationships', array('taxonRelationships' => $taxonRelationships, 'focusedTaxon' => $taxon)); |
163 | 163 |
} |
164 | 164 |
|
165 |
// Render name relationships. |
|
166 |
// $name_rels_to_show = variable_get('name_relationships_to_show', NULL); |
|
167 |
// $skip = array(); |
|
168 |
// if ($name_rels_to_show) { |
|
169 |
// foreach ($name_rels_to_show as $key => $value) { |
|
170 |
// if ($value === 0) { |
|
171 |
// $skip[] = $key; |
|
172 |
// } |
|
173 |
// } |
|
174 |
// if (sizeof($name_rels_to_show) != sizeof($skip)) { |
|
175 |
// $nameRelationships = cdm_ws_get(CDM_WS_PORTAL_TAXON_TO_NAMERELATIONS, $taxon->uuid); |
|
176 |
// $out .= theme('cdm_nameRelationships', array('nameRelationships' => $nameRelationships, 'skipTypes' => $skip)); |
|
177 |
// } |
|
178 |
// } |
|
179 |
|
|
180 | 165 |
RenderHints::popFromRenderStack(); |
181 | 166 |
|
182 | 167 |
return $out; |
Also available in: Unified diff
removing old obsolete code for rendering name relationships