If you want your front-end to automatically switch your game list according to what controls are installed, here are a couple ways you might approach the problem.
First, there's the basic problem of letting your computer know what controls are installed. You could do this if each control were a separate USB device with its own encoder, but that gets expensive. A simpler way would be to use a few of your encoder's inputs to flag what controls are being connected.
One way to do that would be to give each individual control you might connect its own set of inputs on the encoder, along with one extra one to signal that the control is attached. Another way would be to separate the available inputs into banks, and use three or four of the inputs in each bank to signal what
type of control is attached to the bank (joystick, buttons, etc.) I would probably go for the second approach, and have the banks correspond to "left-to-right" positions on the console.
I think it'd also be possible to do this with a single, specialized USB joystick encoder - set up such that any time a set of controls is attached or removed, it would signal to the computer that the USB joystick was removed, then re-connected with a new configuration. But that's a complicated solution, since (as far as I know) there is no such pre-made encoder for modular controls available.
The front-end would then have to check the available controls, determine whether there's a reasonable mapping from the connected control configuration to the games on the list, and if so, create the mapping. It would have to look at each game, trying to fit: like if it had two joysticks with six buttons each, it could trivially map out controls for Neo Geo games and Street Fighter variants - and it would have a few options for dual-stick games like Smash TV (either use both sticks for a single player, or use the buttons as the "second stick" for each player) One of the reasons I suggested having the banks go left-to-right is so the front-end would have an easier time mapping the controls, determining how many players can be supported, etc.
Of course, the next problem is letting the
user know what the control mapping is. A simple way to do that would be to pop up a screen when loading a game. Ideally the screen would provide a very good representation of the control panel configuration (another reason for having the input banks be positional) with each control labeled.
Personally, if I were building a modular panel I
would want it to be easy for
me to change the configuration (including the control mappings for games), but I wouldn't want it to be something that the front-end would
prompt the player to do. If I had people over who weren't familiar with my system (pretty much anybody who doesn't help
build it) there are two factors:
1: I wouldn't want them fiddling with my machine's innards.
2: I wouldn't want to complicate the game-playing experience for them by having a dialogue pop up saying "Open the storage door and replace this module with that module..."
For those reasons, I'd treat control swapping as strictly an administrative task. Maybe I'd even key-lock the controls in place. (If you approach the problem from this angle, you can use a
much simpler solution: something like what Samstag suggested.

But I'd make the non-playable games completely invisible from the front-end.)