I am working on adding some new features to this module:
- Enable / disable modules for each mode.
- Set variables depending on mode.
- Add some hooks so other modules can react on mode changes too.

For this, the module needs some initial rework. The plan goes like this:
1. Trimming down main Mode module so it just keeps the list of modes / messages / switcher and some storage.
2. Adding a few hooks to it so other modules can respond when the 'mode' is about to change / has changed.
3. Moving the permissions feature to mode_permissions, then adding mode_modules, mode_variables....?

This will be worked out in the 7.x-2.x branch. No upgrade path yet from 7.x-1.x

Comments

jose reyero’s picture

Created branch 7.x-2.x
- Split permissions into mode_permissions module.
- Introduced hook_mode_switch_mode()

jose reyero’s picture

StatusFileSize
new53.58 KB
new23.96 KB

Added 'Mode modules'. Two screenshots of these new modules.

Mode permissions tab
Mode modules

jose reyero’s picture

StatusFileSize
new57.26 KB

Added the 'Mode variables' module, which allows selecting variables from a list and set values for it. This one depends on Variable, http://drupal.org/project/variable

Mode variables screenshot

Zen’s picture

Hello Jose,

This looks great. A few initial notes:

  • On the module settings form, I believe that the "None" (in the above screenshot) or "Keep" in the latest checkout, should be renamed to "Ignore" which I believe is its purpose.
  • I am happy to see the ignore option being handled for Modules. How about settings and variables?
  • One gnarly issue is the question of how best to handle/incorporate structural changes to the site into these settings pages. New modules, variables and permissions as well as missing equivalents might be important considerations.

As I mentioned in the e-mail, this is an excellent start. I will be back with more observations soon. We can get an alpha out of the door shortly.

-K

jose reyero’s picture

Version: 7.x-1.0-alpha1 » 7.x-2.x-dev

On the module settings form, I believe that the "None" (in the above screenshot) or "Keep" in the latest checkout, should be renamed to "Ignore" which I believe is its purpose.

Right, changed that.

I am happy to see the ignore option being handled for Modules. How about settings and variables?

Variables don't need that since you only add the variables you want to change.

One gnarly issue is the question of how best to handle/incorporate structural changes to the site into these settings pages. New modules, variables and permissions as well as missing equivalents might be important considerations.

For variables, this relies on Variable module, which is the one that allows building these custom settings forms, so if you want more variables, just need to define them them in hook_variable_info(). I don't think we have any issue with new modules being added as we don't touch any variable that is not added to the set.

For permissions I think we should take some similar approach to variables so we can select which roles and permissions are going to be changed. Then we won't have any issue with new modules being added.

So if you like the same approach for permissions than for variables (first add the ones you want, then set) just create an issue for me, I can take care of that. Actually I am not using the permissions part atm because of that.