You are here

function layout_responsive_merge_default_settings in Layout 7

Merge current settings with defualt settings.

4 calls to layout_responsive_merge_default_settings()
layout_responsive_panels in plugins/layouts/responsive.inc
Return the actual list of regions for this responsive panel.
layout_responsive_settings_form in plugins/layouts/responsive.inc
Form callback. Add our form elements for data interchange.
theme_layout_responsive in plugins/layouts/responsive.inc
Draw the responsive layout.
theme_layout_responsive_admin in plugins/layouts/responsive.inc
Draw the responsive layout admin interface.

File

plugins/layouts/responsive.inc, line 157

Code

function layout_responsive_merge_default_settings(&$settings, &$layout) {

  // This indicates that this is a layout that they used the checkbox
  // on. The layout is still 'flexible' but it's actually pointing
  // to another stored one and we have to load it.
  if (!empty($settings['layout'])) {
    $layout = panels_get_layout('responsive:' . $settings['layout']);
  }
  if (!empty($layout['layout'])) {
    $settings = $layout['layout']->settings;
    if ($settings) {
      return $settings;
    }
  }
  if (empty($settings)) {

    // "Clone" the regions and overrides from a default layout. This lets
    // people edit the default layout as a base for all new layouts. The default
    // implementation of the default layout is in an exported responsive layout
    // in layout.module (see layout_default_panels_layout()).
    ctools_include('plugins', 'panels');
    $default_layout_name = variable_get('layout_default_responsive_layout', 'responsive:default');
    $default_layout = panels_get_layout($default_layout_name);
    if (!empty($default_layout)) {
      $settings['regions'] = $default_layout['layout']->settings['regions'];
      $settings['overrides'] = $default_layout['layout']->settings['overrides'];
    }
  }
  return $settings;
}