Project

General

Profile

« Previous | Next » 

Revision 6aad9da8

Added by Andreas Kohlbecker about 8 years ago

fixing bugs in name rendering

View differences:

modules/cdm_dataportal/cdm_api/cdm_api.module
193 193
  return $out;
194 194
}
195 195

  
196

  
196 197
/**
197 198
 * Finds the text tagged with $tag_type in an array of taggedText instances.
198 199
 *
......
201 202
 * @param array $taggedtxt
202 203
 *   Array with text items.
203 204
 * @param string $tag_type
204
 *   The type of tag for which to find text items in the $taggedtxt array.
205
 *   The type of tag for which to find text items in the $taggedtxt array, or NULL
206
 *   to return all texts.
205 207
 *
206 208
 * @return array
207 209
 *   An array with the texts mapped by $tag_type.
208 210
 */
209
function cdm_tagged_text_values(array $taggedtxt, $tag_type) {
211
function cdm_tagged_text_values(array $taggedtxt, $tag_type = NULL) {
210 212
  $tokens = array();
211 213
  if (!empty($taggedtxt)) {
212 214
    foreach ($taggedtxt as $tagtxt) {
213
      if ($tagtxt->type == $tag_type) {
215
      if ($tag_type === NULL || $tagtxt->type == $tag_type) {
214 216
        $tokens[] = $tagtxt->text;
215 217
      }
216 218
    }
......
218 220
  return $tokens;
219 221
}
220 222

  
221

  
222 223
/**
223 224
 * Preprocess the taggedTitle arrays.
224 225
 *

Also available in: Unified diff