+ if (!config.switch) {
+ $("#mkwsSwitch").css("display", "none");
+ }
+}
+
+function mkws_html_sort(config) {
+ var sort_html = '<select name="sort" id="sort">';
+
+ for(var i = 0; i < config.sort.length; i++) {
+ var key = config.sort[i][0];
+ var val = config.sort[i].length == 1 ? config.sort[i][0] : config.sort[i][1];
+
+ sort_html += '<option value="' + key + '"';
+ if (key == config.sort_default) {
+ sort_html += ' selected="selected"';
+ }
+ sort_html += '>' + val + '</option>';
+ }
+ sort_html += '</select>';
+
+ return sort_html;
+}
+
+function mkws_html_perpage(config) {
+ var perpage_html = '<select name="perpage" id="perpage">';
+
+ for(var i = 0; i < config.perpage.length; i++) {
+ var key = config.perpage[i];
+
+ perpage_html += '<option value="' + key + '"';
+ if (key == config.perpage_default) {
+ perpage_html += ' selected="selected"';
+ }
+ perpage_html += '>' + key + '</option>';
+ }
+ perpage_html += '</select>';
+
+ return perpage_html;