1 Drupal.theme.mkdruCounts = function(first, last, available, total) {
3 return '<strong>' + first + '</strong>' + Drupal.t(' to ') + '<strong>' + last + '</strong>' + Drupal.t(' of ') + '<strong>'
4 + available + '</strong>' + Drupal.t(' available');
6 return Drupal.t('No results');
9 Drupal.theme.mkdruResult = function(hit, num, detailLink) {
10 var resultclass = "mkdru-result ";
14 resultclass += "even";
16 html += '<li class="' + resultclass + '" id="rec_' + hit.recid + '" >'
17 + '<div class="mkdru-result-title"><a href="' + detailLink + '">'
18 + hit["md-title"] + '</a>';
19 if (hit["md-title-remainder"] !== undefined) {
20 html += ' <span class="mkdru-result-title-remainder">'
21 + hit["md-title-remainder"] + ' </span>';
24 if (hit["md-title-responsibility"] !== undefined) {
25 html += '<div class="mkdru-result-author"><em>'
26 + hit["md-title-responsibility"]
28 if (hit["md-date"] !== undefined) {
29 html += hit["md-date"];
33 if (hit["md-description"] !== undefined) {
34 // limit description to 400 characters
35 html += '<div class="mkdru-result-description">'
36 + String(hit["md-description"]).substr(0, 400)
44 Drupal.theme.mkdruDetail = function(data, linkBack) {
45 var html = '<table id="det_' + data.recid +'">';
46 if (data["md-title"] != undefined) {
47 html += '<tr><th>' + Drupal.t("Title") + '</th><td>'
49 if (data["md-title-remainder"] !== undefined) {
50 html += ' : <span>' + data["md-title-remainder"] + ' </span>';
52 if (data["md-title-responsibility"] !== undefined) {
53 html += ' <span><i>'+ data["md-title-responsibility"] +'</i></span>';
57 if (data["md-date"] != undefined)
58 html += '<tr><th>' + Drupal.t("Date") + '</th><td>' + data["md-date"] + '</td></tr>';
59 if (data["md-author"] != undefined)
60 html += '<tr><th>' + Drupal.t("Author") + '</th><td>' + data["md-author"] + '</td></tr>';
61 if (data["md-electronic-url"] != undefined)
62 html += '<tr><th>URL</th><td><a href="'
63 + data["md-electronic-url"] + '" target="_blank">'
64 + data["md-electronic-url"] + '</a>' + '</td></tr>';
65 // test if there is an array of per-location data; process it
66 if (Object.prototype.toString.call(data['location']) === '[object Array]') {
69 for (var i = 0; i < data['location'].length; i++) {
70 var locRec = data['location'][i];
71 // grab the first value we find for subject
72 if (!subject && locRec['md-subject']) subject = locRec['md-subject'];
73 // list named locations and link to the record there if url is available
74 var link = locRec["md-electronic-url"];
75 if (!link) link = pz2urlrecipe.getUrlFromRecipe(locRec);
76 var name = locRec["@name"]
77 if (link && name) locations += '<a href="' + link + '">' + name + '</a><br>';
78 else if (name) locations += name + '<br>';
81 html += '<tr><th>' + Drupal.t("Subject") + '</th><td>' + subject + '</td></tr>';
83 html += '<tr><th>' + Drupal.t("Location") + '</th><td>' + locations + '</td></tr>';
86 html += '<a href="' + linkBack + '">' + Drupal.t('Return to result list...') + '</a>';