Project

General

Profile

« Previous | Next » 

Revision d5577d1e

Added by Andreas Kohlbecker about 6 years ago

moving method to includes/

View differences:

modules/cdm_dataportal/includes/references.inc
61 61
      $result = $result_parts[0] . ' et al.';
62 62
  }
63 63
  return $result;
64
}
65

  
66
/**
67
 * Creates a pager widget for the given CDM Pager containing CDM Reference entities.
68
 *
69
 * @param $referencePager object
70
 *    A CDM Pager  containing CDM Reference entities
71
 * @param $path
72
 *    The base path to be used when generating the pager item links
73
 * @$parameters
74
 *
75
 * @return string
76
 *   Markup
77
 */
78
function cdm_reference_pager($referencePager, $path, $parameters) {
79

  
80
  drupal_set_title(t('Bibliographic index'), PASS_THROUGH);
81
  $out = '';
82
  if (count($referencePager->records) > 0) {
83
    $out .= '<ul>';
84
    foreach ($referencePager->records as $reference) {
85
      // FIXME remove hack.
86
      $reference->fullCitation = $reference->titleCache;
87
      // For matching cdm entity to STO.
88
      $out .= '<li>' . theme('cdm_reference', array(
89
          'reference' => $reference,
90
          'microReference' => NULL,
91
          'doLink' => TRUE,
92
        )) . '</li>';
93
    }
94
    $out .= '</ul>';
95
    $out .= theme('cdm_pager', array(
96
      'pager' => $referencePager,
97
      'path' => $path,
98
      'parameters' => $parameters,
99
    ));
100
  }
101
  else {
102
    $out = '<h4 class="error">Sorry, this page contains not entries.</h4>';
103
  }
104
  return $out;
64 105
}
modules/cdm_dataportal/theme/cdm_dataportal.references.theme
13 13
 * @see http://www.mozilla.org/MPL/MPL-1.1.html
14 14
 */
15 15

  
16
/**
17
 * Creates a pager widget for the given CDM Pager containing CDM Reference entities.
18
 *
19
 * @param $referencePager object
20
 *    A CDM Pager  containing CDM Reference entities
21
 * @param $path
22
 *    The base path to be used when generating the pager item links
23
 * @$parameters
24
 *
25
 * @return string
26
 *   Markup
27
 */
28
function cdm_reference_pager($referencePager, $path, $parameters) {
29

  
30
  drupal_set_title(t('Bibliographic index'), PASS_THROUGH);
31
  $out = '';
32
  if (count($referencePager->records) > 0) {
33
    $out .= '<ul>';
34
    foreach ($referencePager->records as $reference) {
35
      // FIXME remove hack.
36
      $reference->fullCitation = $reference->titleCache;
37
      // For matching cdm entity to STO.
38
      $out .= '<li>' . theme('cdm_reference', array(
39
        'reference' => $reference,
40
        'microReference' => NULL,
41
        'doLink' => TRUE,
42
        )) . '</li>';
43
    }
44
    $out .= '</ul>';
45
    $out .= theme('cdm_pager', array(
46
      'pager' => $referencePager,
47
      'path' => $path,
48
      'parameters' => $parameters,
49
    ));
50
  }
51
  else {
52
    $out = '<h4 class="error">Sorry, this page contains not entries.</h4>';
53
  }
54
  return $out;
55
}
56 16

  
57 17
/**
58 18
 * Creates a HTML representations for a CDM Reference instance..

Also available in: Unified diff