Active
Project:
Mode
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
19 Jul 2012 at 15:08 UTC
Updated:
26 Jul 2012 at 09:34 UTC
Jump to comment: Most recent file
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
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | mode_rework-03-variables.png | 57.26 KB | jose reyero |
| #2 | mode_rework-01-permissions.png | 23.96 KB | jose reyero |
| #2 | mode_rework-02-modules.png | 53.58 KB | jose reyero |
Comments
Comment #1
jose reyero commentedCreated branch 7.x-2.x
- Split permissions into mode_permissions module.
- Introduced hook_mode_switch_mode()
Comment #2
jose reyero commentedAdded 'Mode modules'. Two screenshots of these new modules.
Comment #3
jose reyero commentedAdded 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
Comment #4
Zen commentedHello Jose,
This looks great. A few initial notes:
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
Comment #5
jose reyero commentedRight, changed that.
Variables don't need that since you only add the variables you want to change.
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.