function panelizer_features_export_alter in Panelizer 7.2
Same name and namespace in other branches
- 7 panelizer.module \panelizer_features_export_alter()
Implements hook_features_export_alter().
File
- ./panelizer.module, line 988 
- The Panelizer module attaches panels to entities, providing default panels and allowing each panel to be configured independently by privileged users.
Code
function panelizer_features_export_alter(&$export, $module_name) {
  if (!empty($export['features']['panelizer_defaults'])) {
    foreach ($export['features']['panelizer_defaults'] as $machine_name) {
      list($entity_type, $bundle) = explode(':', $machine_name);
      $variables = array(
        'panelizer_defaults_' . $entity_type . '_' . $bundle,
        'panelizer_' . $entity_type . ':' . $bundle . '_allowed_layouts',
        'panelizer_' . $entity_type . ':' . $bundle . '_allowed_types',
        'panelizer_' . $entity_type . ':' . $bundle . '_default',
      );
      if (module_exists('strongarm')) {
        foreach ($variables as $key => $variable) {
          if (variable_get($variable) === NULL) {
            unset($variables[$key]);
          }
        }
        $variables = array_diff($variables, array_keys(strongarm_vars_load()));
      }
      foreach ($variables as $variable) {
        $export['features']['variable'][$variable] = $variable;
      }
    }
  }
  return array();
}