html += '</li>';
return html;
};
+
+Drupal.theme.mkdruFacetContainer = function (facetsData, 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 = '<h2>Facet browser</h2><div class="content">';
+ for (var i=0; i<fs.length; i++) {
+ var f = fs[i];
+ html += '<fieldset class="form-wrapper">'
+ html += '<legend><span class="fieldset-legend">'+f.displayName
+ +'</span></legend>';
+ html += '<div class="mkdru-facet-'+f.originalKey+'"/>';
+ html += '</fieldset>'
+ }
+ html += '</div>';
+ return html;
+};
+
function mkdruding2_preprocess_page(&$vars, $hook) {
//wouold be nice to include this only during search hook
drupal_add_js(drupal_get_path('theme', 'mkdruding2') . '/mkdruding2.js');
+ //for mkdru to generate facet container client-side in the given element
+ drupal_add_js(array('mkdru' => array('facetContainerSelector' =>
+ '#block-ding-facetbrowser-facetbrowser')), 'setting');
}