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

michaelmol’s picture

Status: Active » Needs review
StatusFileSize
new696 bytes

Patch attached

Status: Needs review » Needs work

The last submitted patch, 1: panels-let-other-modules-filter-layouts-2259957-1.patch, failed testing.

michaelmol’s picture

Status: Needs work » Needs review
StatusFileSize
new698 bytes

michelle’s picture

Status: Needs review » Reviewed & tested by the community

The 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.

  • japerry committed 23e4ea8 on 7.x-3.x authored by michaelmol
    Issue #2259957 by michaelmol: Let other modules filter the available...
japerry’s picture

Status: Reviewed & tested by the community » Fixed

looks good and simple. Committed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.