Something like...
PHP:
batch_open();
foreach doodad in get_inventory()
if(is_displayable(doodad) && display_amount(doodad) < 1)
put_display(1, doodad);
batch_close();
The
batch_open() and
batch_close() commands are there to ensure that items are moved to your display case in groups of 11 instead of 1 at a time.
get_inventory() produces a map of all items in your inventory. This does not include the contents of your closet, so if you want items in your closet to be included, I'd have to do it slightly differently.