Project

General

Profile

« Previous | Next » 

Revision d8069342

Added by Andreas Kohlbecker over 2 years ago

ref #8543 further harmonizing footnote functions

View differences:

modules/cdm_dataportal/theme/cdm_dataportal.common.theme
119 119

  
120 120
/* ============================ annotations ============================= */
121 121

  
122
/**
123
 * Returns HTML for annotations to cdm objects.
124
 *
125
 * Almost any cdmObject may be annotated. Therefore we provide a generic way to
126
 * display as well as create or update annotations. The following cdm classes
127
 * are annotatable:
128
 *
129
 * - DescriptionElementBase
130
 * - EventBase
131
 * - HomotypicalGroup
132
 * - IdentifiableEntity
133
 * - DescriptionBase
134
 * - IdentifiableMediaEntity
135
 * - Media
136
 * - Sequence
137
 * - TaxonBase
138
 * - TaxonName
139
 * - TaxonomicTree
140
 * - TermBase
141
 * - LanguageStringBase
142
 * - ReferencedEntityBase
143
 * - NomenclaturalStatus
144
 * - OriginalSourceBase
145
 * - RelationshipBase
146
 * - TypeDesignationBase
147
 * - TaxonNode
148
 * - WorkingSet
149
 *
150
 * @param array $cdm_entities
151
 *   An array of CdmBase instances.
152
 * @param $footnote_list_key_suggestion string
153
 *    optional parameter. If this parameter is left empty (null, 0, "") the
154
 *   footnote key will be determined be set to
155
 *   RenderHints::getFootnoteListKey().FOOTNOTE_KEY_SUFFIX_ANNOTATIONS otherwise the supplied
156
 *   key will be used.
157
 *
158
 * @return string
159
 *   The markup.
160
 */
161
function cdm_entities_annotations_as_footnotekeys($cdm_entities, $footnote_list_key =null){
162

  
163
  // check if footnotes for annotations are disabled completely
164
  if (variable_get('cdm_dataportal_annotations_footnotes', CDM_DATAPORTAL_ALL_FOOTNOTES)) {
165
    return '';
166
  }
167
  $out = '';
168
  if(is_array($cdm_entities)){
169
    // array of entities
170
    $footNoteKeys = cdm_entities_annotations_footnote_keys($cdm_entities, $footnote_list_key);
171
  } else {
172
    // single entity
173
    $footNoteKeys = cdm_entity_annotations_as_footnote_keys($cdm_entities, $footnote_list_key);
174
  }
175
  foreach ($footNoteKeys as $a) {
176
    $out .= cdm_footnote_key($a, ($out ? ',' : ''));
177
  }
178
  return $out;
179
}
180

  
181 122
/**
182 123
 * Created markup for the annotations
183 124
 * @param null $annotations

Also available in: Unified diff