Revision 4abd750d
Added by Stephen Beaver over 9 years ago
src/usr/local/www/system_usermanager_addprivs.php | ||
---|---|---|
188 | 188 |
->setHelp('Hold down CTRL (PC)/COMMAND (Mac) key to select multiple items'); |
189 | 189 |
// ->setAttribute('style', 'height:400px;'); |
190 | 190 |
|
191 |
|
|
192 |
$section->addInput(new Form_Input( |
|
193 |
'filtertxt', |
|
194 |
'Filter', |
|
195 |
'text', |
|
196 |
null |
|
197 |
))->setHelp('Show only the choices containing this term'); |
|
198 |
|
|
199 |
$btnfilter = new Form_Button( |
|
200 |
'btnfilter', |
|
201 |
'Filter', |
|
202 |
null, |
|
203 |
'fa-filter' |
|
204 |
); |
|
205 |
|
|
206 |
$btnfilter->addClass('btn btn-info'); |
|
207 |
|
|
208 |
$form->addGlobal($btnfilter); |
|
209 |
|
|
210 |
$btnclear = new Form_Button( |
|
211 |
'btnclear', |
|
212 |
'Clear', |
|
213 |
null, |
|
214 |
'fa-times' |
|
215 |
); |
|
216 |
|
|
217 |
$btnclear->addClass('btn btn-warning'); |
|
218 |
|
|
219 |
$form->addGlobal($btnclear); |
|
220 |
|
|
191 | 221 |
if (isset($userid)) { |
192 | 222 |
$section->addInput(new Form_Input( |
193 | 223 |
'userid', |
... | ... | |
232 | 262 |
|
233 | 263 |
// When the 'sysprivs" selector is clicked, we display a description |
234 | 264 |
$('.multiselect').click(function() { |
235 |
$('#pdesc').html('<span style="color: green;">' + descs[$(this).children('option:selected').index()] + '</span>'); |
|
265 |
$('#pdesc').html('<span class="text-info">' + descs[$(this).children('option:selected').index()] + '</span>'); |
|
266 |
}); |
|
267 |
|
|
268 |
$('#btnfilter').prop('type', 'button'); |
|
269 |
|
|
270 |
$('#btnfilter').click(function() { |
|
271 |
searchterm = $('#filtertxt').val().toLowerCase(); |
|
272 |
|
|
273 |
$(".multiselect > option").each(function() { |
|
274 |
if (this.text.toLowerCase().indexOf(searchterm) > -1 ) { |
|
275 |
$(this).show(); |
|
276 |
} else { |
|
277 |
$(this).hide(); |
|
278 |
} |
|
279 |
}); |
|
236 | 280 |
}); |
237 | 281 |
|
282 |
$('#btnclear').prop('type', 'button'); |
|
283 |
|
|
284 |
$('#btnclear').click(function() { |
|
285 |
$(".multiselect > option").each(function() { |
|
286 |
$(this).show(); |
|
287 |
}); |
|
288 |
}); |
|
289 |
|
|
290 |
$('#filtertxt').keypress(function(e) { |
|
291 |
if(e.which == 13) { |
|
292 |
e.preventDefault(); |
|
293 |
$('#btnfilter').trigger('click'); |
|
294 |
} |
|
295 |
}); |
|
296 |
|
|
297 |
// On submit unhide all options (or else they will not submit) |
|
298 |
$('form').submit(function() { |
|
299 |
$(".multiselect > option").each(function() { |
|
300 |
$(this).show(); |
|
301 |
}); |
|
302 |
}); |
|
238 | 303 |
}); |
239 | 304 |
//]]> |
240 | 305 |
</script> |
Also available in: Unified diff
Fixed #5049