Project

General

Profile

« Previous | Next » 

Revision f19f47fa

Added by Andreas Kohlbecker over 9 years ago

basic implementation of #4314 (taxon page: display of bibliography in a block on the taxon page)

View differences:

7.x/modules/cdm_dataportal/cdm_api/cdm_api.module
267 267
  return $profile_featureTree;
268 268
}
269 269

  
270
/**

271
 * Returns the chosen FeatureTree for SpecimenDescriptions.

272
 *

273
 * The FeatureTree returned is the one that has been set in the

274
 * dataportal settings (layout->taxon:specimen).

275
 * When the chosen FeatureTree is not found in the database,

276
 * the standard feature tree (UUID_DEFAULT_FEATURETREE) will be returned.

277
 *

278
 * @return mixed

279
 *   A cdm FeatureTree object.

280
 */
281
function cdm_get_occurrence_featureTree() {

270
/**
271
 * Returns the chosen FeatureTree for SpecimenDescriptions.
272
 *
273
 * The FeatureTree returned is the one that has been set in the
274
 * dataportal settings (layout->taxon:specimen).
275
 * When the chosen FeatureTree is not found in the database,
276
 * the standard feature tree (UUID_DEFAULT_FEATURETREE) will be returned.
277
 *
278
 * @return mixed
279
 *   A cdm FeatureTree object.
280
 */
281
function cdm_get_occurrence_featureTree() {
282 282
  static $occurrence_featureTree;
283 283

  
284 284
  if($occurrence_featureTree == NULL) {
......
290 290
      $occurrence_featureTree = cdm_ws_get(CDM_WS_FEATURETREE, UUID_DEFAULT_FEATURETREE);
291 291
    }
292 292
  }
293
  return $occurrence_featureTree;

293
  return $occurrence_featureTree;
294 294
}
295 295

  
296 296
/**
......
316 316
  return $options;
317 317
}
318 318

  
319
/**

320
 * Returns the FeatureTree for structured descriptions

321
 *

322
 * The FeatureTree returned is the one that has been set in the

323
 * dataportal settings (layout->taxon:profile).

324
 * When the chosen FeatureTree is not found in the database,

325
 * the standard feature tree (UUID_DEFAULT_FEATURETREE) will be returned.

326
 *

327
 * @return mixed

328
 *   A cdm FeatureTree object.

329
 */

330
function get_structured_description_featureTree() {

331
  static $structured_description_featureTree;

332

  
319
/**
320
 * Returns the FeatureTree for structured descriptions
321
 *
322
 * The FeatureTree returned is the one that has been set in the
323
 * dataportal settings (layout->taxon:profile).
324
 * When the chosen FeatureTree is not found in the database,
325
 * the standard feature tree (UUID_DEFAULT_FEATURETREE) will be returned.
326
 *
327
 * @return mixed
328
 *   A cdm FeatureTree object.
329
 */
330
function get_structured_description_featureTree() {
331
  static $structured_description_featureTree;
332

  
333 333
  if($structured_description_featureTree == NULL) {
334
    $structured_description_featureTree = cdm_ws_get(

335
        CDM_WS_FEATURETREE,

336
        variable_get(CDM_DATAPORTAL_STRUCTURED_DESCRIPTION_FEATURETREE_UUID, UUID_DEFAULT_FEATURETREE)

337
    );

338
    if (!$structured_description_featureTree) {

339
      $structured_description_featureTree = cdm_ws_get(

340
          CDM_WS_FEATURETREE,

341
          UUID_DEFAULT_FEATURETREE

342
      );

334
    $structured_description_featureTree = cdm_ws_get(
335
        CDM_WS_FEATURETREE,
336
        variable_get(CDM_DATAPORTAL_STRUCTURED_DESCRIPTION_FEATURETREE_UUID, UUID_DEFAULT_FEATURETREE)
337
    );
338
    if (!$structured_description_featureTree) {
339
      $structured_description_featureTree = cdm_ws_get(
340
          CDM_WS_FEATURETREE,
341
          UUID_DEFAULT_FEATURETREE
342
      );
343 343
    }
344
  }

345
  return $structured_description_featureTree;

344
  }
345
  return $structured_description_featureTree;
346 346
}
347 347

  
348 348
/**
......
2069 2069

  
2070 2070
  // now set the labels
2071 2071
  //   for none
2072
  if ($add_none_option) {

2073
    $taxonomic_tree_options['NONE'] = t('-- None --');

2072
  if ($add_none_option) {
2073
    $taxonomic_tree_options['NONE'] = t('-- None --');
2074 2074
  }
2075 2075

  
2076 2076
  //   for default_classification
......
2152 2152
 *
2153 2153
 * An object is considered a cdm entity if it has a string field $object->class
2154 2154
 * with at least 3 characters and if it has a valid uuid in $object->uuid.
2155
 * The function is null save.
2155 2156
 *
2156 2157
 * @author a.kohlbecker <a.kohlbecker@bgbm.org>
2157 2158
 *
......
2162 2163
 *   True if the object is a cdm entity.
2163 2164
 */
2164 2165
function is_cdm_entity($object) {
2165
  return is_string($object->class) && strlen($object->class) > 2 && is_string($object->uuid) && is_uuid($object->uuid);
2166
  return isset($object->class) && is_string($object->class) && strlen($object->class) > 2 && is_string($object->uuid) && is_uuid($object->uuid);
2166 2167
}
2167 2168

  
2168 2169
/**

Also available in: Unified diff