I'd love to be able to have more control over who can do what with this module. I'm thinking of the two extra tabs on the node edit screen, blocks and zones. I would like to be able to have an administrator choose which blocks should be available to the editors who control the zones.
One problem with this might be if there are user- or editor-contributed blocks, e.g. when using the node_block module, since it would require the help of an administrator every time a new block is published and an editor wants to place it in one of the zones. Therefore I propose to display the exact opposite on the blocks screen, i.e. which blocks should NOT be available to the editor.
This last proposal would be a great module in itself on a generic level. Earlier I have wanted to be able to control which blocks should be available globally in Drupal, e.g. in the normal block administration or using the context module. Do you think that your code could be converted into such a module?
Marcus
Comments
Comment #1
bengtan commentedHi,
> I'm thinking of the two extra tabs on the node edit screen, blocks and zones.
One solution would be to add a new permission for each tab.
> I would like to be able to have an administrator choose which blocks should be available to the editors who control the zones.
This could also be inbuilt into Composite Layout, but now that you've mentioned the idea of making it a standalone module ... I think this would be the cleaner approach. If you or someone else creates such a module that restricts which blocks can be configured by a role, then I'd be happy to adjust Composite Layout to respect or integrate with it.
Comment #2
marcushenningsen commentedThanks for commenting. I'll try to take a look at it.
Marcus
Comment #3
marcushenningsen commentedOk, I looked at it, and I don't think it's possible to make a module that enables or disables blocks globally. It would only make sense if this on/off status was respected by all other modules making use of blocks, and there is no way to control that. The only solution, as I see it, would be to introduce a new table in the database, but making other modules take notice of this would probably be impossible.
So, I'm suppose I'm back to tuning the access control of your module. Introducing a new permission is easy, but, as explained in my initial post, I'd need to turn things around on the blocks screen. Would it be possible to make the default on? In that way all new blocks will be available to the composite user.
Marcus
Comment #4
marcushenningsen commentedAm I right that the default is controlled in line 44 of composite.pages.inc?
'#default_value' => $selected,Sorry, but I'm not sure how to make the default value "on". Can you lead me in the right direction?
Marcus
Comment #5
bengtan commentedHi,
It's actually a bit more complicated than that.
For each 'composite reference item' that is visible on the Zones tab, there is an entry in the {node_composite_references} table. If you want all blocks to be available by default, when Composite Layout is enabled for a node, you have to (somehow) cause an entry to be inserted into this table for every block.
You will need to add code that understands how to add entries to the {node_composite_references} table.
Simply poking line 44 of composite.pages.inc means that if the user visits the Blocks tab, all blocks will be checked, but they still have to click Save button. This is probably not what you want.
Comment #6
bengtan commentedExpiring this issue as it is old and uncertain whether it is still applicable.