You are here

function hook_panels_ipe_panels_display_presave in Panels 8.4

Same name and namespace in other branches
  1. 8.3 panels_ipe/panels_ipe.api.php \hook_panels_ipe_panels_display_presave()

Act on a Panels Display before it is saved via the IPE.

Parameters

\Drupal\panels\Plugin\DisplayVariant\PanelsDisplayVariant $panels_display: The current Panels display.

array $layout_model: The decoded LayoutModel from our App.

File

panels_ipe/panels_ipe.api.php, line 23
Hooks specific to the Panels IPE module.

Code

function hook_panels_ipe_panels_display_presave(PanelsDisplayVariant $panels_display, array $layout_model) {
  if (isset($layout_model['use_custom_storage'])) {
    $configuration = $panels_display
      ->getConfiguration();
    $panels_display
      ->setStorage('custom_storage_key', $configuration['storage_id']);
  }
}