Project

General

Profile

Revision 87b304a7

ID87b304a76f5eb08bb24b2907fc4cffaa387a84ef
Parent 7272d19c
Child 7ca5ef1e

Added by Andreas Kohlbecker over 3 years ago

refactoring: refactored functions moved into includes

View differences:

modules/cdm_dataportal/theme/cdm_dataportal.references.theme
130 130
}
131 131

  
132 132
/**
133
 * Cleanup of the textual short form of an author team.
134
 *
135
 * The cdm fails to create correct representations of author teams.
136
 * The '&' gluing the authors together need to be cleaned up.
137
 *
138
 * @param $author_team
139
 *  the authorTeam string
140
 *
141
 * @return string
142

  
143
 */
144
function _short_form_of_author_team($author_team) {
145
  $number_of_authors = substr_count($author_team, ' & ') + 1;
146
  // var_dump($author_team);
147
  // var_dump($number_of_authors);
148
  switch ($number_of_authors) {
149
    case 1:
150
      $result = $author_team;
151
      break;
152

  
153
    case 2:
154
      $result = str_replace(' & ', ' and ', $author_team);
155
      break;
156

  
157
    default:
158
      $result_parts = explode(' & ', $author_team);
159
      $result = $result_parts[0] . ' et al.';
160
  }
161
  return $result;
162
}
163

  
164
/**
165 133
 * @todo Please document this function.
166 134
 * @see http://drupal.org/node/1354
167 135
 */

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)