-Drupal.theme.prototype.mkdruTerm = function (term, freq, linkClass, id) {
- var html = '<a href="#"';
- if (id)
- html += ' target_id="' + id + '"';
- html += ' class="' + linkClass + '">' + term + '</a><span> (' + freq + ')</span><br/>';
+Drupal.theme.prototype.mkdruStatus = function(activeClients, clients) {
+ return Drupal.t('Waiting on ') + activeClients + Drupal.t(' out of ')
+ + clients + Drupal.t(' targets');
+};
+
+Drupal.theme.prototype.mkdruFacet = function (terms, facet, max, selections) {
+ var html = "";
+ for (var i = 0; i < terms.length && i < max; i++ ) {
+ var term = terms[i];
+ html += '<a href="'+term.toggleLink+'"';
+ if (term.selected) html += ' class="cross"><strong';
+ html += '>'+terms[i].name;
+ if (term.selected) html += "</strong>";
+ html += '</a><span> (' + terms[i].freq
+ + ')</span><br/>';
+ }
+ if (terms.length == 0 && selections && selections.length) {
+ for (var i=0; i<selections.length; i++) {
+ if (selections[i]) {
+ // since we have no target name (only id) go for the basename
+ // FIXME get the proper target name
+ var name = facet == "source" ? selections[i].replace(/.*[\/\\]/, "")
+ .replace(/\?.*/, '')
+ : selections[i];
+ html += '<a class="cross" href="'
+ + mkdru.removeLimit(facet, selections[i])
+ + '"><strong>'+name+'</strong></a><span> (0)</span><br/>';
+ }
+ }
+ }
+ return html;
+};
+
+Drupal.theme.prototype.mkdruFacetContainer = function (facetsCfg) {
+ var fs = [];
+ for (var fname in facetsCfg) {
+ facetsCfg[fname].originalKey = fname;
+ fs.push(facetsCfg[fname]);
+ }
+ fs.sort(function (a,b) { return a.orderWeight - b.orderWeight });
+ var html = '<div class="content"><table class="mkdru-facets-table"><tr>';
+ for (var i=0; i<fs.length; i++) {
+ var f = fs[i];
+ html += '<td><fieldset class="form-wrapper">'
+ html += '<legend><span class="fieldset-legend">'+f.displayName
+ +'</span></legend>';
+ html += '<div class="fieldset-wrapper">';
+ html += '<div class="mkdru-facet-list-container mkdru-facet-'
+ +f.originalKey+'"/>';
+ html += '</div>';
+ html += '</fieldset></td>'
+ }
+ html += '</tr></table></div>';