1.20.x layout.admin.inc layout_get_legacy_region_mapping($old, $new)

Returns an array of mappings from old region names to new.

File

modules/layout/layout.admin.inc, line 829
Admin page callbacks for the Layout module.

Code

function layout_get_legacy_region_mapping($old, $new) {
  $region_mapping = array();
  $legacy = array('one_column', 'two_column', 'two_column_flipped', 'three_three_four_column');
  $bootstrap = array('boxton', 'geary', 'harris', 'moscone', 'moscone_flipped', 'rolph', 'simmons', 'sutro', 'taylor', 'taylor_flipped');

  if (in_array($old, $legacy) && in_array($new, $bootstrap)) {
    $region_mapping = array(
      'sidebar_first' => 'sidebar',
      'sidebar_second' => 'sidebar2',
      'triptych_first' => 'third1',
      'triptych_middle' => 'third2',
      'triptych_last' => 'third3',
      'footer_firstcolumn' => 'quarter1',
      'footer_secondcolumn' => 'quarter2',
      'footer_thirdcolumn' => 'quarter3',
      'footer_fourthcolumn' => 'quarter4',
    );
  }

  if (in_array($old, $bootstrap) && in_array($new, $legacy)) {
    $region_mapping = array(
      'sidebar' => 'sidebar_first',
      'sidebar2' => 'sidebar_second',
      'third1' => 'triptych_first',
      'third2' => 'triptych_middle',
      'third3' => 'triptych_last',
      'quarter1' => 'footer_firstcolumn',
      'quarter2' => 'footer_secondcolumn',
      'quarter3' => 'footer_thirdcolumn',
      'quarter4' => 'footer_fourthcolumn',
    );
  }

  return $region_mapping;
}