You are here

function popupformat_features_export in Popup 8

Same name and namespace in other branches
  1. 7 modules/popup_ui/includes/popup_ui.features.inc \popupformat_features_export()
  2. 7.x modules/popup_ui/includes/popup_ui.features.inc \popupformat_features_export()
  3. 6.x modules/popup_ui/includes/popup_ui.features.inc \popupformat_features_export()

Implementation of [component]_features_export()

File

modules/popup_ui/includes/popup_ui.features.inc, line 27

Code

function popupformat_features_export($data, &$export, $module_name = '') {
  module_load_include('inc', 'popup_ui', 'includes/popup_ui.admin');
  module_load_include('inc', 'popup', 'includes/popup.util');
  $formats = _popup_ui_formatter_settings();
  $styles = _popup_styles();
  $effects = _popup_effects();
  $export['dependencies']['popup_ui'] = 'popup_ui';
  foreach ($data as $instance) {
    if ($formats[$instance]['style']) {
      $matches = array();
      preg_match('/\\/modules\\/([^\\/]+)/', $styles[$formats[$instance]['style']], $matches);
      $module = $matches[1];
      $export['dependencies'][$module] = $module;
    }
    if ($formats[$instance]['effect']) {
      foreach (module_implements('popup_effects') as $module) {
        $provided = module_invoke($module, 'popup_effects');
        $module_effects = array_shift($provided);
        if (isset($module_effects[$formats[$instance]['effect']])) {
          $export['dependencies'][$module] = $module;
          break;
        }
      }
    }
    $export['features']['popupformat'][$instance] = $instance;
  }
  return array();
}