Project

General

Profile

« Previous | Next » 

Revision 963f9de3

Added by Andreas Kohlbecker over 2 years ago

ref #8543 replacing theme_cdm_footnote_key() by cdm_footnote_key()

View differences:

modules/cdm_dataportal/includes/descriptions.inc
434 434
  $footnotes_markup = '';
435 435
  foreach ($footnote_keys as $foot_note_key) {
436 436
    try {
437
      $footnotes_markup .= theme('cdm_footnote_key',
438
        array(
439
          'footnoteKey' => $foot_note_key,
440
          'separator' => ($footnotes_markup ? $separator : '')
441
        ));
437
      $footnotes_markup .= cdm_footnote_key($foot_note_key, ($footnotes_markup ? $separator : ''));
442 438
    } catch (Exception $e) {
443 439
      drupal_set_message("Exception: " . $e->getMessage(), 'error');
444 440
    }
modules/cdm_dataportal/includes/name.inc
984 984
          // footnotes should be rendered in the parent element so we
985 985
          // are relying on the FootnoteListKey set there
986 986
          $_fkey2 = FootnoteManager::addNewFootnote(RenderHints::getFootnoteListKey(), $citation_footnote_str);
987
          $footnote_key_markup = theme('cdm_footnote_key', array(
988
            'footnoteKey' => $_fkey2,
989
            'separator' => $separator,
990
            'highlightable' => TRUE,
991
            'separator_off' => TRUE,
992
          ));
993

  
987
          $footnote_key_markup = cdm_footnote_key($_fkey2, $separator, TRUE);
994 988
        }
995 989

  
996 990
        $type_citation_markup .= '&nbsp;(' . t('designated by') . '&nbsp;<span class="typeReference">' . $authorteam_str . '</span>';
......
1070 1064
    RenderHints::getFootnoteListKey(),
1071 1065
    (isset($derivedUnitFacadeInstance->collection->titleCache) ? $derivedUnitFacadeInstance->collection->titleCache : FALSE)
1072 1066
  );
1073
  $out .= theme('cdm_footnote_key', array('footnoteKey' => $_fkey, 'separator' => $separator));
1067
  $out .= cdm_footnote_key($_fkey, $separator);
1074 1068
  $out .= '</' . $enclosing_tag .'>';
1075 1069

  
1076 1070
  RenderHints::popFromRenderStack();
......
1596 1590
  }
1597 1591
  if ($footnote_markup) {
1598 1592
    $fnkey = FootnoteManager::addNewFootnote(RenderHints::getFootnoteListKey(), $footnote_markup);
1599
    $footnote_key_markup = theme('cdm_footnote_key', array(
1600
      'footnoteKey' => $fnkey,
1601
      'separator' => ',',
1602
      'highlightable' => TRUE,
1603
      'separator_off' => TRUE,
1604
    ));
1593
    $footnote_key_markup = cdm_footnote_key($fnkey,, ',',TRUE);
1605 1594
  }
1606 1595
  return $footnote_key_markup;
1607 1596
}
......
1633 1622
  }
1634 1623
  if ($footnote_markup) {
1635 1624
    $fnkey = FootnoteManager::addNewFootnote(RenderHints::getFootnoteListKey(), $footnote_markup);
1636
    $footnote_key_markup = theme('cdm_footnote_key', array(
1637
      'footnoteKey' => $fnkey,
1638
      'separator' => ',',
1639
      'highlightable' => TRUE,
1640
      'separator_off' => TRUE,
1641
    ));
1625
    $footnote_key_markup = cdm_footnote_key($fnkey, ',',TRUE);
1642 1626
  }
1643 1627
  return $footnote_key_markup;
1644 1628
}
......
2006 1990
    // footnotes should be rendered in the parent element so we
2007 1991
    // are relying on the FootnoteListKey set there
2008 1992
    $fkey_typeDesignation = FootnoteManager::addNewFootnote(RenderHints::getFootnoteListKey(), $typeDesignation->citation->titleCache);
2009
    $res .= theme('cdm_footnote_key', array(
2010
        'footnoteKey' => $fkey_typeDesignation,
2011
        'separator' => $footnote_separator,
2012
        'highlightable' => TRUE,
2013
        'separator_off' => TRUE,
2014
      )) . ')';
1993
    $res .= cdm_footnote_key($fkey_typeDesignation, $footnote_separator,TRUE) . ')';
2015 1994
  }
2016 1995
  return $res;
2017 1996
}
modules/cdm_dataportal/includes/taxon.inc
145 145
      if($sensu_strings['order_by_key'] != $sensu_reference->titleCache){
146 146
        $sensu_reference_markup = cdm_reference_markup($sensu_reference);
147 147
        $footnote_key = FootnoteManager::addNewFootnote($footnote_list_key, $sensu_reference_markup);
148
        $footnote_key = theme('cdm_footnote_key', array('footnoteKey' => $footnote_key));
148
        $footnote_key = cdm_footnote_key(footnoteKey);
149 149
        $joined_refs[$ref_key]['markup'] = '<span class="sensu">' . $sensu_strings['markup'] . $footnote_key . '</span>';
150 150
      }
151 151
    }
modules/cdm_dataportal/theme/cdm_dataportal.common.theme
170 170
    $footNoteKeys = cdm_entity_annotations_as_footnotekeys($cdm_entities, $footnote_list_key);
171 171
  }
172 172
  foreach ($footNoteKeys as $a) {
173
    // $out .= theme('cdm_footnote_key', $a, $a->footnoteListKey, (isset($out)?
174
    // ',' : ''));
175 173
    $out .= theme('cdm_footnote_key', array('footnoteKey' => $a, 'separator' => ($out ? ',' : '')));
176 174
  }
177 175
  return $out;
......
197 195

  
198 196
/* ============================ footnotes ============================= */
199 197
/**
200
 * @todo Please document this function.
201
 * @see http://drupal.org/node/1354
198
 * Creates markup for a foot note key
199
 *
200
 * @param null $footnoteKey
201
 * @param string $separator
202
 * @param bool $separator_off
203
 *
204
 * @return string
205
 *   The footnote key markup
202 206
 */
203
function theme_cdm_footnote_key($variables) {
207
function cdm_footnote_key($footnoteKey = null, $separator = '', $separator_off = false) {
204 208

  
205
  $footnoteKey = $variables['footnoteKey'];
206
  $separator = $variables['separator'];
207
  $highlightable = $variables['highlightable'];
208
  $separator_off = $variables['separator_off'];
209 209
  if (!is_object($footnoteKey) or !isset($footnoteKey->footnoteListKey)) {
210 210
    return '';
211 211
  }
......
216 216
  if ($separator_off) {
217 217
    $separator = '';
218 218
  }
219
  $out = '<span class="footnote-key footnote-key-' . $footnoteKey->keyStr . ' member-of-footnotes-' . $footnoteKey->footnoteListKey . '">' . $separator . '<a href="#footnote-' . $footnoteKey->keyStr . '">' . $footnoteKey->keyStr . '</a>' . '</span>';
219
  $out = '<span class="footnote-key footnote-key-' . $footnoteKey->keyStr . ' member-of-footnotes-' . $footnoteKey->footnoteListKey . '">'
220
    . $separator . '<a href="#footnote-' . $footnoteKey->keyStr . '">' . $footnoteKey->keyStr . '</a>' . '</span>';
220 221
  return $out;
221 222
}
222 223

  
modules/cdm_dataportal/theme/theme_registry.inc
38 38

  
39 39
    // Themes in cdm_dataportal.common.theme.
40 40
    'cdm_entities_annotations_as_footnotekeys' => array('variables' => array('cdmBase_list' => NULL, 'footnote_list_key' => NULL)),
41
    'cdm_footnote_key' => array('variables' => array(
42
        'footnoteKey' => NULL,
43
        'separator' => '',
44
        'highlightable' => TRUE,
45
        'separator_off' => FALSE,
46
    )),
47 41
    'cdm_marker' => array('variables' => array('label' => NULL, 'attributes' => NULL)),
48 42
    'cdm_pager' => array('variables' => array('pager' => NULL, 'path' => NULL, 'parameters' => NULL)),
49 43
    'cdm_pager_link' => array('variables' => array(

Also available in: Unified diff