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
}

Also available in: Unified diff