You are here

function patterns_rearrange_data in Patterns 6

Same name and namespace in other branches
  1. 5 patterns.module \patterns_rearrange_data()
  2. 6.2 patterns.module \patterns_rearrange_data()
1 call to patterns_rearrange_data()
patterns_load_string_xml in ./patterns.module

File

./patterns.module, line 1793
Enables extremely simple adding/removing features to your site with minimal to no configuration

Code

function patterns_rearrange_data($pattern) {
  foreach ($pattern as $key => $value) {
    if (is_string($key)) {
      unset($pattern[$key]);
    }
    else {
      if ($value['tag'] == 'actions') {
        $pattern[$key] = patterns_rearrange_data($value);
        $pattern[$key]['tag'] = 'actions';
      }
      else {
        $pattern[$key] = _patterns_rearrange_data($value);
      }
    }
  }
  return $pattern;
}