Project

General

Profile

« Previous | Next » 

Revision 22f5e82d

Added by Andreas Kohlbecker over 9 years ago

refactoring theme_cdm_descriptionElementTextData() #3484 , mock implementation of feature block settings #3257, solves most issues of #3915 (handling of annotations and sources inconsistent in theme_cdm_descriptionElementTextData)

View differences:

7.x/themes/garland_cichorieae/template.php
8 8
 * @todo Please document this function.
9 9
 * @see http://drupal.org/node/1354
10 10
 */
11
function garland_cichorieae_cdm_descriptionElementTextData($variables) {
11
function DISABLED_garland_cichorieae_cdm_descriptionElementTextData($variables) {
12 12
  $element = $variables['element'];
13 13
  $asListElement = $variables['asListElement'];
14 14
  $feature_uuid = $variables['feature_uuid'];
15 15

  
16
  $sourceRefs = '';
17

  
16 18
  $description = '';
17 19
  if (isset($element->multilanguageText_L10n->text)) {
18 20
    $description = str_replace("\n", "<br/>", $element->multilanguageText_L10n->text);
19 21
  }
20
  $sourceRefs = '';
22

  
23
  // annotations footnotes.
24
  $annotation_fkeys = theme('cdm_annotations_as_footnotekeys',
25
    array(
26
      'cdmBase_list' => $element,
27
      'footnote_list_key' => $feature_uuid,
28
    )
29
  );
21 30

  
22 31
  // ---------------------------------------------------------------------------
23
  // CUSTOM CODE (1) the below neds to become configurable in the settings
32
  // CUSTOM CODE (1) the below needs to become configurable in the settings
24 33
  $default_theme = variable_get('theme_default', 'garland_cichorieae');
25 34

  
26 35
  if (($default_theme == 'flora_malesiana' || $default_theme == 'flore_afrique_centrale' || $default_theme == 'flore_gabon') && $element->feature->titleCache == 'Citation') {
......
33 42
    $asListElement = FALSE;
34 43
  }
35 44

  
36
  // Printing annotations footnotes.
37
  $annotation_fkeys = theme('cdm_annotations_as_footnotekeys',
38
    array(
39
      'cdmBase_list' => $element,
40
      'footnote_list_key' => $feature_uuid,
41
    )
42
  );
43

  
44 45
  // END CUSTOM CODE (1)
45 46
  // ---------------------------------------------------------------------------
46 47

  
48
  // original sources
47 49
  if (is_array($element->sources)) {
48 50
    foreach ($element->sources as $source) {
49 51
      // ---------------------------------------------------------------------------
50 52
      // CUSTOM CODE (2)
51
      // Initialize some variables.
52 53
      if ($feature_uuid == UUID_CITATION) {
53 54
        $referenceCitation = cdm_ws_get(
54 55
          CDM_WS_NOMENCLATURAL_REFERENCE_CITATION,
......
77 78
      }
78 79
      // ----------------------------------------------------------------------------
79 80
      // CITATION special cases - needs to go into core code
81

  
82
      // link the nameUsedInSource to the according name page
80 83
      $name_used_in_source_link_to_show = '';
81 84
      if (isset($source->nameUsedInSource->uuid) && ($feature_uuid != UUID_CITATION)) {
82 85
        // It is a DescriptionElementSource && !CITATION
......
104 107
      }
105 108
      // ----------------------------------------------------------------------------
106 109

  
110
      // final composition of the TextData element
107 111
      if ($asListElement && ($feature_uuid == UUID_CITATION)) {
108 112
        $out = '<li class="descriptionText">' . $name_used_in_source_link_to_show;
109 113
        // Adding ":" if necessary.
110
        if (!empty($name_used_in_source_link_to_show) && (!empty($description) || !empty($sourceRefs))) {
114
        if (!empty($name_used_in_source_link_to_show) &&
115
          (!empty($description) || !empty($sourceRefs))) {
111 116
          $out .= ': ';
112 117
        }
113 118

  
......
149 154
        if (isset($name_used_in_source_link_to_show)) {
150 155
          $name_used_in_source_link_to_show = ' (name in source: ' . $name_used_in_source_link_to_show . ')';
151 156
        }
152
        $out = '<span class="' . html_class_attribute_ref($element) . '"> ' . $description . $sourceRefs . $name_used_in_source_link_to_show . $annotation_fkeys . '</span>';
157
        $out = '<span class="' . html_class_attribute_ref($element) . '"> '
158
          . $description . $sourceRefs . $name_used_in_source_link_to_show . $annotation_fkeys . '</span>';
153 159
      }
154 160
    }
155 161
  }
156 162

  
157 163
  // If no sources, print the description.
158 164
  if (!isset($out)) {
159
    $out = '<span class="' . html_class_attribute_ref($element) . '"> ' . $description . $annotation_fkeys . '</span>';
165
    $out = '<span class="' . html_class_attribute_ref($element) . '"> '
166
      . $description . $annotation_fkeys . '</span>';
160 167
  }
161 168

  
162 169
  // Add annotations as footnote key.

Also available in: Unified diff