You are here

public function PageManagerHandlerConfiguration::saveToActiveStore in Configuration Management 7.2

Implements Drupal\configuration\Config\Configuration::saveToActiveStore().

Overrides CtoolsConfiguration::saveToActiveStore

File

lib/Drupal/configuration/Config/PageManagerHandlerConfiguration.php, line 62
Definition of Drupal\configuration\Config\PageManagerHandlerConfiguration.

Class

PageManagerHandlerConfiguration

Namespace

Drupal\configuration\Config

Code

public function saveToActiveStore(ConfigIteratorSettings &$settings) {
  ctools_include('export');
  $object = ctools_export_crud_load($this
    ->getComponent(), $this
    ->getIdentifier());
  if ($object) {
    ctools_export_crud_delete($this
      ->getComponent(), $object);
  }
  $data = $this
    ->getData();
  $data->export_type = NULL;

  // get title_pane key if configured.
  if (isset($data->conf['display']->title_pane)) {
    $title_pane = $data->conf['display']->title_pane;
  }
  $display = panels_save_display($data->conf['display']);

  // title_pane configuration workaround.
  if (isset($display->content[$title_pane])) {
    $pid = $display->content[$title_pane]->pid;
    $display->{$title_pane} = $pid;
    db_update('panels_display')
      ->fields(array(
      'title_pane' => $pid,
    ))
      ->condition('did', $display->did)
      ->execute();
  }
  $data->conf['did'] = $data->conf['display']->did;
  unset($data->conf['display']);
  ctools_export_crud_save($this
    ->getComponent(), $data);
  $settings
    ->addInfo('imported', $this
    ->getUniqueId());
}