I want other modules to have the opportunity to alter the list of available layouts, based on some business logic.
I have added a drupal_alter('panels_layouts_available', $layouts) in the function ajax_change_layout() in panels_ipe/plugins/display_renderers/panels_renderer_ipe.class.php
// Let other modules filter the layouts.
drupal_alter('panels_layouts_available', $layouts);
In this way a module can use hook_panels_layouts_available_alter(&$layouts) to filter out layouts, for example a certain role isn't allowed to use to 1 col layout.
Comments
Comment #1
michaelmol commentedPatch attached
Comment #3
michaelmol commentedComment #5
michelleThe patch in #3 applies cleanly and works fine. I was able to filter out one of the available layouts by unsetting it in the alter function.
Comment #7
japerrylooks good and simple. Committed.