Project

General

Profile

« Previous | Next » 

Revision f659b3dd

Added by Andreas Kohlbecker over 5 years ago

work in grogress - unfinished

View differences:

modules/cdm_dataportal/cdm_api/cdm_api.module
284 284
/**
285 285
 * Finds the text tagged with $tag_type in an array of taggedText instances.
286 286
 *
287
 * Note: This function is currently unused.
288 287
 *
289 288
 * @param array $taggedtxt
290 289
 *   Array with text items.
291
 * @param string $tag_type
292
 *   The type of tag for which to find text items in the $taggedtxt array, or NULL
290
 * @param array $include_tag_types
291
 *   Array of the tag types for which to find text items in the $taggedtxt array, or NULL
293 292
 *   to return all texts.
294 293
 *
295 294
 * @return array
296 295
 *   An array with the texts mapped by $tag_type.
297 296
 */
298
function cdm_tagged_text_values(array $taggedtxt, $tag_type = NULL) {
297
function cdm_tagged_text_values(array $taggedtxt, $include_tag_types = NULL) {
299 298
  $tokens = array();
300 299
  if (!empty($taggedtxt)) {
301 300
    foreach ($taggedtxt as $tagtxt) {
302
      if ($tag_type === NULL || $tagtxt->type == $tag_type) {
301
      if ($include_tag_types === NULL || array_search($tagtxt->type, $include_tag_types) !== false) {
303 302
        $tokens[] = $tagtxt->text;
304 303
      }
305 304
    }

Also available in: Unified diff