Lines 231-268
$( document ).ready( function () {
Link Here
|
231 |
var pref_value = this.value; |
231 |
var pref_value = this.value; |
232 |
var prefs = pref_value.split("|"); |
232 |
var prefs = pref_value.split("|"); |
233 |
|
233 |
|
234 |
|
234 |
let data = db_columns[datasource]; |
235 |
|
235 |
var items = []; |
236 |
$.getJSON( themelang + "/modules/admin/preferences/" + datasource + ".json", function( data ){ |
236 |
var checked = ""; |
237 |
var items = []; |
237 |
var readonly = ""; |
238 |
var checked = ""; |
238 |
var disabled = ""; |
239 |
var readonly = ""; |
239 |
var style = ""; |
240 |
var disabled = ""; |
240 |
$.each( Object.keys(data).sort(), function( i, key ){ |
241 |
var style = ""; |
241 |
if( prefs.indexOf( key ) >= 0 ){ |
242 |
$.each( data, function( key, val ){ |
242 |
checked = ' checked="checked" '; |
243 |
if( prefs.indexOf( val ) >= 0 ){ |
243 |
} else { |
244 |
checked = ' checked="checked" '; |
244 |
checked = ""; |
245 |
} else { |
245 |
} |
246 |
checked = ""; |
246 |
if( required.indexOf( key ) >= 0 ){ |
247 |
} |
247 |
style = "required"; |
248 |
if( required.indexOf( val ) >= 0 ){ |
248 |
checked = ' checked="checked" '; |
249 |
style = "required"; |
249 |
} else if( exclusions.indexOf( key ) >= 0 ){ |
250 |
checked = ' checked="checked" '; |
250 |
style = "disabled"; |
251 |
} else if( exclusions.indexOf( val ) >= 0 ){ |
251 |
disabled = ' disabled="disabled" '; |
252 |
style = "disabled"; |
252 |
checked = ""; |
253 |
disabled = ' disabled="disabled" '; |
253 |
} else { |
254 |
checked = ""; |
254 |
style = ""; |
255 |
} else { |
255 |
disabled = ""; |
256 |
style = ""; |
256 |
} |
257 |
disabled = ""; |
257 |
items.push('<label class="' + style +'"><input class="dbcolumn_selection" type="checkbox" id="' + key + '"' + checked + disabled + ' name="pref" value="' + key + '" /> ' + data[key]+ ' (' + key + ')</label>'); |
258 |
} |
|
|
259 |
items.push('<label class="' + style +'"><input class="dbcolumn_selection" type="checkbox" id="' + key + '"' + checked + disabled + ' name="pref" value="' + key + '" /> ' + val + ' (' + key + ')</label>'); |
260 |
}); |
261 |
$("<div/>", { |
262 |
"class": "columns-2", |
263 |
html: items.join("") |
264 |
}).appendTo("#prefModalForm"); |
265 |
}); |
258 |
}); |
|
|
259 |
$("<div/>", { |
260 |
"class": "columns-2", |
261 |
html: items.join("") |
262 |
}).appendTo("#prefModalForm"); |
263 |
|
266 |
$("#saveModalPrefs").data("target", this.id ); |
264 |
$("#saveModalPrefs").data("target", this.id ); |
267 |
$("#prefModalLabel").text( pref_name ); |
265 |
$("#prefModalLabel").text( pref_name ); |
268 |
$("#prefModal").modal("show"); |
266 |
$("#prefModal").modal("show"); |
269 |
- |
|
|